You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Ruth, Brice" <br...@fiskars.com> on 2003/10/21 19:23:28 UTC
html:rewrite doesn't rewrite "action" contrary to docs?
The docs
(http://jakarta.apache.org/struts/userGuide/struts-html.html#rewrite)
indicate that html:rewrite will rewrite an action, forward, href, or
page attribute - but the "action" attribute isn't in the TLD and in the
source for org.apache.struts.taglib.html.RewriteTag the call to
RequestUtils.computeURL passes a hard-coded "null" in for the action
parameter.
Why?
--
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: html:rewrite doesn't rewrite "action" contrary to docs?
Posted by "Ruth, Brice" <br...@fiskars.com>.
Its actually not quite that difficult to understand - the drop down form
element was selected by the design agency as a means of navigating
between the localizations of the site. So, the actual select doesn't
submit a form (so no code to be executed on the server end) - it simply
calls a bit of javascript code that takes the URL contained in the value
attribute of the <option> and directs the browser to load that URL.
Not very sophisticated, not very difficult - its really merely a design
element. But, it necessitates the need for the URL that is in the value
attribute of the <option> tag be correct, based on the rewriting rules
that Struts applies. It just surprised me that this isn't in 1.1 - seems
like that would be a no-brainer, but maybe there's more to it than just
what I see :)
No biggie - my workaround is fine for now.
James Mitchell wrote:
>Hmmm...that's a tough one.
>
>Perhaps you should reevaluate your Use Case.
>
>Q.Why are you submitting to a different URL depending on the selection
> of a drop down?
>
>Q.Why don't you just perform a different piece of code depending on what
>
> they picked?
>
>
>
>
>
>--
>James Mitchell
>Software Engineer / Struts Evangelist
>http://www.struts-atlanta.org
>678.910.8017
>AIM:jmitchtx
>
>
>
>
>
>
>>-----Original Message-----
>>From: Ruth, Brice [mailto:bruth@fiskars.com]
>>Sent: Tuesday, October 21, 2003 2:11 PM
>>To: Struts Users Mailing List
>>Subject: Re: html:rewrite doesn't rewrite "action" contrary to docs?
>>
>>
>>I have a drop-down select that jumps the user to a different
>>country's
>>site (e.g. from /US/whatever to /DE/index.do). For the select
>>to work, I
>>embed the link for the jump in the option's "value" attribute - so it
>>looks like this:
>>
>><option value='<html:rewrite page="/US/index.do">'>US</option>
>>
>>The reason I need the rewrite (besides sessions and such) is
>>that this
>>is in a tile that will be referenced from pages that aren't all
>>necessarily at the same hierarchy level.
>>
>>Brice
>>
>>James Mitchell wrote:
>>
>>
>>
>>>There are other ways to get around hard-coding ".do" anywhere in your
>>>app.
>>>What, specifically, are you rewriting?
>>>
>>>
>>>--
>>>James Mitchell
>>>Software Engineer / Struts Evangelist
>>>http://www.struts-atlanta.org
>>>678.910.8017
>>>AIM:jmitchtx
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>>-----Original Message-----
>>>>From: Ruth, Brice [mailto:bruth@fiskars.com]
>>>>Sent: Tuesday, October 21, 2003 1:46 PM
>>>>To: Struts Users Mailing List
>>>>Subject: Re: html:rewrite doesn't rewrite "action" contrary to docs?
>>>>
>>>>
>>>>I see. Well, I would prefer only to use stable release builds
>>>>for this -
>>>>so I can make do with adding ".do" on the end of my
>>>>
>>>>
>>relative URLs and
>>
>>
>>>>using "page" instead of "action" for now ... when will the
>>>>next stable
>>>>release come out?
>>>>
>>>>James Mitchell wrote:
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>>It was added after 1.1 release. That's why it is "in" in
>>>>>
>>>>>
>>>>>
>>>>>
>>>>the docs, but
>>>>
>>>>
>>>>
>>>>
>>>>>not available anywhere except in the nightlies.
>>>>>
>>>>>
>>>>>
>>>>>--
>>>>>James Mitchell
>>>>>Software Engineer / Struts Evangelist
>>>>>http://www.struts-atlanta.org
>>>>>678.910.8017
>>>>>AIM:jmitchtx
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>-----Original Message-----
>>>>>>From: Ruth, Brice [mailto:bruth@fiskars.com]
>>>>>>Sent: Tuesday, October 21, 2003 1:23 PM
>>>>>>To: Struts Users Mailing List
>>>>>>Subject: html:rewrite doesn't rewrite "action" contrary to docs?
>>>>>>
>>>>>>
>>>>>>The docs
>>>>>>(http://jakarta.apache.org/struts/userGuide/struts-html.html
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>#rewrite)
>>>
>>>
>>>
>>>
>>>>>indicate that html:rewrite will rewrite an action,
>>>>>
>>>>>
>>forward, href, or
>>
>>
>>>>>page attribute - but the "action" attribute isn't in the TLD
>>>>>and in the
>>>>>source for org.apache.struts.taglib.html.RewriteTag the call to
>>>>>RequestUtils.computeURL passes a hard-coded "null" in for
>>>>>
>>>>>
>>the action
>>
>>
>>>>>parameter.
>>>>>
>>>>>Why?
>>>>>
>>>>>--
>>>>>Brice D. Ruth
>>>>>Sr. IT Analyst
>>>>>Fiskars Brands, Inc.
>>>>>
>>>>>
>>>>>
>>>>>-----------------------------------------------------------
>>>>>
>>>>>
>>----------
>>
>>
>>>>>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>>>>>For additional commands, e-mail:
>>>>>
>>>>>
>>struts-user-help@jakarta.apache.org
>>
>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>------------------------------------------------------------
>>>>
>>>>
>>---------
>>
>>
>>>>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>>>>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>>
>>--
>>Brice D. Ruth
>>Sr. IT Analyst
>>Fiskars Brands, Inc.
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>
>>
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>
--
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
RE: html:rewrite doesn't rewrite "action" contrary to docs?
Posted by James Mitchell <jm...@apache.org>.
Hmmm...that's a tough one.
Perhaps you should reevaluate your Use Case.
Q.Why are you submitting to a different URL depending on the selection
of a drop down?
Q.Why don't you just perform a different piece of code depending on what
they picked?
--
James Mitchell
Software Engineer / Struts Evangelist
http://www.struts-atlanta.org
678.910.8017
AIM:jmitchtx
> -----Original Message-----
> From: Ruth, Brice [mailto:bruth@fiskars.com]
> Sent: Tuesday, October 21, 2003 2:11 PM
> To: Struts Users Mailing List
> Subject: Re: html:rewrite doesn't rewrite "action" contrary to docs?
>
>
> I have a drop-down select that jumps the user to a different
> country's
> site (e.g. from /US/whatever to /DE/index.do). For the select
> to work, I
> embed the link for the jump in the option's "value" attribute - so it
> looks like this:
>
> <option value='<html:rewrite page="/US/index.do">'>US</option>
>
> The reason I need the rewrite (besides sessions and such) is
> that this
> is in a tile that will be referenced from pages that aren't all
> necessarily at the same hierarchy level.
>
> Brice
>
> James Mitchell wrote:
>
> >There are other ways to get around hard-coding ".do" anywhere in your
> >app.
> >What, specifically, are you rewriting?
> >
> >
> >--
> >James Mitchell
> >Software Engineer / Struts Evangelist
> >http://www.struts-atlanta.org
> >678.910.8017
> >AIM:jmitchtx
> >
> >
> >
> >
> >
> >
> >>-----Original Message-----
> >>From: Ruth, Brice [mailto:bruth@fiskars.com]
> >>Sent: Tuesday, October 21, 2003 1:46 PM
> >>To: Struts Users Mailing List
> >>Subject: Re: html:rewrite doesn't rewrite "action" contrary to docs?
> >>
> >>
> >>I see. Well, I would prefer only to use stable release builds
> >>for this -
> >>so I can make do with adding ".do" on the end of my
> relative URLs and
> >>using "page" instead of "action" for now ... when will the
> >>next stable
> >>release come out?
> >>
> >>James Mitchell wrote:
> >>
> >>
> >>
> >>>It was added after 1.1 release. That's why it is "in" in
> >>>
> >>>
> >>the docs, but
> >>
> >>
> >>>not available anywhere except in the nightlies.
> >>>
> >>>
> >>>
> >>>--
> >>>James Mitchell
> >>>Software Engineer / Struts Evangelist
> >>>http://www.struts-atlanta.org
> >>>678.910.8017
> >>>AIM:jmitchtx
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>>-----Original Message-----
> >>>>From: Ruth, Brice [mailto:bruth@fiskars.com]
> >>>>Sent: Tuesday, October 21, 2003 1:23 PM
> >>>>To: Struts Users Mailing List
> >>>>Subject: html:rewrite doesn't rewrite "action" contrary to docs?
> >>>>
> >>>>
> >>>>The docs
> >>>>(http://jakarta.apache.org/struts/userGuide/struts-html.html
> >>>>
> >>>>
> >#rewrite)
> >
> >
> >>>indicate that html:rewrite will rewrite an action,
> forward, href, or
> >>>page attribute - but the "action" attribute isn't in the TLD
> >>>and in the
> >>>source for org.apache.struts.taglib.html.RewriteTag the call to
> >>>RequestUtils.computeURL passes a hard-coded "null" in for
> the action
> >>>parameter.
> >>>
> >>>Why?
> >>>
> >>>--
> >>>Brice D. Ruth
> >>>Sr. IT Analyst
> >>>Fiskars Brands, Inc.
> >>>
> >>>
> >>>
> >>>-----------------------------------------------------------
> ----------
> >>>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> >>>For additional commands, e-mail:
> struts-user-help@jakarta.apache.org
> >>>
> >>>
> >>>
> >>>
> >>>
> >>------------------------------------------------------------
> ---------
> >>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >>
> >>
> >>
> >>
> >>
> >
> >
> >
>
> --
> Brice D. Ruth
> Sr. IT Analyst
> Fiskars Brands, Inc.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: html:rewrite doesn't rewrite "action" contrary to docs?
Posted by "Ruth, Brice" <br...@fiskars.com>.
I have a drop-down select that jumps the user to a different country's
site (e.g. from /US/whatever to /DE/index.do). For the select to work, I
embed the link for the jump in the option's "value" attribute - so it
looks like this:
<option value='<html:rewrite page="/US/index.do">'>US</option>
The reason I need the rewrite (besides sessions and such) is that this
is in a tile that will be referenced from pages that aren't all
necessarily at the same hierarchy level.
Brice
James Mitchell wrote:
>There are other ways to get around hard-coding ".do" anywhere in your
>app.
>What, specifically, are you rewriting?
>
>
>--
>James Mitchell
>Software Engineer / Struts Evangelist
>http://www.struts-atlanta.org
>678.910.8017
>AIM:jmitchtx
>
>
>
>
>
>
>>-----Original Message-----
>>From: Ruth, Brice [mailto:bruth@fiskars.com]
>>Sent: Tuesday, October 21, 2003 1:46 PM
>>To: Struts Users Mailing List
>>Subject: Re: html:rewrite doesn't rewrite "action" contrary to docs?
>>
>>
>>I see. Well, I would prefer only to use stable release builds
>>for this -
>>so I can make do with adding ".do" on the end of my relative URLs and
>>using "page" instead of "action" for now ... when will the
>>next stable
>>release come out?
>>
>>James Mitchell wrote:
>>
>>
>>
>>>It was added after 1.1 release. That's why it is "in" in
>>>
>>>
>>the docs, but
>>
>>
>>>not available anywhere except in the nightlies.
>>>
>>>
>>>
>>>--
>>>James Mitchell
>>>Software Engineer / Struts Evangelist
>>>http://www.struts-atlanta.org
>>>678.910.8017
>>>AIM:jmitchtx
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>>-----Original Message-----
>>>>From: Ruth, Brice [mailto:bruth@fiskars.com]
>>>>Sent: Tuesday, October 21, 2003 1:23 PM
>>>>To: Struts Users Mailing List
>>>>Subject: html:rewrite doesn't rewrite "action" contrary to docs?
>>>>
>>>>
>>>>The docs
>>>>(http://jakarta.apache.org/struts/userGuide/struts-html.html
>>>>
>>>>
>#rewrite)
>
>
>>>indicate that html:rewrite will rewrite an action, forward, href, or
>>>page attribute - but the "action" attribute isn't in the TLD
>>>and in the
>>>source for org.apache.struts.taglib.html.RewriteTag the call to
>>>RequestUtils.computeURL passes a hard-coded "null" in for the action
>>>parameter.
>>>
>>>Why?
>>>
>>>--
>>>Brice D. Ruth
>>>Sr. IT Analyst
>>>Fiskars Brands, Inc.
>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>>
>>>
>>>
>>>
>>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>
>>
>>
>>
>>
>
>
>
--
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
RE: html:rewrite doesn't rewrite "action" contrary to docs?
Posted by James Mitchell <jm...@apache.org>.
There are other ways to get around hard-coding ".do" anywhere in your
app.
What, specifically, are you rewriting?
--
James Mitchell
Software Engineer / Struts Evangelist
http://www.struts-atlanta.org
678.910.8017
AIM:jmitchtx
> -----Original Message-----
> From: Ruth, Brice [mailto:bruth@fiskars.com]
> Sent: Tuesday, October 21, 2003 1:46 PM
> To: Struts Users Mailing List
> Subject: Re: html:rewrite doesn't rewrite "action" contrary to docs?
>
>
> I see. Well, I would prefer only to use stable release builds
> for this -
> so I can make do with adding ".do" on the end of my relative URLs and
> using "page" instead of "action" for now ... when will the
> next stable
> release come out?
>
> James Mitchell wrote:
>
> >It was added after 1.1 release. That's why it is "in" in
> the docs, but
> >not available anywhere except in the nightlies.
> >
> >
> >
> >--
> >James Mitchell
> >Software Engineer / Struts Evangelist
> >http://www.struts-atlanta.org
> >678.910.8017
> >AIM:jmitchtx
> >
> >
> >
> >
> >
> >
> >>-----Original Message-----
> >>From: Ruth, Brice [mailto:bruth@fiskars.com]
> >>Sent: Tuesday, October 21, 2003 1:23 PM
> >>To: Struts Users Mailing List
> >>Subject: html:rewrite doesn't rewrite "action" contrary to docs?
> >>
> >>
> >>The docs
> >>(http://jakarta.apache.org/struts/userGuide/struts-html.html
#rewrite)
>>indicate that html:rewrite will rewrite an action, forward, href, or
>>page attribute - but the "action" attribute isn't in the TLD
>>and in the
>>source for org.apache.struts.taglib.html.RewriteTag the call to
>>RequestUtils.computeURL passes a hard-coded "null" in for the action
>>parameter.
>>
>>Why?
>>
>>--
>>Brice D. Ruth
>>Sr. IT Analyst
>>Fiskars Brands, Inc.
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>
>>
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>
--
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: html:rewrite doesn't rewrite "action" contrary to docs?
Posted by "Ruth, Brice" <br...@fiskars.com>.
I see. Well, I would prefer only to use stable release builds for this -
so I can make do with adding ".do" on the end of my relative URLs and
using "page" instead of "action" for now ... when will the next stable
release come out?
James Mitchell wrote:
>It was added after 1.1 release. That's why it is "in" in the docs, but
>not available anywhere except in the nightlies.
>
>
>
>--
>James Mitchell
>Software Engineer / Struts Evangelist
>http://www.struts-atlanta.org
>678.910.8017
>AIM:jmitchtx
>
>
>
>
>
>
>>-----Original Message-----
>>From: Ruth, Brice [mailto:bruth@fiskars.com]
>>Sent: Tuesday, October 21, 2003 1:23 PM
>>To: Struts Users Mailing List
>>Subject: html:rewrite doesn't rewrite "action" contrary to docs?
>>
>>
>>The docs
>>(http://jakarta.apache.org/struts/userGuide/struts-html.html#rewrite)
>>indicate that html:rewrite will rewrite an action, forward, href, or
>>page attribute - but the "action" attribute isn't in the TLD
>>and in the
>>source for org.apache.struts.taglib.html.RewriteTag the call to
>>RequestUtils.computeURL passes a hard-coded "null" in for the action
>>parameter.
>>
>>Why?
>>
>>--
>>Brice D. Ruth
>>Sr. IT Analyst
>>Fiskars Brands, Inc.
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>
>>
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>
--
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
RE: html:rewrite doesn't rewrite "action" contrary to docs?
Posted by James Mitchell <jm...@apache.org>.
It was added after 1.1 release. That's why it is "in" in the docs, but
not available anywhere except in the nightlies.
--
James Mitchell
Software Engineer / Struts Evangelist
http://www.struts-atlanta.org
678.910.8017
AIM:jmitchtx
> -----Original Message-----
> From: Ruth, Brice [mailto:bruth@fiskars.com]
> Sent: Tuesday, October 21, 2003 1:23 PM
> To: Struts Users Mailing List
> Subject: html:rewrite doesn't rewrite "action" contrary to docs?
>
>
> The docs
> (http://jakarta.apache.org/struts/userGuide/struts-html.html#rewrite)
> indicate that html:rewrite will rewrite an action, forward, href, or
> page attribute - but the "action" attribute isn't in the TLD
> and in the
> source for org.apache.struts.taglib.html.RewriteTag the call to
> RequestUtils.computeURL passes a hard-coded "null" in for the action
> parameter.
>
> Why?
>
> --
> Brice D. Ruth
> Sr. IT Analyst
> Fiskars Brands, Inc.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org