views:

8

answers:

0

I know that you can return custom objects using struts2 by specifying a declaration in your struts.xml file. I've done that, gotten that to work.

What I want to do is move away from that, and accomplish the same thing via annotations. If I have an action that is going to return a custom result type I would like to be able to do it. I played around a bit but haven't been able to get anything to work.

@Result(name="success", type="results.MyResult.class")
public class MyAction extends ActionSupport
{ ...

This doesn't work

@Result(name="success", type=results.MyResult.class)
public class MyAction extends ActionSupport
{ ...

This doesn't compile