-
1. Re: How to store username/password in the session in login.j
rabbuhl Feb 28, 2007 11:47 AM (in response to rabbuhl)I added a savelogin java class to a jar file and installed it in jbportal\server\default\deploy\jboss-portal.sar\lib
I changed login.jsp so the form calls savelogin:
<form method="POST" action="<%= response.encodeURL("savelogin") %>" name="loginform" id="loginForm">
I updated portal-server.war\WEB-INF\web.xml and added these lines:
<!-- The portal servlet is the main entrance point -->
<servlet-name>savelogin</servlet-name>
<servlet-class>com.mycompany.login.savelogin</servlet-class>
<load-on-startup>0</load-on-startup>
<!-- Provide access to login -->
<servlet-mapping>
<servlet-name>savelogin</servlet-name>
<url-pattern>/savelogin/*</url-pattern>
</servlet-mapping>
When I access the login page login.jsp and enter a username/password it tries to access this URL http://localhost:8080/portal/auth/portal/default/default/savelogin
and then re-displays the login.jsp page.
I am not sure how to put the correct URL in login.jsp which invokes the URL in web.xml to access the savelogin servlet.
Any help would be greatly appreciated. -
2. Re: How to store username/password in the session in login.j
twalex May 10, 2007 1:22 AM (in response to rabbuhl)I think if you only want to get the username, you may just call this method in jsp
String username = request.getUserPrincipal().getName();