You need to make sure your getter/setter follow the JavaBean
Specification conventions; specifically, the getter and setter must have
the same type. You have a boolean getter and a String setter, which is
not allowed by the spec. Change one of them so they match and you should
be OK. Either type should work I think; conversion to boolean should
happen automatically if needed.
L.
Dave wrote:
I'm using Struts 1.1. I have an ActionMapping class:
public class My_ActionMapping extends SecureActionConfig
{
protected boolean secured = false;
public boolean getLoginSecured() {
System.out.println("Getting Login Secured");
return secured;
}
public void setLoginSecured (String Secured) {
secured = Secured.equalsIgnoreCase("true");
System.out.println("Setting Login Secured");
}
}
Which is attached in my struts config like so:
<action-mappings type="com.eri.web.struts.actions.My_ActionMapping">
<action path="/SetParticipationPage"
type="com.web.struts.actions.My_ForwardAction"
parameter=".member.participation.page"
scope="request">
<set-property property="secure" value="true"/>
<set-property property="loginSecured" value="true"/>
</action>
</action-mappings>
The execute of My_ForwardAction is defined like this:
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
System.out.println("In ERI ForwardAction");
if ( ((My_ActionMapping)mapping).getLoginSecured() ) {
if ( SecurePageService.IsLoggedIn (request) ) {
System.out.println("Return logged in");
return super.execute(mapping, form, request, response);
} else {
System.out.println("Return need logged in");
SecurePageService.saveRequestedURI (request);
return SecurePageService.getSecurePageForward (mapping);
}
} else {
System.out.println("Return not logged in");
return super.execute(mapping, form, request, response);
}
}
The problem is that the loginSecured property is never set. Is there a method I
need to call that causes the properties to be read? Any other ideas on how I
might solve this problem?
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]