• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Very funny behavior of sessions...

 
Timothy Sam
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 751
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 751
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if ( errorFlag == true)

Here there definitely is a problem,..
Incompatible operands ( String and boolean) ??
 
Antonio Giovanni
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Given that the compiler error is on login.jsp I think it would be useful if you showed us login.jsp.

Kyle
 
Timothy Sam
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic