a122178
asked on
Type mismatch: cannot convert from Integer to int
I got this error. I have checked my code. I cannot find the result. Please help~~!!!
org.apache.jasper.JasperEx ception: Unable to compile class for JSP
An error occurred at line: 86 in the jsp file: /submit.jsp
Generated servlet error:
Type mismatch: cannot convert from Integer to int
An error occurred at line: 86 in the jsp file: /submit.jsp
Generated servlet error:
The method get(Object) in the type HashMap is not applicable for the arguments (int)
An error occurred at line: 86 in the jsp file: /submit.jsp
Generated servlet error:
The method get(Object) in the type HashMap is not applicable for the arguments (int)
org.apache.jasper.compiler .DefaultEr rorHandler .javacErro r(DefaultE rrorHandle r.java:84)
org.apache.jasper.compiler .ErrorDisp atcher.jav acError(Er rorDispatc her.java:3 28)
org.apache.jasper.compiler .JDTCompil er.generat eClass(JDT Compiler.j ava:397)
org.apache.jasper.compiler .Compiler. compile(Co mpiler.jav a:288)
org.apache.jasper.compiler .Compiler. compile(Co mpiler.jav a:267)
org.apache.jasper.compiler .Compiler. compile(Co mpiler.jav a:255)
org.apache.jasper.JspCompi lationCont ext.compil e(JspCompi lationCont ext.java:5 56)
org.apache.jasper.servlet. JspServlet Wrapper.se rvice(JspS ervletWrap per.java:2 96)
org.apache.jasper.servlet. JspServlet .serviceJs pFile(JspS ervlet.jav a:295)
org.apache.jasper.servlet. JspServlet .service(J spServlet. java:245)
javax.servlet.http.HttpSer vlet.servi ce(HttpSer vlet.java: 802)
org.apache.jasper.JasperEx
An error occurred at line: 86 in the jsp file: /submit.jsp
Generated servlet error:
Type mismatch: cannot convert from Integer to int
An error occurred at line: 86 in the jsp file: /submit.jsp
Generated servlet error:
The method get(Object) in the type HashMap is not applicable for the arguments (int)
An error occurred at line: 86 in the jsp file: /submit.jsp
Generated servlet error:
The method get(Object) in the type HashMap is not applicable for the arguments (int)
org.apache.jasper.compiler
org.apache.jasper.compiler
org.apache.jasper.compiler
org.apache.jasper.compiler
org.apache.jasper.compiler
org.apache.jasper.compiler
org.apache.jasper.JspCompi
org.apache.jasper.servlet.
org.apache.jasper.servlet.
org.apache.jasper.servlet.
javax.servlet.http.HttpSer
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
you would need to use:
item.put(new Integer(_item.getDblProduc tID()), _item);
item.put(new Integer(_item.getDblProduc
ASKER
How about if I want to get from an int?
item.get(new Integer( int) ) , is that right?
item.get(new Integer( int) ) , is that right?
correct
ASKER
It still comes out even I change. After I refresh the screen it works.
Why?
Why?
ASKER
if _item.getDblProductID() is an integer, is it possible to do this way?
Thank you so much