Firstly, all directives of the following form are executed at compile time:
<%@ ... %>
This means that URL request parameters are not available (yet) to the
JSP. If the OP was using an include file directive containing the
string 'request.getParameter("f")' it is unlikely that it ever worked as
expected.
The JSTL approach below is likely to work - though I can't think of a
good or safe reason for allowing JSPs to load file system paths.
(if you're on a unix-like system, try loading '/etc/passwd')
Secondly, <jsp:include ... > operates at *request time* and may
therefore be more pertinent to the case here. OP should google for 'JSP
directive tutorials', the top result was enlightening when I checked.
Lastly, the OP should report on which tool (if any) he was using to load
test the URL. It may simply be the case (assuming the above error is
corrected) that the excessive load caused the machine to run out of
memory.
The normal approach is to examine the logs to determine the source of
the 500 error, the list will likely provide more advice on receipt of
this information.
p
Rashmi Rubdi wrote:
Zack,
I don't think it's the include directive alone causing a memory error. I'm guessing that there might be a lot of processes in his application running on Tomcat, eventually causing an out of memory error or may be the system does not have minimum required memory to run Tomcat.
With Tomcat 5.5, and about 2GB RAM I'm not getting an OutOfMemory error while
running 3 applications simultaneously on Tomcat, when I tried his example of
include directives, I got the error on the screen and it was logged in Tomcat's
logs as well.
I ran my test as follows: http://practice:8080/p/test2/test2.jsp?f=page.html , and test2.jsp had <%@
include file="request.getParameter("f")" %> (which I believe won't work)
Here's parts of the error, if it helps him:
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from
fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to load class for JSP
org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:598)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:137)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:305)
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)
root cause
java.lang.ClassNotFoundException: org.apache.jsp.p.test2.test2_jsp
java.net.URLClassLoader$1.run(URLClassLoader.java:200)
java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findClass(URLClassLoader.java:188)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:133)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:65)
org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:596)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:137)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:305)
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)
Also, if he sets up JSTL1.1 correctly, the following will also work:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:import url="${param.f}"/>
Where param.f , is the equivalent of request.getParameter("f")
-Rashmi
Rashmi,
I'm curious as to why his second approach causes the memory error that
he gets, would you have any insight as to why it's happening? I've
checked out the docs and they don't indicate anything about the way the
include directive uses memory. I'm thinking we might actually have a
bug to report.
Zack
____________________________________________________________________________________
The fish are biting.
Get more visitors on your site using Yahoo! Search Marketing.
http://searchmarketing.yahoo.com/arp/sponsoredsearch_v2.php
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]