You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by chris <ch...@gerrard.net> on 2004/04/06 01:19:24 UTC
Problem with custom ActionMapping, set-property and WebLogic
I'm having trouble getting a custom ActionMapping class populated with the
contents of a <set-property ... /> element of a Struts <action ..> </action>
declaration.
My code works under Tomcat, but not under Weblogic 8.1.
Can anyone provide any pointers?
Everything's fine, except that the custom properties don't get set.
The custom class:
public class MyActionMapping extends ActionMapping {
...
public void setUserRequired(String boolStr) {
System.out.println("\n.... setUserRequired(" + boolStr + ")");
userRequired = getBoolean(userRequired, boolStr);
}
// This is here to show the Mapping getting loaded, and it does
public void setInput(String input) {
System.out.println("\n.... setInput(" + input + ")");
super.setInput(input);
}
...
}
The struts-config:
<action-mappings type="MyActionMapping">
<action path="..."
scope="request"
name="FileUploadForm"
input="BadData.jsp">
<set-property value="false" property="userRequired" />
</action>
...
</action-mappings>
When my app loads I get this output from WebLogic:
---
.... MyActionMapping.setInput(BadData.jsp)
.... MyActionMapping.setInput(some.login.page)
---
So the correct ActionMapping class is being used, but the <set-property />
has no effect.
Thanks,
Chris
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Problem with custom ActionMapping, set-property and WebLogic
Posted by Martin Cooper <ma...@apache.org>.
Try adding matching getters for your setters, to make sure Weblogic sees
these as properties.
--
Martin Cooper
"chris" <ch...@gerrard.net> wrote in message
news:20040405231924.84305.qmail@netmail.mail.registeredsite.com...
> I'm having trouble getting a custom ActionMapping class populated with the
> contents of a <set-property ... /> element of a Struts <action ..>
</action>
> declaration.
>
> My code works under Tomcat, but not under Weblogic 8.1.
>
> Can anyone provide any pointers?
>
> Everything's fine, except that the custom properties don't get set.
>
>
> The custom class:
>
> public class MyActionMapping extends ActionMapping {
> ...
> public void setUserRequired(String boolStr) {
> System.out.println("\n.... setUserRequired(" + boolStr + ")");
> userRequired = getBoolean(userRequired, boolStr);
> }
>
> // This is here to show the Mapping getting loaded, and it does
> public void setInput(String input) {
> System.out.println("\n.... setInput(" + input + ")");
> super.setInput(input);
> }
> ...
> }
>
>
> The struts-config:
>
> <action-mappings type="MyActionMapping">
> <action path="..."
> scope="request"
> name="FileUploadForm"
> input="BadData.jsp">
> <set-property value="false" property="userRequired" />
> </action>
> ...
> </action-mappings>
>
> When my app loads I get this output from WebLogic:
>
> ---
> .... MyActionMapping.setInput(BadData.jsp)
>
> .... MyActionMapping.setInput(some.login.page)
> ---
>
> So the correct ActionMapping class is being used, but the <set-property />
> has no effect.
>
> Thanks,
>
> Chris
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org