This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Hi Friends, I got the following Exception. What does D mean in it? Unable to compile class for JSP : java.lang.NumberFormatException: D at java.lang.Integer.parseInt(Integer.java(Compiled Code)) at java.lang.Integer.parseInt(Integer.java(Compiled Code)) at org.apache.jasper.compiler.Compiler.getJspLineErrors(Compiler.java:472) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:313) at org.apache.jasper.runtime.JspServlet.loadJSP(JspServlet.java:697) at org.apache.jasper.runtime.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:244) at org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.java:261) at org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:430) at org.apache.jasper.runtime.JspServlet.service(JspServlet.java:565) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) I searched on google to get a hint that when Exception e.getMessage() has double colon in it, the jasper cannot parse it properly and eats up the line number in display. Im clueless from where the error is coming. Any suggestions? Cheers! Tina
Alongwith being a good coder, try to be a good professional as well!
The "D" is the value that was passed into Integer.parseInt(). It's not a value on its own, so it can't parse it. If you want to parse a double (i.e. using a trailing "D" or "d") such as "3.141592654D" consider Double.parseDouble() instead...
"Write beautiful code; then profile that beautiful code and make little bits of it uglier but faster." --The JavaPerformanceTuning.com team, Newsletter 039.
Sorry, I cannot paste my JSPs here. Also, the JSP which did not compile and gave this exception includes several others. so would not be able to paste them all here. I could not pin point the exact problem. Got files from a colleagues PC where it worked. A goole search gave me - this Does that mean in the ex.getMessage()if I have a double colon, it eats up the line no at which error occured? Thanks and Regards, Tina