2013/3/21 Álvaro López López <allopez@gmv.com>:
> I have tried to mimic that behavior in my version (struts2 - 2.312) but what explained
in this paragraph is not working:
>
> ."
>
> I have changed the "action" parameters in JSP to register-success and hello-success.
> Also, I have annotated the corresponding methods with @Action("xxxxx-success") in the
action classes.
>
> If you put any other string (e.g. hello-execute), it doesn´t work.
> It must be the same name as the WEB-INF/content/xxxx-yyyy.jsp you want to map.
Not it doesn't, action is action, result is result, don't mix them in
@Action. See simple example:
public class RegisterAction extends ActionSupport {
@Action("register") // basically not needed, just to show what I mean
public String execute() {
if (something)
return "success";
else
return "input";
}
}
and under WEB-INF/content/
- register-success.jsp (or just register.jsp)
- register-input.jsp
>
> After that, I get exceptions when assigning the personBean. For instance:
>
> "Error setting expression 'personBean.age' with value '[Ljava.lang.String;@340556b3':
ognl.OgnlException: target is null for setProperty(null, "age", [Ljava.lang.String;@340556b3)"
>
> I also attached a "message" property to the HelloAction but it didn´t appear in the
page, so the execute() method wasn´t called!
>
> I´m afraid the Action classes are not being found.
> I have also changed the namespace from "struts2annotations" to "Struts2_Annotations_Mvn"
(the name of the project) but it still doesn´t work... :S
>
> Next step?
Read documentation [1] how the Convention plugin is working, basically
[1]
Regards
--
Łukasz
+ 48 606 323 122
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org