Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Using Struts 2 plugins for JSF and Tiles together in one app  RSS feed

Martin Ebenezer
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to use Strut2 plugins for JSF and Tiles together and I am facing difficulties and getting them configured to work right within a single Struts 2 application.

My struts.xml contains package as below:

<package name="tiles" extends="tiles-default, jsf-default" namespace="/tiles">

<result-type name="jsf" class="org.apache.struts2.jsf.FacesResult" />

<interceptor-stack name="jsfFullStack">
<interceptor-ref name="params" />
<interceptor-ref name="basicStack"/>
<interceptor-ref name="jsfStack"/>

<default-interceptor-ref name="jsfFullStack"/>

<action name="Home" class="demo.action.HomeAction">
<result name="success" type="tiles"></result>
<result name="redirect" type="tiles"></result>


and my web.xml has the below content:




The tiles.xml has content like below:
<definition name="" template="/tiles/layout.jsp">
<put-attribute name="body" value="/tiles/home.jsp"/>
<put-attribute name="footer" value="/tiles/footer.jsp"/>

The JSP file home.jsp has JSF core and html tags but I keep getting the following exception message:
at javax.faces.webapp.UIComponentClassicTagBase.setJspId(
at org.apache.jsp.tiles.home_jsp._jspx_meth_h_005fform_005f0(
at org.apache.jsp.tiles.home_jsp._jspService(
at org.apache.jasper.runtime.HttpJspBase.service(
at javax.servlet.http.HttpServlet.service(
at org.apache.jasper.servlet.JspServletWrapper.service(
at org.apache.jasper.servlet.JspServlet.serviceJspFile(
at org.apache.jasper.servlet.JspServlet.service(
at javax.servlet.http.HttpServlet.service(

The home.jsp contains the below code:
<%@ taglib prefix="f" uri=""%>
<%@ taglib prefix="h" uri=""%>
<%@ taglib uri="" prefix="tiles"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<p>This example illustrates the Struts 2 /Tiles Plugin with JSF.</p>
<h:form id="enterNameFormId">
<h:outputText value="First Name:" />
<h:inputText id="firstName" size="30"
value="#{}" required="true">
<f:validateLength minimum="2" maximum="30" />
<h:message for="firstName" />
<br />
<h:outputText value="Last Name:" />
<h:inputText id="lastName" size="30"
value="#{}" required="true">
<f:validateLength minimum="2" maximum="30" />
<h:message for="lastName" />
<br />
<h:commandButton value="Say Hello" type="submit" action="#{action.sayHello}"/>


If any of you have configured both the plugins for JSF and Tiles in one Struts 2 app please provide me some info on the configuration that needs to be done?
Appreciate your help.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!