Thanks. So there's absolutely no way within the web browser to print
out the line of code that caused the error? In the example, the line
i would've liked to see in the web browser would have been:
String v1 = session.getAttribute(attr);
Thanks, - Dave
On 11/28/06, Edoardo Panfili <[EMAIL PROTECTED]> wrote:
D. Alvarado ha scritto:
> Hi, I'm using Tomcat 5.5 with Apache 2. Upon getting jsp compilation
> errors, I'm not told any inofrmation about the code the causaed the
> error and the line printed is incorrect. What do I need to configure
> to correct this? For example, this page below:
>
> <%@ page import="java.util.*" %>
> <%
> Object v = new String("b");
> session.setAttribute("a", v);
>
> Enumeration e = session.getAttributeNames();
> while (e.hasMoreElements()) {
> String attr = (String) e.nextElement();
> String v1 = session.getAttribute(attr);
session.getAttribute(String) returns an Object
try:
String v1 = (String) session.getAttribute(attr);
> String v2 = session.getValue(attr);
> out.println("attr: " + attr + " v1:" + v1 + " v2:" +
> v2 + "<BR>\n");
> } // while
> %>
>
> causes this error. You can eventually figure out the problem, but
> "line 2" is not right.
>
> =============begin error========================
> 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: 2 in the jsp file: /session_vars.jsp
> Generated servlet error:
> Type mismatch: cannot convert from Object to String
>
> An error occurred at line: 2 in the jsp file: /session_vars.jsp
> Generated servlet error:
> Type mismatch: cannot convert from Object to String
>
>
>
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:512)
>
>
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
>
> 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)
>
> =======================end error======================
>
If you need to see the generated code for the JSP take a look at
$tomcat_install_dir$/work/Catalina/
Edoardo
--
[EMAIL PROTECTED]
AIM: edoardopn
Jabber: [EMAIL PROTECTED]
tel:075 9142766
---------------------------------------------------------------------
To start a new topic, e-mail: [email protected]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To start a new topic, e-mail: [email protected]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]