tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tice, Ed" <ET...@bluestone.com>
Subject RE: request.getParameter() in a runtime tag
Date Thu, 27 Apr 2000 12:59:28 GMT
Ken,

  This is not a bug.  It is per the JSP specification.  You have a quoted
string inside of a quoted string

value="<%=request.getParameter("myparam")%>"

This is not valid.  You will need to escape the quotes

value="<%=request.getParameter(\"myparam\")%>"

Ed

-----Original Message-----
From: Ken X Horn
To: tomcat-user@jakarta.apache.org
Sent: 4/27/00 7:57 AM
Subject: request.getParameter() in a runtime tag

        Hi,

                    I've found a problem using included jsp's which I
think is a
 bug. Anybody tried this...?

                    ---- outer.jsp

                    <html>
                    Random text
                    <jsp:include page="nested.jsp" flush="true" >
                    <jsp:param name="param1" value="value1" />
                    </jsp:include>


                    ---- nested.jsp

                    some html tags..

                    <mytags:tagX value="<%=
request.getParameter("param1") %>" >

                    ..body text..

                    </mytags:tagX>

                    ----

                    org.apache.jasper.compiler.ParseException:
c:\jsp\nested.jsp(7,63) Attribute param1 has no value
                            at
org.apache.jasper.compiler.JspReader.parseAttributeValue(JspReader.java:
456)
                            at
org.apache.jasper.compiler.JspReader.parseTagAttributes(JspReader.java:5
72)
                            at
org.apache.jasper.compiler.Parser$Tag.accept(Parser.java:795)
                            at
org.apache.jasper.compiler.Parser.parse(Parser.java:1073)
                            at
org.apache.jasper.compiler.Parser.parse(Parser.java:1038)
                            at
org.apache.jasper.compiler.Parser.parse(Parser.java:1034)
                            at
org.apache.jasper.compiler.Compiler.compile(Compiler.java:182)
                            at
org.apache.jasper.runtime.JspServlet.loadJSP(JspServlet.java:413)


                    Any ideas?

                    The value attribute on tagX can take a runtime
value. If I
put:

                    ---- nested.jsp

                    some html tags..

                    <% String val = request.getParameter("param1"); %>

                    <mytags:tagX value="<%= val %>" >

                    ..body text..

                    </mytags:tagX>

                    It works perfectly.

                    Cheers,

                    Ken.



------------------------------------------------------------------------
--
To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
For additional commmands, email: tomcat-user-help@jakarta.apache.org

Mime
View raw message