Here is the entire function from the compiled JSP 769-800
private boolean _jspx_meth_c_set_12(javax.servlet.jsp.tagext.JspTag
_jspx_th_c_if_7, PageContext pageContext)
throws Throwable {
JspWriter out = pageContext.getOut();
// c:set
org.apache.taglibs.standard.tag.rt.core.SetTag _jspx_th_c_set_12 =
(org.apache.taglibs.standard.tag.rt.core.SetTag)
_jspx_tagPool_c_set_var.get(org.apache.taglibs.standard.tag.rt.core.SetTag.c
lass);
_jspx_th_c_set_12.setPageContext(pageContext);
_jspx_th_c_set_12.setParent((javax.servlet.jsp.tagext.Tag)
_jspx_th_c_if_7);
_jspx_th_c_set_12.setVar("statesxml");
int _jspx_eval_c_set_12 = _jspx_th_c_set_12.doStartTag();
if (_jspx_eval_c_set_12 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_c_set_12 !=
javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = pageContext.pushBody();
_jspx_th_c_set_12.setBodyContent((javax.servlet.jsp.tagext.BodyContent)
out);
_jspx_th_c_set_12.doInitBody();
}
do {
out.write("\r\n\t\t");
if (_jspx_meth_c_out_1(_jspx_th_c_set_12, pageContext))
return true;
out.write("\t\t\r\n\t");
int evalDoAfterBody = _jspx_th_c_set_12.doAfterBody();
if (evalDoAfterBody !=
javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_c_set_12 !=
javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE)
out = pageContext.popBody();
}
if (_jspx_th_c_set_12.doEndTag() ==
javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
return true;
_jspx_tagPool_c_set_var.reuse(_jspx_th_c_set_12);
return false;
}
-----Original Message-----
From: Kris Schneider [mailto:[EMAIL PROTECTED]
Sent: Friday, January 30, 2004 2:07 PM
To: Tag Libraries Users List
Subject: RE: tiles breaks x:forEach
Well, I'm not sure this is helping you any, but I'm curious to see where it
leads ;-). I wish I knew a bit more about Tiles internals, I haven't really
used
it all that much. Anyway, the stack trace is still making me scratch my head
(order of execution):
JobSearch_jsp._jspx_meth_c_set_10(JobSearch_jsp.java:769)
JobSearch_jsp._jspx_meth_x_out_0(JobSearch_jsp.java:793)
...
XPathUtil$JstlVariableContext.getVariableValue
XPathUtil$JstlVariableContext.notNull
and the exception is thrown with message:
$prefix:javax.servlet.forward.request_uri
Which, AFAICT, means getVariableValue was trying to do something like:
return
notNull(pageContext.findAttribute("javax.servlet.forward.request_uri"),
null,
"javax.servlet.forward.request_uri");
Can you correlate lines 769 and 793 of the generated code with
JobSearch.jsp?
Huh, there seems to be a bug in the 1.1.0-B1 version of XPathUtil.
JstlVariableContext.notNull essentially looks like:
private Object notNull(Object o,
String prefix,
String localName) throws UnresolvableException {
if (o == null) {
throw new UnresolvableException("$" +
(prefix==null?"":"prefix"+":") +
localName);
}
return o;
}
Which means that instead of seeing the *value* of prefix in the exception
message (when it's non-null), you'll see the literal "prefix". So it should
probably be:
private Object notNull(Object o,
String prefix,
String localName) throws UnresolvableException {
if (o == null) {
throw new UnresolvableException("$" +
(prefix==null?"":prefix+":") +
localName);
}
return o;
}
Obviously, that shouldn't be impacting your app at all, but you never know
what
you'll find when you go rooting through code...
Quoting [EMAIL PROTECTED]:
> I'll take that into consideration but it doesn't solve the problem
> of the forEach and out tags failing. I really need to be able to
> to use these tags to select into an xml source for other reasons
> besides building options for a select.
>
> In ongoing research into this an x:parse fails with the same exception
> on another page. Again if I change my struts action to directly
> reference the jsp it works instead of a tile definition.
>
> So I tried one step further and tried two different tiles definitions.
> One that referenced the pages directly and one that uses a tiles:insert
> The tiles:insert version fails the same way and the tiles definition that
> directly references the jsp works fine.
>
>
>
> *** this is layout.jsp
> <%@ page language="java" %>
> <%@ taglib uri="/WEB-INF/tld/struts-tiles.tld" prefix="tiles" %>
> <tiles:insert attribute="body-content" ignore="true" />
>
>
> <definition name=".main" path="/WEB-INF/layout/layout.jsp">
> <put name="body-content" value="/WEB-INF/pages/body.jsp"/>
> </definition>
>
> *** this definition causes the jsp to fail
> <definition name=".main.js.jobsearch" extends=".main">
> <put name="title" value="Job Search" />
> <put name="body-content" value="/WEB-INF/pages/JobSearch.jsp" />
> </definition>
>
> *** this definition works
> <definition name=".main.js.jobsearch"
> path="/WEB-INF/pages/JobSearch.jsp" >
> </definition>
>
>
> -----Original Message-----
> From: Kris Schneider [mailto:[EMAIL PROTECTED]
> Sent: Friday, January 30, 2004 12:15 PM
> To: Tag Libraries Users List
> Subject: RE: tiles breaks x:forEach
>
>
> I'm not sure I'm interpreting the exception properly, but it looks like
> JSTL
> is
> trying to resolve javax.servlet.forward.request_uri as an XPath variable
> and
> found it was null. It's as if you tried to do something like:
>
> <c:set ...>
> <x:out select="$javax.servlet.forward.request_uri..."/>
> </c:set>
>
> For the example you've given, it seems more like a job for XSLT (transform
> a
> state into an option):
>
> <x:parse doc="${applicationScope['domain.states']}" var="statedom"/>
> <c:import url="/WEB-INF/xslt/stateoptions.xsl" var="xslt"/>
> <x:transform doc="${statedom}" xslt="${xslt}" var="stateoptions"/>
>
> Of course, you'd have to create stateoptions.xsl...
>
> Quoting [EMAIL PROTECTED]:
>
> > <c:set var="statesxml" >
> > <c:out escapeXml="false"
> > value="${applicationScope['domain.states']}" />
> > </c:set>
> >
> > <x:parse xml="${statesxml}" var="statedom" />
> >
> > <c:set var="stateoptions" >
> > <option value="" >-Choose-</option>
> > <x:forEach var="statenode" select="$statedom//states" >
> > <option value="<x:out select="$statenode/@state" />"
> > >
> > <x:out select="./text()" />
> > </option>
> > </x:forEach>
> > </c:set>
> >
> > Using jdk1.4.2_03, tomcat 5.0.16, struts 1.1 and commons jstl taglib
> > 1.1.0-B1
> >
> > Mind you, this code works when not in a tile. The rest of the page works
> in
> > a
> > tile if I comment out the x:forEach's and x:out's; the x:parse seems to
> > work
> > ok.
> >
> > Thanks
> >
> > -----Original Message-----
> > From: Martin Cooper [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, January 29, 2004 4:52 PM
> > To: Tag Libraries Users List
> > Subject: Re: tiles breaks x:forEach
> >
> >
> > It might help if you could show us the offending JSP code. ;-)
> >
> > --
> > Martin Cooper
> >
> >
> > On Thu, 29 Jan 2004 [EMAIL PROTECTED] wrote:
> >
> > > Anyone else run into a similiar situation.
> > >
> > > I have a page that was running fine parsing and looping
> > > through xml data.
> > >
> > > I try to incorporate this page as a tile and on my first
> > > x:forEach statement I get:
> > >
> > > [ServletException in:/WEB-INF/pages/JobSearch.jsp]
> > > $prefix:javax.servlet.forward.request_uri'
> > >
> > > and the exception in the tomcat log is:
> > > 2004-01-29 14:31:05 ApplicationDispatcher[/employer] Servlet.service()
> > for
> > > servlet jsp threw exception
> > > org.apache.taglibs.standard.tag.common.xml.UnresolvableException:
> > > $prefix:javax.servlet.forward.request_uri
> > > at
> > >
> >
>
org.apache.taglibs.standard.tag.common.xml.XPathUtil$JstlVariableContext.not
> > > Null(Unknown Source)
> > > at
> > >
> >
>
org.apache.taglibs.standard.tag.common.xml.XPathUtil$JstlVariableContext.get
> > > VariableValue(Unknown Source)
> > > at
> > >
> >
>
org.apache.taglibs.standard.tag.common.xml.XPathUtil$JstlVariableContext.get
> > > VariableOrParam(Unknown Source)
> > > at
> > >
> org.apache.taglibs.standard.tag.common.xml.XPathUtil.fillVarStack(Unknown
> > > Source)
> > > at
> > > org.apache.taglibs.standard.tag.common.xml.XPathUtil.valueOf(Unknown
> > Source)
> > > at
> > >
> org.apache.taglibs.standard.tag.common.xml.ExprSupport.doStartTag(Unknown
> > > Source)
> > > at
> > >
> >
>
org.apache.jsp.WEB_002dINF.pages.JobSearch_jsp._jspx_meth_x_out_0(JobSearch_
> > > jsp.java:793)
> > > at
> > >
> >
>
org.apache.jsp.WEB_002dINF.pages.JobSearch_jsp._jspx_meth_c_set_10(JobSearch
> > > _jsp.java:769)
> > > at
> > >
> >
>
org.apache.jsp.WEB_002dINF.pages.JobSearch_jsp._jspService(JobSearch_jsp.jav
> > > a:168)
> > > at
> > > org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
> > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
> > > at
> > >
> >
>
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
> > > 11)
> > > at
> > >
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
> > > at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
> > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
> > > at
> > >
> >
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
> > > FilterChain.java:284)
> > > at
> > >
> >
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
> > > ain.java:204)
> > > at
> > >
> >
>
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.
> > > java:742)
> > > at
> > >
> >
>
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatch
> > > er.java:630)
> > > at
> > >
> >
>
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher
> > > .java:542)
> > > at
> > >
> >
>
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:1
> > > 002)
> > > at
> > >
> >
>
org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:626)
> > > at
> > >
org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:137)
> > > at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:177)
> > > at
> > > org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:756)
> > > at
> > >
> >
>
org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.ja
> > > va:881)
> > > at
> > > org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:473)
> > > at
> > >
> >
>
org.apache.jsp.WEB_002dINF.layout.layout_jsp._jspx_meth_tiles_insert_2(layou
> > > t_jsp.java:174)
> > > at
> > >
> >
>
org.apache.jsp.WEB_002dINF.layout.layout_jsp._jspService(layout_jsp.java:75)
> > > at
> > > org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
> > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
> > > at
> > >
> >
>
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
> > > 11)
> > > at
> > >
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
> > > at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
> > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
> > > at
> > >
> >
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
> > > FilterChain.java:284)
> > > at
> > >
> >
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
> > > ain.java:204)
> > > at
> > >
> >
>
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.
> > > java:742)
> > > at
> > >
> >
>
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDis
> > > patcher.java:506)
> > > at
> > >
> >
>
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatch
> > > er.java:443)
> > > at
> > >
> >
>
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher
> > > .java:359)
> > > at
> > >
> >
>
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:10
> > > 69)
> > > at
> > >
> >
>
org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcesso
> > > r.java:274)
> > > at
> > >
> >
>
org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(TilesRe
> > > questProcessor.java:254)
> > > at
> > >
> >
>
org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequ
> > > estProcessor.java:309)
> > > at
> > >
> >
>
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
> > > at
> > >
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
> > > at
> > > org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
> > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
> > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
> > > at
> > >
> >
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
> > > FilterChain.java:284)
> > > at
> > >
> >
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
> > > ain.java:204)
> > > at
> > >
> >
>
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
> > > va:256)
> > > at
> > >
> >
>
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
> > > t.java:151)
> > > at
> > >
> >
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
> > > at
> > >
> >
>
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContext
> > > Valve.java:245)
> > > at
> > >
> >
>
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
> > > va:199)
> > > at
> > >
> >
>
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
> > > t.java:151)
> > > at
> > >
> >
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
> > > at
> > >
> >
>
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:195
> > > )
> > > at
> > >
> >
>
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
> > > t.java:151)
> > > at
> > >
> >
>
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164
> > > )
> > > at
> > >
> >
>
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
> > > t.java:149)
> > > at
> > >
> >
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
> > > at
> > >
> >
>
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
> > > :156)
> > > at
> > >
> >
>
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
> > > t.java:151)
> > > at
> > >
> >
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
> > > at
> > > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
> > > at
> > >
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:211)
> > > at
> > >
> >
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:805)
> > > at
> > >
> >
>
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
> > > ction(Http11Protocol.java:696)
> > > at
> > >
> >
> org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:605)
> > > at
> > >
> >
>
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
> > > a:677)
> > > at java.lang.Thread.run(Thread.java:534)
>
> --
> Kris Schneider <mailto:[EMAIL PROTECTED]>
> D.O.Tech <http://www.dotech.com/>
--
Kris Schneider <mailto:[EMAIL PROTECTED]>
D.O.Tech <http://www.dotech.com/>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]