You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by "Sekar, Sowmya" <ss...@ucsd.edu> on 2010/02/25 20:59:54 UTC
Struts with JSF and Tiles error
Hi,
I have an existing Struts 1 application with Tiles and JSP. I would like to use JSF 2 components instead of the JSP tags and leave the business logic and actions as is.
These are the steps I followed :
1. Copied jsf-impl , jsf-api.jar and struts-faces-1.3.8.jar in my web-inf/lib folder of my application
2. Configured the faces servlet in my web.xml
<servlet>
<servlet-name>faces</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>faces</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>/do/*</url-pattern>
</servlet-mapping>
I also configured my action servlet as follows :
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
I forwarded a menu option to a page through an action class using tiles. The target page is /faces/pages/home.jsp.
After the action is executed, it throws the following error -
WARNING: executePhase(RENDER_RESPONSE 6,com.sun.faces.context.FacesContextImpl@1ebf89f) threw exception
java.lang.NullPointerException
at com.sun.faces.renderkit.RenderKitImpl.createResponseWriter(RenderKitImpl.java:183)
FacesContext is returned as null.
Please help
Sowmya Sekar
Re: Struts with JSF and Tiles error
Posted by Antonio Petrelli <an...@gmail.com>.
Please ask the Struts Users mailing list:
http://struts.apache.org/mail.html
However your request to use JSF 2 together with Struts 1.3 and
Struts-Faces is likely to fail, since AFAIK Struts-Faces supports only
JSF 1.
Antonio
2010/2/25 Sekar, Sowmya <ss...@ucsd.edu>:
> Hi,
> I have an existing Struts 1 application with Tiles and JSP. I would like to use JSF 2 components instead of the JSP tags and leave the business logic and actions as is.
> These are the steps I followed :
>
> 1. Copied jsf-impl , jsf-api.jar and struts-faces-1.3.8.jar in my web-inf/lib folder of my application
>
> 2. Configured the faces servlet in my web.xml
> <servlet>
> <servlet-name>faces</servlet-name>
> <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
> <init-param>
> <param-name>config</param-name>
> <param-value>/WEB-INF/struts-config.xml</param-value>
> </init-param>
> <load-on-startup>1</load-on-startup>
>
> </servlet>
>
>
> <servlet-mapping>
> <servlet-name>faces</servlet-name>
> <url-pattern>/faces/*</url-pattern>
> </servlet-mapping>
>
> <servlet-mapping>
> <servlet-name>action</servlet-name>
> <url-pattern>/do/*</url-pattern>
>
> </servlet-mapping>
>
>
>
> I also configured my action servlet as follows :
>
>
> <servlet>
> <servlet-name>action</servlet-name>
> <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
> <init-param>
> <param-name>config</param-name>
> <param-value>/WEB-INF/struts-config.xml</param-value>
> </init-param>
>
> <load-on-startup>2</load-on-startup>
>
> </servlet>
>
>
>
> I forwarded a menu option to a page through an action class using tiles. The target page is /faces/pages/home.jsp.
>
> After the action is executed, it throws the following error -
>
>
> WARNING: executePhase(RENDER_RESPONSE 6,com.sun.faces.context.FacesContextImpl@1ebf89f) threw exception
> java.lang.NullPointerException
>
> at com.sun.faces.renderkit.RenderKitImpl.createResponseWriter(RenderKitImpl.java:183)
>
>
>
> FacesContext is returned as null.
>
>
>
>
>
> Please help
>
>
>
>
>
>
>
>
>
> Sowmya Sekar
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org