I have a JSP, which calls an action using the <s:action>
tag:
<s:form>
<s:action name="myaction"
namespace="/utente/include" executeResult="true"
ignoreContextParams="true" var="formattazione" />
//do something
</s:form>
The action myaction
is called, i can follow the flow debugging it. It finishes fine without error, it returns success, but then there is an error and i can't understand which one.
The action definition:
<package name="utente-include" namespace="/utente/include" extends="tiles-default">
<action name="myaction" class="com.emaborsa.doctracing.web.action.formattazione.FormattazioneCriteriUtenteAction"
method="formattazione">
<result type="tiles">mytiles.def</result>
</action>
</package>
The tiles definition:
<definition name="mytiles.def" template="/pages/empty.jsp">
<put-attribute name="body" value="/pages/mypage.jsp"/>
</definition>
The empty.jsp:
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
<tiles:insertAttribute name="body" />
The Exception:
GRAVE: Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
at org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport.java:49)
at org.apache.jsp.pages.utente.elencoUtenti_jsp._jspx_meth_s_005fif_005f0(elencoUtenti_jsp.java:215)
at org.apache.jsp.pages.utente.elencoUtenti_jsp._jspx_meth_s_005fform_005f0(elencoUtenti_jsp.java:155)
at org.apache.jsp.pages.utente.elencoUtenti_jsp._jspService(elencoUtenti_jsp.java:87)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
.....
EDIT:
I thought it works, but it doesn't. Actually the system doesn't crash, but the tiles-page is not included in the mail page. The Exception i get:
org.apache.tiles.impl.CannotRenderException: No request dispatcher returned for path '/../pages/common/myPage.jsp'
at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:680)
at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:633)
at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:322)
at org.apache.struts2.views.tiles.TilesResult.doExecute(TilesResult.java:105)
at org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:186)
at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:361)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:265)
at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:163)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
Here my myPage.jsp (actually it doesn't matter what is written in):
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<div class="navigazioneElenco" id="navigazioneElenco">
</div>
Here I share a part of my project. There is only the part which is not working... DOWNLOAD