Error: use session scope when JSP page declares (via page directive) that it does not

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Error: use session scope when JSP page declares (via page directive) that it does not

Lebing.Xie
Hi, all
I used a sevlet to read blob data from DB which will be showed in a JSP. Here is my code:
in JSP
<img src='<%="ControllerServlet?path=ShowCustomerPicServlet&customerID="+customer.getCustomerID()%>' width="95" height="126" border=1>
 
It worked fine on Jetty 4.2, after updated to Jetty 5.1.3, i got following Error and the Pic will not be showed.
 
I am a new bie by Jetty and JSP, maybe a silly question :)) thanx a lot
ur Lebing
 
 
P1-17 WARN CallCenter  -
/CallCenter/ControllerServlet?path=ShowCustomerPicServlet&customerID=1:
org.apache.jasper.JasperException: /ErrorPage.jsp(10,0) Illegal for useBean to
use session scope when JSP page declares (via page directive) that it does not
participate in sessions at
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
        at
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
        at
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:104)
        at
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator....
Reply | Threaded
Open this post in threaded view
|

Re: Error: use session scope when JSP page declares (via page directive) that it does not

Tim Vernum
> It worked fine on Jetty 4.2, after updated to Jetty 5.1.3, i got  
> following Error and the Pic will not be showed.

Your issue isn't really related to Jetty.
Probably when you upgraded Jetty you also upgraded the JSP engine  
(Jasper) that Jetty uses and that has found a problem with your JSP.

A useful place to ask questions about JSP errors is here:
        http://forum.java.sun.com/forum.jspa?forumID=45

The piece of code that you have pasted is probably not what is causing  
your problem.

> org.apache.jasper.JasperException: /ErrorPage.jsp(10,0) Illegal for  
> useBean to
> use session scope when JSP page declares (via page directive) that it  
> does not
> participate in sessions at
> org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHan
> dler.java:39)
>         at
> org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.jav
> a:409)
>         at
> org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.jav
> a:104)
>         at
> org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator...
> .

As best I can tell from the error message you have something like this  
at the top of your JSP page
        <%@ page session="false" %>

And then somewhere in your page you also have:
        <jsp:useBean scope="session" .... />

(This is probably inside your "ErrorPage.jsp")

That's the best advice I can give from what's in your email.
If you need more information try asking in the JSP forum (above)



-------------------------------------------------------
SF.Net email is sponsored by: Tell us your software development plans!
Take this survey and enter to win a one-year sub to SourceForge.net
Plus IDC's 2005 look-ahead and a copy of this survey
Click here to start!  <a href="http://www.idcswdc.com/cgi-bin/survey?id5hix">http://www.idcswdc.com/cgi-bin/survey?id5hix
_______________________________________________
jetty-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-discuss