jQuery in Action, 3rd edition
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
JavaRanch » Java Forums » Java » Servlets
Bookmark "Very funny behavior of sessions..." Watch "Very funny behavior of sessions..." New topic

Very funny behavior of sessions...

Timothy Sam
Ranch Hand

Joined: Sep 18, 2005
Posts: 751
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


description The server encountered an internal error () that prevented it from fulfilling this request.


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


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

SCJP 1.5
David O'Meara

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: 751
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: 751
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

Kyle Brown
Ranch Hand

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


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: 751
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...
It's not a secret anymore!