For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub
- This topic has 1 reply, 2 voices, and was last updated 19 years, 3 months ago by
Riyad Kalla.
-
AuthorPosts
-
hi all :
here is the sipleset code to link jsf with spring but why no putput produced.it is deplyed and run with no error but no o/p. he files are:
1 –
package test;public class JsfBean {
private SpringBean _springBean;public JsfBean() {
super();
}public SpringBean getSpringBean() {
return _springBean;
}public void setSpringBean(SpringBean paramSpringBean) {
_springBean = paramSpringBean;
}
}2 –
package test;
public class SpringBean {
String _text ;public SpringBean() {
super();
}public String getText() {
return _text;
}public void setText(String paramText) {
_text = paramText;
}
}
3 – faces-config.xml
<?xml version=”1.0″ encoding=”UTF-8″?>
<!DOCTYPE faces-config PUBLIC “-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN” “http://java.sun.com/dtd/web-facesconfig_1_1.dtd”><faces-config >
<application>
<variable-resolver>org.springframework.web.jsf.DelegatingVariableResolver</variable-resolver>
<locale-config>
<default-locale>en</default-locale>
<supported-locale>en</supported-locale>
<supported-locale>es</supported-locale>
</locale-config>
</application><managed-bean>
<description>JSF managed bean referencing a spring bean</description>
<managed-bean-name>jsfBean</managed-bean-name>
<managed-bean-class>test.JsfBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean><navigation-rule>
<from-view-id>/showText.jsp</from-view-id>
</navigation-rule></faces-config>
4 – applicationContext.xml
<?xml version=”1.0″ encoding=”UTF-8″?>
<!DOCTYPE beans PUBLIC “-//SPRING//DTD BEAN//EN” “http://www.springframework.org/dtd/spring-beans.dtd”><beans>
<bean id=”springBean” class=”test.SpringBean”>
<property name=”text”><value>some example text</value></property>
</bean>
</beans>5 – web.xml
<?xml version=”1.0″ encoding=”UTF-8″?>
<web-app xmlns=”http://java.sun.com/xml/ns/j2ee” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” version=”2.4″ xsi:schemaLocation=”http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd”>
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>/WEB-INF/faces-config.xml</param-value>
</context-param>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.faces</url-pattern>
</servlet-mapping>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param><listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener><listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener></web-app>
July 7, 2006 at 10:52 am #254315
Riyad KallaMemberI’ve asked our JSF guy to take a look when he gets a chance.
-
AuthorPosts