tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Funk <funk...@joedog.org>
Subject Re: dynamic JSP include?
Date Thu, 22 Feb 2007 12:30:23 GMT
A few problems:
0) Try page='/pages/<%= request.getParameter("site")%>' (Notice the use 
of single quotes - jasper is getting confused by the extra use of double 
quotes
1) If you are not including JSP params (jsp:param) you should use 
<jsp:include ../>
2) Try validating <%= request.getParameter("site")%> first in EL so you 
can say: page="/pages/${param.site}"
3) Validate the site parameter since site="../WEB-INF/web.xml" includes 
web.xml to the client

-Tim

Kristian Rink wrote:
> Folks;
> 
> currently I am playing around with something like that in my JSP
> pages...
> 
> <jsp:include 
> 	flush="true" 
> 	page="/pages/<%= request.getParameter("site")%>">
> </jsp:include>
> 
> ... which, as I understand the JSP reference, should be possible.
> However, it doesn't seem to work right. It actually _does_ work and
> include the page referred to this way, but it just works _sometimes_,
> in any other try I get something like this:
> 
> [...]
> org.apache.jasper.JasperException: /index.jsp(11,69) equal symbol
> expected
> org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:512)
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> [...]
> 
> 
> (index.jsp line 11 is the full jsp:include as outlined above). I feel
> sort of stupid now - having something that doesn't at all work would be
> easier to handle, but the behaviour of this to work once and not work
> again the next time is rather disturbing. Can anyone enlighten me here?
> I also played around with the "flush" but it doesn't really make things
> better...
> 

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message