Re: [Webwork-user] Using views as an action
Brought to you by:
baldree,
rickardoberg
From: Matt B. <ma...@sm...> - 2002-05-27 13:07:18
|
Remember you can tier your views meaning you can indicate a base action that will just return SUCCESS and define more specific successes as you see fit. my.action=ActionSupport my.success=x.vm my.xxx.success=xxx.vm my.yyy.success=yyy.vm So a call to my.xxx.action will map to xxx.vm and my.yyy.action will map to yyy.vm or calls to my.action will map to x.vm. Will this not give you the flexibility you need? ----- Original Message ----- From: "Aapo Laakkonen" <aap...@pr...> To: "'Matt Baldree'" <ma...@sm...>; <web...@li...> Sent: Monday, May 27, 2002 7:28 AM Subject: RE: [Webwork-user] Using views as an action > > I'm not quite sure what you are after. > > Can you give a more concrete example? > > Ok here we go: > > If have these HTML-file: > > file1.vm: > <html> > <body> > <a href="my.action">My Action</a> > </body> > </html> > > file2.vm: > <html> > <body> > <a href="my.action">My Action</a> > </body> > </html> > > file3.vm: > <html> > <body> > <a href="my.action">My Action</a> > </body> > </html> > > Ok in real life they are much different, but the point is... > > Let's say that my.action is not really an action, it's just a mapping to > a view, so my views.properties is something like this: > > my.action=foo.vm > > So when I click those links I end up in foo.vm file that is an Velocity > file (server side forward). And the process did not go throught any > action class. > > I can the easily refactor my application by just modifying > views.properties, for example (my refactored views.propertirs): > > my.action=deep/in/directory/structure/foo.vm > > And the point is that I do not have to change all those > JSP/Velocity/etc. files to get to the new mapping. > > And more importantly... what if I want to do some processing, then I > just refactor my views.properties logic, for example like this: > > my.action=ValidateUser > my.action.success=validated.vm > my.action.failed=go_home_lame_hacker.vm > > This is possible with Struts framework and I think that it is not very > difficult to implement with WebWork. Or do you suggest some other ways > to do this? > > Kind Regards > Aapo Laakkonen > > > |