[JBoss Portal] - Authenticate and redirect/forward to another page in the por
by vijaychhipa
Hello
I have a request from a user of my portal to automatically log in the user into the portal and then take them to a particular page say p1.jsp .
The user will pass a param in the request "next_url=UserManager/UserListPortletWindow?action=2&operation=view_reg_code"
Since I use a DatabaseLoginModule I am able to to the authenticate the user by having his link point to
/portal/j_security_check?&j_username=xyz&j_password=y&next_url=above string
This works fine, the user is logged in, but the user is brought to the home page or default page specified in the web.xml.
How do I redirect or forward the request to the next_url after successfully authenticating him.
I tried to put in the following code in the commit() method of the DatabaseLoginModule in a failed attempt to forward the request
| public boolean commit() throws LoginException {
| boolean result = super.commit();
|
| try{
| HttpServletRequest request = (HttpServletRequest) PolicyContext.getContext(REQUEST_CONTEXT);
|
| RequestDispatcher rd = request.getRequestDispatcher("/users");
| HttpServletResponse response = (HttpServletResponse) PolicyContext.getContext("javax.servlet.http.HttpServletResponse");
| rd.forward(request, response);
| } catch (Exception e) {
| log.error("Caught Exception while putting MyRackspaceUser in session!", e);
| }
| return result;
| }
|
this fails because there is no such context as "javax.servlet.http.HttpServletResponse"
There does not seem to be a way to redirect the request.
Is there any way to redirect/forward the user to a specific page in the portal right after login.
Any help is highly appreciated.
Thank you so much.
Vijay
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4043298#4043298
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4043298
19 years
[JBoss Seam] - Re: While Seam is great, is any weakness of this framework?
by ASavitsky
Because we're a major bank where everyone cannot run whatever they please. There are tons of regulations regarding what is allowed to run production environments. There's an architectural department that makes such decisions for a few years ahead. There are administrators that are hired with specific skill sets. But, yes, I guess I'll simply go to our production admins and say "Hey, why aren't you willing to just download JBoss AS for free and use the embedded Tomcat?". Yes, that suddenly seems a terribly good idea...
Seriously though, we here have WebSphere for mission-critical apps (no, I don't want to go into argument why are we using it), plus Tomcat for everything else that doesn't require a full-blown appserver. Tomcat administration is order of magnitude simpler than it is for an appserver, so, in the long run, these guys are saving a good money on support costs, both hardware and salaries.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4043296#4043296
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4043296
19 years