Z
zakasbanda
Guys,
I need your help. Here is the problem ...
Following is typical structure of my jsps
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<tiles:insert page="/layout/layout.jsp" flush="true">
<tiles
ut name="title" value="sometitle" />
<tiles
ut name="tabstate" value="sometabstate" />
<tiles
ut name="menu" value="/menu.jsp" />
<tiles
ut name="header" value="/header.jsp" />
<tiles
ut name="body" value="/body.jsp" />
<tiles
ut name="footer" value="/footer.jsp" />
</tiles:insert>
In the included/nested jsps (header, body et) .... I use usebeans, as
in following example,
<jsp:useBean id="data" type="java.lang.String" scope="request" />
As you can see, I am using "type" and therefore "data" must be present
in scope when the jsp is rendered. However I can not stop the user
from accessing this jsp direct and request might not have "data" set
in attribute. In this case the jsp blows up ugly on the browser, as
follows...
[ServletException in:/header.jsp] bean data not found within scope'
I would like to forward to some nice error.jsp if this happens. Could
you guys please help me out?
I have tried following in web.xml,
<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>/error.jsp</location>
</error-page>
While this solution work from top level jsp, it does not seem to be
kicking if there is an exception at the nested jsp level.
Thanks
I need your help. Here is the problem ...
Following is typical structure of my jsps
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<tiles:insert page="/layout/layout.jsp" flush="true">
<tiles
<tiles
<tiles
<tiles
<tiles
<tiles
</tiles:insert>
In the included/nested jsps (header, body et) .... I use usebeans, as
in following example,
<jsp:useBean id="data" type="java.lang.String" scope="request" />
As you can see, I am using "type" and therefore "data" must be present
in scope when the jsp is rendered. However I can not stop the user
from accessing this jsp direct and request might not have "data" set
in attribute. In this case the jsp blows up ugly on the browser, as
follows...
[ServletException in:/header.jsp] bean data not found within scope'
I would like to forward to some nice error.jsp if this happens. Could
you guys please help me out?
I have tried following in web.xml,
<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>/error.jsp</location>
</error-page>
While this solution work from top level jsp, it does not seem to be
kicking if there is an exception at the nested jsp level.
Thanks