@Result annotation not working 2007-02-08 - By Laurie Harper
Back What do I need to do to make @(protected) annotations on my action methods work? I'm using the code-behind and zero-config plugins, and tried to add the annotation like this:
@(protected)(value = "users", type = ServletActionRedirectResult.class) public String save() { userService.saveUser(user); return SUCCESS; }
I've tried a few different variations, with and without a surrounding @(protected) annotation, and none of them have any effect. Do I need to configure an additional interceptor, or otherwise configure something specially?
I'm working with 2.0.4-SNAPSHOT at the moment, and have the following artifacts in my classpath:
struts-annotations-1 (See http://ons-1.ora-code.com).0-SNAPSHOT.jar struts2-codebehind-plugin-2 (See http://gin-2.ora-code.com).0.3-SNAPSHOT.jar struts2-spring-plugin-2 (See http://gin-2.ora-code.com).0.3-SNAPSHOT.jar struts2-api-2 (See http://api-2.ora-code.com).0.3-SNAPSHOT.jar struts2-core-2 (See http://ore-2.ora-code.com).0.3-SNAPSHOT.jar
Did I miss anything?
Secondary question: shouldn't the 'value' be optional when using the code-behind plugin? Since the plugin will automatically find users-success.jsp / users.jsp, it seems like I should be able to just say things like:
@(protected)( @(protected)(ServletActionRedirectResult.class) @(protected)(name="oops", ServletRedirectResult.class) ) public String execute() { if (something) return SUCCESS; return "oops"; }
L.
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------ To unsubscribe, e-mail: user-unsubscribe@(protected) For additional commands, e-mail: user-help@(protected)
|
|