The problem is that the JSP is not compiled on the browser. Even if it was,
you would be bound on functionality provided by the particular browser. The
servlet container might send an error in the response but that would be up
to the container provider as well. Because these behaviors are not bound by
standards, you can't count on them to always be there if you once had what
you want. There should be server side logs that will show your problem.

Robert S. Harper
Information Access Technology, Inc.
-----Original Message-----
From: D. Alvarado [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 28, 2006 12:32 PM
To: Tomcat Users List
Subject: Re: How do I print out line of code that caused the error?

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(JspServletWra
pper.java:512)
> >
> >
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
77)
> >
> >
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: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to