On Thu, Jun 26, 2008 at 5:37 PM, Claude Brisson <[EMAIL PROTECTED]> wrote:
> Le jeudi 26 juin 2008 à 15:42 -0600, White, Tim a écrit :
>> > I don't use any centralized controller anymore - never understood why
>> it was an
>> > advantage. So I'm using a kind of MV paradigm with a decentralized
>> controller,
>> > and I'm very happy with it. It's quite straightforward and more
>> flexible.
>>
>> Right - I'm trying to do more of a 'pull' MVC model, where I centralize
>> the business logic into Velocity Tools, rather than into the
>> controllers.
>>
>> A classic example of needing to do a server side redirect though is "are
>> we authenticated? No? Back to the login page, please".
>
> Ah. For this very specific example, I use a filter (the Velosurf's
> AuthenticationFilter) - but for a tiny webapp, it could hold.
yeah, filters are a great fit for authentication.
> I'll give another example:
>
> Whenever I commit forms (which have many and/or text fields), I use the
> "redirect after post" technic, mainly to avoid the "would you like to
> resubmit data?" (or alike) dialog which pops up when the user just wants
> to refresh the page.
>
> For this purpose, I use small "action templates" (*.do => my
> ActionServlet) in which I use VTL as a basic scripting language (who can
> do the most can do the least) that look typically like this:
>
> #if($some_model_object.validate($params))
> #do_something_with($params)
> #redirect("/thank_you.vtl")
> #else
> $logger.error("Houston, we've got a problem: $query")
> #seterror("please try again!")
> #redirect("/the_form.vtl")
> #end
which is essentially using Velocity to script your "action
controller". though there are "real" scripting languages better
suited to this, i suppose it at least reduces the number of
technologies/languages you have to think about. :)
>
>
> Claude
>
>> Tim
>>
>>
>> This communication is the property of Qwest and may contain confidential or
>> privileged information. Unauthorized use of this communication is strictly
>> prohibited and may be unlawful. If you have received this communication
>> in error, please immediately notify the sender by reply e-mail and destroy
>> all copies of the communication and any attachments.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]