RE: [Webwork-user] Using views as an action
Brought to you by:
baldree,
rickardoberg
From: Aapo L. <aap...@pr...> - 2002-05-27 12:28:29
|
> 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 |