You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Joe Germuska <jo...@germuska.com> on 2007/01/12 23:53:26 UTC

JSTL functions in *struts* JSP tags

Since the whole question about using JSTL tags in Tiles went off in a
different direction, I'll try again.

(No, I don't have a burning desire to force them into some open source
project -- but in the Tiles case, no one commented on the general question
and it went in a different direction.)

Anyway, am I the only one who finds this syntax tedious?

<s:url id="es" action="Hello">
<s:param name="request_locale">es</s:param>
</s:url>
<s:a href="%{es}">Español</s:a>

One think I really liked about the ol' html:link tag was automatic URL
rewriting.

I don't know, I guess once you start thinking about all the parameters you
might need to pass, it may be unworkable.  My first thought was

<s:a href="${s:rewrite('/index.do'}">foo</s:a>

At least if we do have a use case for JSTL functions, we could use the
ActionContext threadlocal to get our hands on the ServletContext, etc.

Is it worth doing something for just the simplest case, or should I just get
used to a little extra clutter in my pages?

Joe

-- 
Joe Germuska
Joe@Germuska.com * http://blog.germuska.com

"The truth is that we learned from João forever to be out of tune."
-- Caetano Veloso

Re: JSTL functions in *struts* JSP tags

Posted by Tom Schneider <sc...@gmail.com>.
+1 for having a seperate key attribute that automatically does a 
getText() lookup for the label.

This was one thing that is annoying in WW since we tried to I18Nize our 
whole app.  The url thing didn't bother me as much, but I'm all for a 
shorthand notation if it makes sense.  (Url/Button links tend to be 
rather verbose no matter what)

On a slightly related note, the other thing we did was change the 
default button-style submit to render as:

<input type="button"...

rather than

<button ...

Since <button doesn't work the same on all browsers.  (type="button" was 
what we used before switching to WW)  I'm not sure if this is something 
that should be changed in the core tags, but I thought I'd throw it out 
there.
Tom

Ted Husted wrote:
> On 1/12/07, Joe Germuska <jo...@germuska.com> wrote:
>> Anyway, am I the only one who finds this syntax tedious?
>
> No, you are not.
>
> * https://issues.apache.org/struts/browse/WW-1517
>
> Just looking for a patch ...
>
> I don't see a problem with having one tag for the simplest (and most
> common case) of a single parameter, and then switching to the
> url/param idiom when there are multiple.
>
> -Ted.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: JSTL functions in *struts* JSP tags

Posted by Ted Husted <hu...@apache.org>.
On 1/12/07, Joe Germuska <jo...@germuska.com> wrote:
> Anyway, am I the only one who finds this syntax tedious?

No, you are not.

* https://issues.apache.org/struts/browse/WW-1517

Just looking for a patch ...

I don't see a problem with having one tag for the simplest (and most
common case) of a single parameter, and then switching to the
url/param idiom when there are multiple.

-Ted.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org