tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joel Cordonnier <jocord...@yahoo.fr>
Subject Re: java.lang.ClassCastException: AuthBean
Date Thu, 15 Mar 2001 12:12:17 GMT
Hi!

Why do you say that  it's a ClassCastEXCEPTION ? Hi
habe the same error sometimes when I use tag libraries
in my JSP !

Joel


--- "TAI Wai Wang, Leo" <hkleo@yahoo.com> a écrit : >
Hi! Have u tried to test the AuthBean independently?
> Does the bean try to
> cast one object to another object? I think, there
> are some problems in your
> beam when casting. Try to modify the classes
> relationship, eg: one class is
> the superclass of another. It may be helpful.
> 
> Leo
> ----- Original Message -----
> From: "Pater Pandoson" <ppandoson@eCoNeed.com>
> To: <tomcat-user@jakarta.apache.org>
> Sent: Wednesday, March 14, 2001 8:40 PM
> Subject: java.lang.ClassCastException: AuthBean
> 
> 
> > I have been writing an app that uses a bean with
> scope "session"
> > a user goes to a login page and gives there user
> name and password
> > this is send to the authbean and if all is correct
> will set a few values
> >
> > in the bean, things like there name and type of
> user.
> >
> > This all works fine.
> >
> > However when I than try use a page like this
> >
> > <jsp:useBean id="auth" scope="session"
> class="AuthBean" />
> > <%
> > auth.setLogin(request.getParameter("login"));
> >
> auth.setPassword(request.getParameter("password"));
> >
> > auth.auth();
> > HttpSession s = request.getSession();
> > s.setMaxInactiveInterval(3600);
> >
> >  if(auth.isUser()){
> >  %>
> > <jsp:include page="WelcomeUser.jsp" flush="true"
> />
> >  <%
> >  }else if(auth.isCompany()){
> >  %>
> > <jsp:include page="WelcomeVeryGoodUser.jsp"
> flush="true" />
> >  <%
> >  }else{
> >  %>
> > Go Away!
> >  <%
> >  }
> >  %>
> >
> > I get this kind of error.
> >
> >
> > 2001-03-14 08:34:15 - Ctx( /TEST ): Exception in:
> R( /TEST +
> > /CheckLogin.jsp + null) -
> javax.servlet.ServletException: AuthBean
> >         at
> >
>
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
> l.java:459)
> >
> >         at
> >
>
_0002fmenu_0002ejspmenu_jsp_0._jspService(_0002fmenu_0002ejspmenu_jsp_0.java
> :223)
> >
> >         at
> >
>
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
> >         at
>
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> >         at
> >
>
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
> va:177)
> >
> >         at
> >
>
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
> >
> >         at
> >
>
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
> >         at
>
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> >         at
> >
>
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
> >
> >         at
>
org.apache.tomcat.core.Handler.service(Handler.java:286)
> >         at
> >
>
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
> >         at
> >
>
org.apache.tomcat.facade.RequestDispatcherImpl.include(RequestDispatcherImpl
> .java:345)
> >
> >         at
> >
>
org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:414)
> >
> >         at
> >
>
_0002fPageStart_0002ejspPageStart_jsp_0._jspService(_0002fPageStart_0002ejsp
> PageStart_jsp_0.java:165)
> >
> >         at
> >
>
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
> >         at
>
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> >         at
> >
>
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
> va:177)
> >
> >         at
> >
>
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
> >
> >         at
> >
>
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
> >         at
>
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> >         at
> >
>
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
> >
> >         at
>
org.apache.tomcat.core.Handler.service(Handler.java:286)
> >         at
> >
>
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
> >         at
> >
>
org.apache.tomcat.facade.RequestDispatcherImpl.include(RequestDispatcherImpl
> .java:345)
> >
> >         at
> >
>
org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:414)
> >
> >         at
> >
>
_0002fWelcomeUser_0002ejspWelcomeUser_jsp_0._jspService(_0002fWelcomeUser_00
> 02ejspWelcomeUser_jsp_0.java:138)
> >
> >         at
> >
>
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
> >         at
>
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> >         at
> >
>
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
> va:177)
> >
> >         at
> >
>
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
> >
> >         at
> >
>
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
> >         at
>
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> >         at
> >
>
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
> >
> >         at
>
org.apache.tomcat.core.Handler.service(Handler.java:286)
> >         at
> >
>
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
> >         at
> >
>
org.apache.tomcat.facade.RequestDispatcherImpl.include(RequestDispatcherImpl
> .java:345)
> >
> >         at
> >
>
org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:414)
> >
> >         at
> >
>
_0002fCheckLogin_0002ejspCheckLogin_jsp_3._jspService(_0002fCheckLogin_0002e
> jspCheckLogin_jsp_3.java:99)
> >
> 
=== message truncated ===


___________________________________________________________
Do You Yahoo!? -- Pour dialoguer en direct avec vos amis, 
Yahoo! Messenger : http://fr.messenger.yahoo.com

Mime
View raw message