Hi Friends,
I have this simple method which works fine on my system(Tomcat 5.0,jdk 
1.5)..but not on the server(Tomcat 5.5.7,jdk1.5).Can someone explain me why:


-----------------------------------------------------
String syear = null;
int selectedYear = 0;
try{
syear = request.getParameter("year");
  if (syear != null){
  selectedYear = Integer.parseInt(syear);
  session.setAttribute("syear_sess",new Integer(selectedYear));
  }
  else{
  if(session.getAttribute("syear_sess") != null)
    selectedYear = ((Integer)session.getAttribute("syear_sess")).intValue();
  else
  {
        syear = "2005";
    selectedYear = Integer.parseInt(syear);
  }

}
}catch (IllegalArgumentException _e){
    throw new Exception("selectedYear error");
}
----------------------------------------------
"year" is a combo box name.The error this code throws is:

----------------------------------------------
org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 12 in the jsp file: /CheckPointsAwarded.jsp
Generated servlet error:
Type mismatch: cannot convert from Integer to int


        
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:397)
        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:556)
        
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:296)
        org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

----------------------------------------------

Please help.Thanks

Reply via email to