[Struts-JSP] Adding Programmatic User Authentication
422987Aug 2 2004 — edited Aug 11 2004I'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