Thanks all,

problem solved. I'm still puzzled, however, about the message in the
parser exception that told me to use semicolons. Where does this come
from, and shouldn't/can't this be changed to be more expressive?


Thanks again, tom


[EMAIL PROTECTED] wrote:
> 
> Not with " but with & like this:
> 
>     <forward name="postCreate"
> 
> path="/product.do?action=list&amp;sortBy=date&amp;order=desc&amp;count=10"/>
> 
> --
> Martin Cooper
> 
> ----- Original Message -----
> From: "Eung-ju Park" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Sunday, August 26, 2001 4:56 AM
> Subject: Re: Local Forward with Parameters Causes Exception
> 
> > replace '&' with '&quot;'
> >
> > ----- Original Message -----
> > From: "Thomas Quas" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Sunday, August 26, 2001 4:44 PM
> > Subject: Local Forward with Parameters Causes Exception
> >
> >
> > >
> > > Hi,
> > >
> > > I ran into the following problem: I want to specify a local forward that
> > > represents an action URL. The action requires parameters that I want to
> > > pass
> > > in common HTTP fashion, namely
> > >
> > >         /product.do?action=list&sortBy=date&order=desc
> > >
> > >
> > > Therefore, I have an entry in struts-confix.xml that looks like this:
> > >
> > >     <action path="/product"
> > >             type="tquas.bogus.servlet.ProductActions"
> > >             parameter="action"
> > >             name="productForm"
> > >             scope="request"
> > >             unknown="false"
> > >             validate="true">
> > >         <forward name="postCreate"
> > >
> > > path="/product.do?action=list&sortBy=date&order=desc&count=10"/>
> > >     </action>
> > >
> > > where ProductActions is a subclass of DispatchAction containing an
> > > implementation of method list().
> > >
> > > The problem is that the XML parser throws an exception, basically
> > > telling me
> > > that ampersands are not allowed in this URI:
> > >
> > > org.xml.sax.SAXParseException: Next character must be ";" terminating
> > > reference to entity "sortBy".
> > >         at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3035)
> > >         at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3029)
> > >         at org.apache.crimson.parser.Parser2.nextChar(Parser2.java:2951)
> > >         at
> > > org.apache.crimson.parser.Parser2.parseLiteral(Parser2.java:715)
> > >         at
> > > org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1375)
> > >         at org.apache.crimson.parser.Parser2.content(Parser2.java:1700)
> > >         at
> > > org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1468)
> > >         at org.apache.crimson.parser.Parser2.content(Parser2.java:1700)
> > >         at
> > > org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1468)
> > >         at org.apache.crimson.parser.Parser2.content(Parser2.java:1700)
> > >         at
> > > org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1468)
> > >         at
> > > org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:499)
> > >         at org.apache.crimson.parser.Parser2.parse(Parser2.java:304)
> > >         at
> > > org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:433)
> > > at org.xml.sax.helpers.XMLReaderAdapter.parse(XMLReaderAdapter.java:223)
> > > org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:433)
> > > at org.xml.sax.helpers.XMLReaderAdapter.parse(XMLReaderAdapter.java:223)
> > >         at javax.xml.parsers.SAXParser.parse(SAXParser.java:317)
> > >         at javax.xml.parsers.SAXParser.parse(SAXParser.java:108)
> > >         at org.apache.struts.digester.Digester.parse(Digester.java:755)
> > >         at
> > >
> >
> org.apache.struts.action.ActionServlet.initMapping(ActionServlet.java:1331)
> > >         at
> > > org.apache.struts.action.ActionServlet.init(ActionServlet.java:465)
> > >         at javax.servlet.GenericServlet.init(GenericServlet.java:258)
> > > [snip]
> > >
> > >
> > > This kind of puzzled me, but I obeyed and replaced the ampersands with
> > > semicolons. Now the parser shuts up, but as soon as I hit the specified
> > > forward, struts seems to hang in a loop until it produces a
> > > StackOverflowError
> > > (details see below).
> > >
> > > Can anybody help me with this and tell me how I specifiy a local forward
> > > that
> > > accepts parameters in the URI?
> > >
> > >
> > > Thanks in advance, tom
> > >
> > >
> > >
> > > 2001-08-26 09:26:15 StandardWrapperValve[action]: Servlet.service() for
> > > servlet action threw exception
> > > javax.servlet.ServletException: Servlet execution threw an exception
> > >         at
> > >
> >
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
> > FilterChain.java:269)
> > >         at
> > >
> >
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
> > ain.java:193)
> > >         at
> > >
> >
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
> > va:243)
> > >         at
> > >
> >
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > 66)
> > >         at
> > >
> >
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> > >         at
> > > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> > >         at
> > >
> >
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
> > va:219)
> > >         at
> > >
> >
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > 66)
> > >         at
> > >
> >
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > 66)
> > >         at
> > >
> >
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> > >         at
> > > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> > >         at
> > >
> org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2251)
> > >         at
> > >
> >
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164
> > )
> > >         at
> > >
> >
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > 66)
> > >         at
> > >
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:446)
> > >         at
> > >
> >
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > 64)
> > >         at
> > >
> >
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> > >         at
> > > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> > >         at
> > >
> >
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
> > :163)
> > >         at
> > >
> >
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
> > :163)
> > >         at
> > >
> >
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > 66)
> > >         at
> > >
> >
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> > >         at
> > > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> > >         at
> > >
> >
> org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:
> > 984)
> > >         at
> > >
> >
> org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1074
> > )
> > >         at java.lang.Thread.run(Thread.java:484)
> > > ----- Root Cause -----
> > > java.lang.StackOverflowError
> > >         at java.lang.String.hashCode(String.java:1122)
> > >         at java.util.HashMap.put(HashMap.java:327)
> > >         at
> > >
> >
> org.apache.catalina.core.ApplicationHttpRequest.setAttribute(ApplicationHttp
> > Request.java:249)
> > >         at
> > >
> >
> org.apache.catalina.core.ApplicationHttpRequest.setAttribute(ApplicationHttp
> > Request.java:249)
> > >         at
> > >
> >
> org.apache.catalina.core.ApplicationHttpRequest.setAttribute(ApplicationHttp
> > Request.java:251)
> > >         at
> > >
> >
> org.apache.catalina.core.ApplicationHttpRequest.setAttribute(ApplicationHttp
> > Request.java:251)
> > >
> > > [*** last message repeated several times]
> > >
> > > --
> > > thomas quas        | "Art lies in the consciousness of doing the thing,
> > > [EMAIL PROTECTED]      |  in the attention of the happening[...]"
> > >                    |    -- Allen Ginsberg --
> > >
> >
> >

-- 
thomas quas        | "Art lies in the consciousness of doing the thing,
[EMAIL PROTECTED]      |  in the attention of the happening[...]"
                   |    -- Allen Ginsberg --

Reply via email to