Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

struts forward path with multiple request parameters

55 views
Skip to first unread message

R. Salzbrunn

unread,
Jun 11, 2002, 9:52:47 AM6/11/02
to
Hi,

we are using struts in a J2EE application. How can I define a struts
forward mapping to a path with multiple(!) request parameters, i.e.,

<forward name="dspGsre2"
path="/jsp/crm/orousrchfrm.jsp?step=1&y=2"/>

During deployment of the application I get the following error
message. Using only one parameter (step=1) all works fine.

What's wrong?

Thanks in advace, Richard

Pop org.apache.struts.action.ActionForward
Parse Fatal Error at line 118 column 71: The reference to entity "y"
must end with the ';' delimiter.
org.xml.sax.SAXParseException: The reference to entity "y" must end
with the ';'
delimiter.
at org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1196
)
at org.apache.xerces.framework.XMLDocumentScanner.reportFatalXMLError(XM
LDocumentScanner.java:579)
at org.apache.xerces.framework.XMLDocumentScanner.scanAttValue(XMLDocume
ntScanner.java:516)
at org.apache.xerces.framework.XMLDocumentScanner.scanElement(XMLDocumen
tScanner.java:1769)

Davor Cengija

unread,
Jun 11, 2002, 2:14:03 PM6/11/02
to
R. Salzbrunn wrote:

> Hi,
>
> we are using struts in a J2EE application. How can I define a struts
> forward mapping to a path with multiple(!) request parameters, i.e.,
>
> <forward name="dspGsre2"
> path="/jsp/crm/orousrchfrm.jsp?step=1&y=2"/>
>
> During deployment of the application I get the following error
> message. Using only one parameter (step=1) all works fine.
>
> What's wrong?
>
> Thanks in advace, Richard
>
> Pop org.apache.struts.action.ActionForward
> Parse Fatal Error at line 118 column 71: The reference to entity "y"
> must end with the ';' delimiter.
> org.xml.sax.SAXParseException: The reference to entity "y" must end
> with the ';'
> delimiter.

<snip>


You have broken XML syntax in struts-config.xml with the ampersand
character &. Parser sees &y=2 and automatically thinks &y is an XML entity.
If you need 'real' ampersand (as you do) you should use &amp; , therefore

path="/jsp/crm/orousrchfrm.jsp?step=1&amp;y=2"

might work (haven't tried it, though)
--
Davor Cengija
dcengija...@inet.hr
=============================
"Nicht in die Augen bringen!"

Jared MacDonald

unread,
Jun 11, 2002, 3:45:57 PM6/11/02
to
> we are using struts in a J2EE application. How can I define a struts
> forward mapping to a path with multiple(!) request parameters, i.e.,
>
> <forward name="dspGsre2"
> path="/jsp/crm/orousrchfrm.jsp?step=1&y=2"/>
>
> During deployment of the application I get the following error
> message. Using only one parameter (step=1) all works fine.
>
> What's wrong?
>
> Thanks in advace, Richard
>
> Pop org.apache.struts.action.ActionForward
> Parse Fatal Error at line 118 column 71: The reference to entity "y"
> must end with the ';' delimiter.

It's failing because the XML parser is interpreting the "&" as the
beginning of an XML entity, rather than an ampersand.

To fix, you should be able to do

<forward name="dspGsre2"
path="/jsp/crm/orousrchfrm.jsp?step=1&amp;y=2"/>

i.e. replace "&" with "&amp;".

Jared

0 new messages