Here is a simple way to add favicon to you webpage. It is done using JSP and javascript:
<script language="javascript">
var link = document.createElement('link');
link.type = 'image/x-icon';
link.rel = 'shortcut icon';
link.href = '<%=request.getContextPath()%>/images/logos/favicon.ico';
document.getElementsByTagName('head')[0].appendChild(link);
</script>
Make sure to add your icon into the specified location relative to the context root.
Monday, April 5, 2010
Tuesday, March 9, 2010
Spring and JNDI
0
comments
Labels:
JNDI,
Spring,
Technology
You can inject a jndi object to Spring bean as follows:
In your server.xml file configure objects to be registered in JNDI (sample is for tomcat server)
as follows:
The resource tag within the context tag registers the bean in JNDI. Now, to inject the JNDI object into a Spring bean during bean initialization, do the following in you spring.xml bean configuration<context source="org.eclipse.jst.jee.server:Sample" reloadable="true" path="/Sample" docbase="Sample"> <resource factory="org.apache.naming.factory.BeanFactory" auth="Container" type="com.test.SampleBean" name="services/SampleBean"> </context>
The above configuration, loads the bean available in the JNDI directory into the new Spring Bean<bean class="org.springframework.jndi.JndiObjectFactoryBean" id="SampleBeanWithJNDIInjection"><property name="jndiName"><value>java:comp/env/services/SampleBean</value></property><property name="resourceRef" value="true"></property> </bean>
Love
SJ
Subscribe to:
Posts (Atom)