aspose file tools*
The moose likes Servlets and the fly likes Very funny behavior of sessions... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Very funny behavior of sessions..." Watch "Very funny behavior of sessions..." New topic
Author

Very funny behavior of sessions...

Timothy Sam
Ranch Hand

Joined: Sep 18, 2005
Posts: 746
Hi, I tried creating a session like the following...

My Servlet class



and called it in my servlet like this...



strangely... I get this exception...



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 compile class for JSP

An error occurred at line: 3 in the jsp file: /timeoutsys/login.jsp
Generated servlet error:
Incompatible operand types String and boolean


org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:409)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:288)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293)
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)


note The full stack trace of the root cause is available in the Apache Tomcat/5.5.12 logs.


SCJP 1.5
http://devpinoy.org/blogs/lamia/ - http://everypesocounts.com/
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Is there just the one JSP, or do you include any others? If you change a 'nested' JSP, sometimes it desn't get picked up and recompiled. You can delete the contents of your <tomcat_home>/working directory to force it to build it again.
Timothy Sam
Ranch Hand

Joined: Sep 18, 2005
Posts: 746
Hi, I process my JSP like this...


JSP Input - > Process data/create sessions in servlet -> JSP get session/Disply

there is only one JSP involved in this process... If the code need be posted, I'd gladly do it. I just think it's too lengthy with the JSP. Thanks!
Timothy Sam
Ranch Hand

Joined: Sep 18, 2005
Posts: 746
Hi, please consider this code...

My Servlet



My JSP page...



I really help someone could help me... I always have problems when casting a session to a primitive type like int or bool... Thanks!
Antonio Giovanni
Ranch Hand

Joined: Jun 27, 2005
Posts: 85
if ( errorFlag == true)

Here there definitely is a problem,..
Incompatible operands ( String and boolean) ??
Antonio Giovanni
Ranch Hand

Joined: Jun 27, 2005
Posts: 85
I am sorry, before i wrote the complete thing i accidently clicked the
Add Reply..

Anyway coming back to the problem, instead of
if ( errorFlag == true) it should be

if(errorFlag.equalsIgnoreCase("true"))
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
    
    5
Given that the compiler error is on login.jsp I think it would be useful if you showed us login.jsp.

Kyle


Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ for other WebSphere information.
Timothy Sam
Ranch Hand

Joined: Sep 18, 2005
Posts: 746
Thanks for your help! I guess I got a little dizzy while looking at my source code(didn't even notice my own mistake). But thanks alot!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Very funny behavior of sessions...