users@glassfish.java.net

login.jsp customized by original target url

From: <glassfish_at_javadesktop.org>
Date: Fri, 11 Apr 2008 08:56:46 PDT

<p>
I have a web application that uses a form login page to protected web resources using Glassfish v2ur1.
</p><p>
Pretty typical stuff and JAAS authentication works and all that, no complaints.
</p><p>
But... I need to be able to customize my login.jsp to show a different login message depending on what resource the unauthenticated user was attempting to access.
</p><p>
I had read about request.getAttribute( "javax.servlet.forward.request_uri" ) which according to the 2.4 Servlet Specication and posts like <a href="http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=65&t=000686">this one</a> should tell me the original page that was requested.
</p><p>
Unfortunately, it this always returns null.
</p><p>
I've tried the following with no luck:
</p><ul>
<li>checking the attributes, parameters, headers and cookies of the request </li>
<li> remote debugged with Eclipse and walked the request object graph</li>
<li>put a filter in place to try and catch the redirection to login.jsp</li>
<li>tried replacing login.jsp with a filter</li>
<li>deployed the application in WAS 6.1.13</li>
</ul><p>
In WAS, the attribute still came back null, but it set a cookie called "WASReqURL" with the value of "/myapp/admin.jsp" . Unfortunately that doesn't help because my target platform is Glassfish.
</p><p>
Am I missing something or does this just not work?
</p>
[Message sent by forum member 'brian_of_fortent' (brian_of_fortent)]

http://forums.java.net/jive/thread.jspa?messageID=268813