-
1. Re: Setting the session variables after successfull login
rajasundaram Mar 4, 2010 5:39 PM (in response to tridib197779)Can you give some more information. -
2. Re: Setting the session variables after successfull login
tridib197779 Mar 4, 2010 11:46 PM (in response to rajasundaram)Hi Raja,
I have the login.jsp in \server\default\deploy\jboss-portal.sar\portal-server.war.
Inside that the action path is "j_security_check". After hitting the login button, probably it is going to some action mapping and action class, there I want to set some values in the session.
I want to know the the particular action class or .java file.
Or you can suggest me any other way to set up session variable after only successfull login.
Thanks
Tridib
-
3. Re: Setting the session variables after successfull login
jssteux Mar 5, 2010 5:09 AM (in response to tridib197779)Hi,
We have implemented specific fonctions at login (customization of dashboards) by implementing a specific LoginModule (declaration in conf/login-config.xml).
This LoginModule calls our methods which are implemented in a .sar file that we have have also developped .
-
4. Re: Setting the session variables after successfull login
tridib197779 Mar 5, 2010 7:13 AM (in response to jssteux)Hi Steux,
Thanks for your reply.can you be more specific in your point.can you send any sample implementation of the Login module.
After compilation where actually the loginmodule will go and sit in the server side(where inside the jboss-portal.sar).
Thanks
Tridib
-
5. Re: Setting the session variables after successfull login
jssteux Mar 5, 2010 8:54 AM (in response to tridib197779)public class DashboardLoginModule extends org.jboss.security.auth.spi.UsernamePasswordLoginModule{
...
public boolean commit() throws LoginException {
// Stockage d'un attribut login en cours
try {
performSynchronization(getUsername(), getUsersPassword());
} catch (Exception e) {
log.error(this, e);
throw new RuntimeException(e);
}return super.commit();
}...
}then copy the jar into server/default/lib (shoud work in jboss-portal.sar)
-
6. Re: Setting the session variables after successfull login
rajasundaram Mar 5, 2010 11:27 AM (in response to jssteux)you can get the httpsession by using the following code.
HttpServletRequest httpReq =
null;
try {
httpReq = (HttpServletRequest) PolicyContext.getContext(
"javax.servlet.http.HttpServletRequest");
}
catch(Exception e) {
e.printStackTrace(System.
out);
}
session=httpReq.getSession(
false);
Best way is your CustomLoginModule.