Java Mailing List Archive

http://www.junlu.com/

Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Tomcat - JSP/Servlet container
Struts - A MVC web framework
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
JSP - A mailing list about Java Server Pages specification and reference
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Oracle Connection Pooling in 3 2 2
Servlet : Session invalidate
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Tomcat and webapplication specific java library path
Running a Simple JMS Example
Mapping in workers2 properties
org apache jasper JasperException
Cannot find message resources under key org apache struts action
   MESSAGE
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
url string for connecting jboss to oracle
Value attribute of <html:checkbox
javax servlet ServletException: BeanUtils populate
HTTP Status 404 The requested resource is not available
5 0 18: Windows XP Pro vs Windows 2000
 
Questions about JSP programming

Questions about JSP programming

2007-01-15       - By Xuekun Hu

 Back
Reply:     <<     11  

Thanks Rashmi, Zack, and Pid
Sorry it's my fault. <%@ include file="request.getParameter("f") %>
should not be compiled successfully. I fisrt tested <jsp:include
page../>, it works, TOMCAT translated and generated the .java and
.class file, then I just modified the same jsp file with <%@ ... %>,
TOMCAT compiled it failed. TOMCAT deleted the .java file, but kept the
.class. When I load tested the URL again, Some requests will get 500
error, while most are still get the right response!

Now I understood the two include difference. Thanks again.

Thx, Xuekun

On 1/15/07, Pid <p@(protected)> wrote:
> 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 Source code of org.apache.jasper.JasperException: Unable to load class for JSP
> >  org.apache.jasper.JspCompilationContext Source code of org.apache.jasper.JspCompilationContext(JspCompilationContext.java
:598)
> >  org.apache.jasper.servlet.JspServletWrapper Source code of org.apache.jasper.servlet.JspServletWrapper(JspServletWrapper
.java:137)
> >  org.apache.jasper.servlet.JspServletWrapper Source code of org.apache.jasper.servlet.JspServletWrapper(JspServletWrapper.java
:305)
> >  org.apache.jasper.servlet.JspServlet Source code of org.apache.jasper.servlet.JspServlet(JspServlet.java:314)
> >  org.apache.jasper.servlet.JspServlet Source code of org.apache.jasper.servlet.JspServlet(JspServlet.java:264)
> >  javax.servlet.http.HttpServlet Source code of javax.servlet.http.HttpServlet(HttpServlet.java:802)
> > root cause
> > java.lang.ClassNotFoundException Source code of java.lang.ClassNotFoundException: org.apache.jsp.p.test2.test2_jsp
> >  java.net.URLClassLoader Source code of java.net.URLClassLoader$1.run(URLClassLoader.java:200)
> >  java.security.AccessController Source code of java.security.AccessController(Native Method)
> >  java.net.URLClassLoader Source code of java.net.URLClassLoader(URLClassLoader.java:188)
> >  org.apache.jasper.servlet.JasperLoader Source code of org.apache.jasper.servlet.JasperLoader(JasperLoader.java:133)
> >  org.apache.jasper.servlet.JasperLoader Source code of org.apache.jasper.servlet.JasperLoader(JasperLoader.java:65)
> >  org.apache.jasper.JspCompilationContext Source code of org.apache.jasper.JspCompilationContext(JspCompilationContext.java
:596)
> >  org.apache.jasper.servlet.JspServletWrapper Source code of org.apache.jasper.servlet.JspServletWrapper(JspServletWrapper
.java:137)
> >  org.apache.jasper.servlet.JspServletWrapper Source code of org.apache.jasper.servlet.JspServletWrapper(JspServletWrapper.java
:305)
> >  org.apache.jasper.servlet.JspServlet Source code of org.apache.jasper.servlet.JspServlet(JspServlet.java:314)
> >  org.apache.jasper.servlet.JspServlet Source code of org.apache.jasper.servlet.JspServlet(JspServlet.java:264)
> >  javax.servlet.http.HttpServlet Source code of javax.servlet.http.HttpServlet(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@(protected)
> > To unsubscribe, e-mail: users-unsubscribe@(protected)
> > For additional commands, e-mail: users-help@(protected)
> >
> >
> >
>
>
> -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
> To start a new topic, e-mail: users@(protected)
> To unsubscribe, e-mail: users-unsubscribe@(protected)
> For additional commands, e-mail: users-help@(protected)
>
>

-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
To start a new topic, e-mail: users@(protected)
To unsubscribe, e-mail: users-unsubscribe@(protected)
For additional commands, e-mail: users-help@(protected)


©2008 junlu.com - Jax Systems, LLC, U.S.A.