Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

[Struts-JSP] Adding Programmatic User Authentication

422987Aug 2 2004 — edited Aug 11 2004
I'm trying to implement Programmatic User Authentication for Struts-JSP.

I've added the following to the struts-config.xml:
<action path="/Login" type="oracle.jheadstart.controller.struts.action.ActionRouter">
<set-property property="defaultForward" value="initialState"/>
<forward name="initialState" path="/WEB-INF/home/page/jsp/LoginPage.jsp"/>
<forward name="checkLogin" path="validateLoginUser"/>
</action>

After trying to log in the page is always forwarded to the default initialState forward.

After debugging the corresponding action class ActionRouter I noticed that attributeValue always stays null, so always the default forward is used.


String forwardName = mapping.getDefaultForward();
...
for (int i=0; i<mapping.findForwards().length;i++)
{
attributeName = (String)mapping.findForwards();
attributeValue = sessionData.getAttribute(attributeName,true);
if(attributeValue != null && !"".equals(attributeValue))
{
When the first non-null attribute is found, set forward to the
name of the attribute
forwardName = attributeName;
break;
}
}
...
return mapping.findForward(forwardName);


I'm a little bit stuck now and don't know how to proceed/solve this issue. It looks the attributes are null, but I don't know which parameters are needed.

P.S.: I have used the jsp files as proposed by Attention mark on page 2-18 of tutorial 3.

Kind Regards,
Marcel Overdijk
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 8 2004
Added on Aug 2 2004
8 comments
582 views