Thanks again for your help. So perhaps I'm not understanding how to get this to work. In my action I have this mapping:
@Result(name=Action.SUCCESS, value="/resources/${resource}.ftl", type= FreemarkerResult.class) And in my execute method I have: request.setAttribute("resource", "myPage"); The action is trying to forward to "/resources/.ftl". Which tells me it is not resolving ${resource}. Am I missing something? Thanks, Caine On 5/9/07, Musachy Barroso <[EMAIL PROTECTED]> wrote:
I haven't tried myself but the annotations for results should work just like regular xml-configured results. musachy On 5/9/07, Caine Lai <[EMAIL PROTECTED]> wrote: > > Thanks Musachy, > > But how would one do this if they were using Struts 2 annotations to map > their action classes? Is it possible? Or am I stuck with using XML for > this one action? > > Thanks, > Caine > > On 5/9/07, Musachy Barroso <[EMAIL PROTECTED]> wrote: > > > > You can use OGNL expressions in the result path, just make sure that you > > use > > ${expression}, instead of %{expression}, like > > > > <action ...> > > <result>${forwardTo}</result> > > </action> > > > > musachy > > > > On 5/9/07, Caine Lai <[EMAIL PROTECTED]> wrote: > > > > > > Does anyone know how I can forward to a .jsp file based on a dynamic > > > attribute (request parameter)? > > > > > > I want to write a Struts 2 action that will forward the user to a .jsp > > > dynamically. The flow works like so: > > > > > > 1. A request is made for 'resourceLocator.action?resource=common'. > > > 2. The resourceLocator.action class takes the 'resource' request > > parameter > > > and forwards the user to 'common.jsp'. > > > > > > I'm not able to figure out how this is done in Struts 2, since all > > actions > > > only return a String result which must be mapped. I'm trying to avoid > > > having to map all my resources in this action. > > > > > > Thanks! > > > > > > > > > > > -- > > "Hey you! Would you help me to carry the stone?" Pink Floyd > > > -- "Hey you! Would you help me to carry the stone?" Pink Floyd