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" <[EMAIL PROTECTED]>
To: "'Matt Baldree'" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
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
>
>
>



_______________________________________________________________

Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm

_______________________________________________
Webwork-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webwork-user

Reply via email to