Re: Local Forward with Parameters Causes Exception
The parser doesn't know what you want, it only knows what it sees. :-) In this case, it had started parsing an XML entity reference - something like amp; - and found a parse failure for the reference because it expected to see sortBy; instead of sortBy=. That is, it expected a semicolon, but what it got was an equals. -- Martin Cooper - Original Message - From: Thomas Quas [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, August 28, 2001 10:42 PM Subject: Re: Local Forward with Parameters Causes Exception 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 quot; but with amp; like this: forward name=postCreate path=/product.do?action=listamp;sortBy=dateamp;order=descamp;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=listsortBy=dateorder=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=listsortBy=dateorder=desccount=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
Re: Local Forward with Parameters Causes Exception
Thanks Martin. Gee, finally I have to get my hands dirty on XML ;-) [EMAIL PROTECTED] wrote: The parser doesn't know what you want, it only knows what it sees. :-) In this case, it had started parsing an XML entity reference - something like amp; - and found a parse failure for the reference because it expected to see sortBy; instead of sortBy=. That is, it expected a semicolon, but what it got was an equals. -- Martin Cooper - Original Message - From: Thomas Quas [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, August 28, 2001 10:42 PM Subject: Re: Local Forward with Parameters Causes Exception 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 quot; but with amp; like this: forward name=postCreate path=/product.do?action=listamp;sortBy=dateamp;order=descamp;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=listsortBy=dateorder=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=listsortBy=dateorder=desccount=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
Re: Local Forward with Parameters Causes Exception
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 quot; but with amp; like this: forward name=postCreate path=/product.do?action=listamp;sortBy=dateamp;order=descamp;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=listsortBy=dateorder=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=listsortBy=dateorder=desccount=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
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=listsortBy=dateorder=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=listsortBy=dateorder=desccount=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
Re: Local Forward with Parameters Causes Exception
Try using amp; for the ampersands. It thinks sortby is an entity reference, as in sortby; Thomas Quas wrote: 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=listsortBy=dateorder=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=listsortBy=dateorder=desccount=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: