Nathan Bubna wrote:
> 
> definitely making progress...
> 
> [snip]
> > - Removed all query parameter from the method forwardURL(). The
> recommended
> > way is to use a context tools like Nathan's proposed LinkTool to achieve
> this.
> > See notes and example at the end of that section. Since the LinkTool makes
> > sense with and without Struts, I don't want to add all its functionality
> > to the Struts tool(s) but rather keep it as a separate tool.
> 
> hmm.
> 
> [snip]
> > Note:
> > If you need to append query data to the URLs created with above methods,
> > it is recommended to use a context tool like Nathan's proposed LinkTool.
> > Using LinkTool, adding query parameters would works the following way:
> >
> > #set( $foolink = $link.setPath($struts.forward("login")) )
> > <a href="$foolink.addQueryData("action", "checkAuth")">Login</a>
> 
> this note is kinda sliding into phase 2 already, but we're pretty close to
> that anyway, so i don't think it'll hurt to comment on it...
> 
> i don't propose using my LinkTool in any fashion resembling the VTL above.
> i think the path, action, forward, query data, etc.  all needs to be part of
> the same tool.   the VTL above would become extremely annoying if we had to
> do that for every link w/query data.  i would prefer to see a velstruts
> specific version of LinkTool  that includes a setAction(String) and
> forward(String)  that behave in similar fashion to LinkTool.setPath(String).
> that way a link w/query data is as simple as
> 
> <a href="$link.forward('login').addQueryData('action','checkAuth')">Login</a>
>

Nathan,
what I propose is really very very similar to want you just describe. With
my proposed approach the above link could be written as

<a 
href="$link.setPath($url.forward("login")).addQueryData('action','checkAuth')">Login</a>

The added benefit is that the link tool stays general purpose and can
be used with or without Struts. It this really "extremly annoying"? 

If we combine all the features of your proposed link tool with the forward, 
action and baseRef methods of Struts, we would need another link tool that is not
strut-ified, thereby duplicating some functionality. I think there is some 
value in having tools that are orthogonal to each other. 

Additionally, in many practical cases, the forward, action and baseRef methods 
are used without adding query parameter explicitely (forms add the parameters 
automatically, baseRefs don't need parameters.) I am just finishing a Struts 
application where I never had the need to add query parameter explicitely. I 
worked with hidden form fields, instead. Those can be manipulated in JavaScript.
This add to my believe that the synergies of a combined tool are not as big
as it might seem at first.

Makes any sense to you? Any opinions from others?

Gabe

> 
> Nathan Bubna
> [EMAIL PROTECTED]

--
Gabriel Sidler
Software Engineer, Eivycom GmbH, Zurich, Switzerland

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to