tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Barry Dunne" <barrydu...@hotmail.com>
Subject j_security_check preprocessing
Date Mon, 13 Nov 2000 22:58:12 GMT
I need to store the username/password entered by the user in order to use 
them later to connect to an external system, so I tried changing login.jsp 
to post to a jsp file rather than j_security_check.

The jsp then stores the username/password and tries to call j_security_check 
as follows:

    <%! String userName, password; %>

    <%
      userName = request.getParameter("j_username");
      password = request.getParameter("j_password");
    %>

    <%-- store login information in javax.servlet.http.HttpSession --%>
    <%
      session.setAttribute("login_username", userName);
      session.setAttribute("login_password", password);
    %>

    <%-- execute security check --%>
    <jsp:forward page="j_security_check">
      <jsp:param name="j_username" value="<%= userName %>"/>
      <jsp:param name="j_password" value="<%= password %>"/>
    </jsp:forward>


However, this gives the exception below (in tomcat 4m4) and creates an empty 
file called j_security_check in the login directory.

If I change the jsp:forward to another jsp it works and the jsp gets all the 
parameters/attributes and header info.

Is this a bug or is there any other way to call j_security_check manually?

Or at least replicate the work of authenticating the username/password and 
storing that as the principal.

Thanks,
Barry.


A Servlet Exception Has Occurred
Exception Report:
javax.servlet.ServletException: Servlet.service() for servlet default threw 
exception
	at 
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:537)
	at 
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:292)
	at 
org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:431)
	at 
login._0002flogin_0002fsecurity_0005fcheck_0002ejspsecurity_0005fcheck_jsp_32._jspService(_0002flogin_0002fsecurity_0005fcheck_0002ejspsecurity_0005fcheck_jsp_32.java:102)
	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.java:181)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:317)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:396)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:180)
	at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:255)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:977)
	at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:165)
	at org.apache.catalina.valves.ValveBase.invokeNext(ValveBase.java:242)
	at 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:443)
	at org.apache.catalina.valves.ValveBase.invokeNext(ValveBase.java:242)
	at 
org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:242)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:975)
	at 
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:1876)
	at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
	at org.apache.catalina.valves.ValveBase.invokeNext(ValveBase.java:242)
	at 
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:343)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:975)
	at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:159)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:977)
	at 
org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:785)
	at 
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:902)
	at java.lang.Thread.run(Thread.java:484)

Root Cause:
java.lang.NullPointerException
	at 
org.apache.catalina.resources.FileResources.setResource(FileResources.java:586)
	at 
org.apache.catalina.servlets.DefaultServlet.doPut(DefaultServlet.java:401)
	at 
org.apache.catalina.servlets.DefaultServlet.doPost(DefaultServlet.java:365)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at 
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:517)
	at 
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:292)
	at 
org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:431)
	at 
login._0002flogin_0002fsecurity_0005fcheck_0002ejspsecurity_0005fcheck_jsp_32._jspService(_0002flogin_0002fsecurity_0005fcheck_0002ejspsecurity_0005fcheck_jsp_32.java:102)
	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.java:181)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:317)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:396)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:180)
	at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:255)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:977)
	at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:165)
	at org.apache.catalina.valves.ValveBase.invokeNext(ValveBase.java:242)
	at 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:443)
	at org.apache.catalina.valves.ValveBase.invokeNext(ValveBase.java:242)
	at 
org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:242)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:975)
	at 
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:1876)
	at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
	at org.apache.catalina.valves.ValveBase.invokeNext(ValveBase.java:242)
	at 
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:343)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:975)
	at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:159)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:977)
	at 
org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:785)
	at 
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:902)
	at java.lang.Thread.run(Thread.java:484)


_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


Mime
View raw message