Did you add the try to the top?  I threw that in
quick, ensure your brackets matchup properly and try
again.
--- jsp <[EMAIL PROTECTED]> wrote:
> With your code I get a syntax error it looks like...
> 
> org.apache.jasper.JasperException: Unable to compile
> class for JSP
> 
> An error occurred at line: 6 in the jsp file:
> /jsp/cust/AutoLogin2.jsp
> 
> Generated servlet error:
>     [javac] Compiling 1 source file
> 
> E:\Program Files\Apache Group\Tomcat
>
4.1\work\Standalone\localhost\bfg\jsp\cust\AutoLogin2_jsp.java:95:
> 'catch' without 'try'
> catch(Throwable t){
> ^
> 1 error
> 
> 
> hmmmmmmmmm. The pain
> 
> -----Original Message-----
> From: Carl Trusiak [mailto:[EMAIL PROTECTED]] 
> Sent: Tuesday, February 04, 2003 3:23 PM
> To: Tomcat Users List
> Subject: RE: PageContextImpl.handlePageException
> 
> A little much for a jsp page, I'd factor this into a
> class.  However, change this to:
> try
> {
>   Cart cart = (Cart)
> pageContext.getAttribute("cart",
> PageContext.SESSION_SCOPE);
>   if (cart == null) {
>       cart = new Cart();
>       pageContext.setAttribute("cart", cart, 
> PageContext.SESSION_SCOPE);
>     }
> 
>     String email = null;
>     String password = null;
>     Cookie cook;
> 
>     Customer customer = (Customer)
> pageContext.getAttribute("customer",
> PageContext.SESSION_SCOPE);
>   if (customer == null) {
>        Cookie[] cookies = request.getCookies();
>        BASE64Decoder dec = new BASE64Decoder();
>        if (cookies != null) {
>          for (int i = 0; i < cookies.length; i++) {
>              if
> (cookies[i].getName().equals("bfgUsername")) {
>                  email = new
> String(dec.decodeBuffer(cookies[i].getValue()));
>              }
>              if
> (cookies[i].getName().equals("bfgPassword")) {
>                  password = new
> String(dec.decodeBuffer(cookies[i].getValue()));
>              }
>          }
>        }
>        if ((email != null) && (password != null)) {
>          Customer c = Customer.findCustomer(email);
>          if ((c != null) &&
> (c.getPassword().equals(password))) {
>              c.setCart(cart);
>              c.fillCart();
>              pageContext.setAttribute("customer",c,
> PageContext.SESSION_SCOPE);
>          }
>        } else {
>          Customer c = new Customer();
>          c.setCart(cart);
>          pageContext.setAttribute("customer", c,
> PageContext.SESSION_SCOPE);
>        }
>   }
> }
> catch(Throwable t){
>    t.printStackTrace(out);
> }
> 
> Now what do you get?
> 
> 
> --- jsp <[EMAIL PROTECTED]> wrote:
> > This is the page causing the error. Im getting
> > warmer. Thanks for all
> > the help. I think I just need to read more....
> > 
> > 
> > <%@ page import="com.bfg.customer.Customer" %>
> > <%@ page import="com.bfg.cart.Cart" %>
> > <%@ page import="javax.servlet.http.Cookie" %>
> > <%@ page import="sun.misc.BASE64Decoder" %>
> > 
> > 
> > <%
> > {
> >   Cart cart = (Cart)
> > pageContext.getAttribute("cart",
> > PageContext.SESSION_SCOPE);
> >   if (cart == null) {
> >       cart = new Cart();
> >       pageContext.setAttribute("cart", cart,
> > PageContext.SESSION_SCOPE);
> >     }
> > 
> >     String email = null;
> >     String password = null;
> >     Cookie cook;
> > 
> >     Customer customer = (Customer)
> > pageContext.getAttribute("customer",
> > PageContext.SESSION_SCOPE);
> >   if (customer == null) {
> >        Cookie[] cookies = request.getCookies();
> >        BASE64Decoder dec = new BASE64Decoder();
> >        if (cookies != null) {
> >        for (int i = 0; i < cookies.length; i++) {
> >            if
> > (cookies[i].getName().equals("bfgUsername")) {
> >                email = new
> > String(dec.decodeBuffer(cookies[i].getValue()));
> >            }
> >            if
> > (cookies[i].getName().equals("bfgPassword")) {
> >                password = new
> > String(dec.decodeBuffer(cookies[i].getValue()));
> >            }
> >        }
> >        }
> >        if ((email != null) && (password != null))
> {
> >        Customer c = Customer.findCustomer(email);
> >        if ((c != null) &&
> > (c.getPassword().equals(password))) {
> >            c.setCart(cart);
> >            c.fillCart();
> >            pageContext.setAttribute("customer",c,
> > PageContext.SESSION_SCOPE);
> >        }
> >        } else {
> >        Customer c = new Customer();
> >        c.setCart(cart);
> >        pageContext.setAttribute("customer", c,
> > PageContext.SESSION_SCOPE);
> >        }
> >   }
> > }
> > 
> > %>
> > 
> > -----Original Message-----
> > From: Sean Dockery
> [mailto:[EMAIL PROTECTED]] 
> > Sent: Tuesday, February 04, 2003 2:59 PM
> > To: Tomcat Users List
> > Subject: RE: PageContextImpl.handlePageException
> > 
> > That may not be *the* cause.  It may just be a
> > symptom of the cause.
> > You 
> > should follow your root cause stack until you are
> > satisfied that you 
> > discovered the real cause.
> > 
> > At 15:47 2003-02-04, you wrote:
> > >Hi thanks for the reply, this is the cause.
> > >
> > >if (pageContext != null)
> > pageContext.handlePageException(t);
> > >
> > >Im just trying to find out whats causing this....
> > thought maybe someone
> > >Would have an idea besides my own incompetence.
> > >
> > >Thanks....
> > >
> > >-----Original Message-----
> > >From: Sean Dockery
> [mailto:[EMAIL PROTECTED]]
> > >Sent: Tuesday, February 04, 2003 2:34 PM
> > >To: Tomcat Users List
> > >Subject: Re: PageContextImpl.handlePageException
> > >
> > >Look at line 251 in
> >
>
>$TOMCAT_HOME/_work/appname/org/apache/jsp/index_jsp.java
> > to see what
> > >caused
> > >the exception.
> > >
> > >At 14:22 2003-02-04, you wrote:
> > > >root cause
> > > >
> > > >javax.servlet.ServletException
> > > >         at
> 
=== message truncated ===


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to