You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Thomas Hamacher <th...@qualiads.de> on 2005/11/10 12:13:42 UTC
html:rewrite with params
Hi,
just a quick question:
I want to replace the following:
javascript:newWindow('popup-faq.jsp?txt=date','350', '500')
with the html:rewrite. So I added an entry into my struts-config and my
tiles-def and changed it to:
javascript:newWindow('<html:rewrite action="/popup/faq" />?txt=date','350',
'500')
Now a want to add the param dynamically as well. As I do not use forms in
here, because I have multiple calls of the newWindow-function with different
parameters I would like to add it manually. For example use the paramId
attribute (e.g. paramId="txt") and add the value myself (e.g. value="date")
and not through a formbean. Is this possible somehow? If not, what would be a
good solution to solve this problem? I can stay with my current-solution so
far, but I wonder if the ActionForward somehow saves the parameters in it's
object, what I would need in my application. Does anyone have informations on
this issue?
Thanks so far
Thomas
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Updating ActionForm from indexed properties
Posted by "Mulligan, Scott H" <sc...@eds.com>.
My actionForm has an ArrayList of objects that I display in my JSP for update using indexed properties (see below JSP code):
<logic:iterate id="objectVO" name="FormConfig" property="objectCollection" type="com.xxx.MyType">
<html:text name="objectVO" property="stringProperty" indexed="true" />
<html:text name="objectVO" property="intProperty" indexed="true" />
</logic:iterate>
My Action Form looks like this:
public ArrayList getObjectCollection() {return objectCollection;}
public void setObjectCollection(ArrayList p_ObjectCollection) {objectCollection= p_ObjectCollection;}
public void setObjectVO(int index, MyType p_object) {objectCollection.set(index, p_object);}
public MyType getObjectVO(int i) {return (MyType) objectCollection.get(i);}
The object class has a String property and an int property.
The information gets displayed properly and updated properly when valid data is entered. However, if the user enters a non-numeric value for the intProperty field, the int property in the object in the ArrayList in my actionForm gets set to 0. Is there a way to trap this situation or to a way to avoid this from happening?
Thanks for your help
Re: html:rewrite with params
Posted by Laurie Harper <la...@holoweb.net>.
Thomas Hamacher wrote:
> Laurie,
>
> thank you so for. This makes sense to me.
> But the problem is, that I don´t really have a source-url, as it is used in
> the examples. I´m using tiles and therefor I have to work with definitions. I
> guess, I cannot add any definition as a source, can I?
Sure you can, just make 'source' a tile attribute and set it where you
reference the tile.
> Actually I always want to return to the same page, together with any used
> params and all information of the form-bean, but with a different Locale.
> That´s it. But this doesn´t seems to be that trivial, altough I thought this
> would be a standard-problem...
As long as you forward (rather than redirect) to the destination page,
the request data (what the form bean was populated from) will be
retained. If you always want to go to the same page, you can just do
'return mapping.findForward("foward name");' to get the result you want.
L.
>
> Thomas
>
> On Wednesday 16 November 2005 22:56, Laurie Harper wrote:
>
>>You don't need to save the parameter, you can just append it to the URL
>>you forward to at the end of your SwitchLanguage action, assuming you
>>know it should be there. RedirectAction in Struts 1.2.7 and up gives you
>>a relatively easy way to add parameters to a forward mapping before you
>>return it.
>>
>>There's no way to save the parameter on the action forward, since such a
>>feature wouldn't be very useful -- consider what would happen if two
>>different users hit the switchLanguage action at the same time.
>>
>>If you need to solve the more general problem, where you don't know in
>>your SwitchLanguage action where to return, it gets rather harder. See
>>my post earlier today on this topic for some suggestions for that problem.
>>
>>L.
>>
>>Thomas Hamacher wrote:
>>
>>>Okay - here are some more details:
>>>
>>>Let's say I have the following URL: http://somehost/showEntry?entryID=343
>>>I have multilanguage support in my application, so let´s assume, that I
>>>click on the language-button and therefor call the page
>>>/switchLanguage.do, which changes my Locale. The switchLanguage uses the
>>>last ActionForward to link back to the refering page (showEntry). But the
>>>problem is, that it doesn't have the param "entryID" anymore. So the page
>>>shows an empty page. As I don't want to add this parameter in my
>>>session-, but in the request scope I have to remember this param somehow.
>>>So I thought if there might be a way to save this to the ActionForward,
>>>because there is no request.setParameter()-Method anywhere. And I have
>>>been told that the reques.getHeader("referer")-solution is pretty unsafe,
>>>because of proxies and firewalls. So I wonder what would be the best way,
>>>as I think refering back to one page and mulit-language-support should be
>>>one of the standard-issues on modern webapplication.
>>>
>>>I hope that helps a little..
>>>
>>>Thanks
>>>Thomas
>>>
>>>On Thursday 10 November 2005 22:31, Laurie Harper wrote:
>>>
>>>>Thomas Hamacher wrote:
>>>>
>>>>>But anyways: does anybody know, if the parameters, given through paramId
>>>>>are saved in an ActionForward? This would help me a lot, because I have
>>>>>to remember the parameters - if any are used - together with my
>>>>>ActionForward for later references. Right know I'm trying a workaround
>>>>>with my own RequestProcessor, which tries to cut out the parameters and
>>>>>save it somewhere and add it later to the ActionForward, but that
>>>>>doesn't work that well.
>>>>
>>>>I'm not quite sure what you're trying to do. The parameters you specify
>>>>through paramId are request parameters to include in the URL. They're
>>>>available in your action through your form bean or from
>>>>request.getParameter().
>>>>
>>>>An ActionForward is what your action returns to tell Struts where to
>>>>forward control to after the request has been processed. So the
>>>>parameters you setup when you construct the URL don't have anything to
>>>>do it.
>>>>
>>>>Perhaps you can explain what you are trying to achieve by saving the
>>>>parameters?
>>>>
>>>>L.
>>>>
>>>>
>>>>---------------------------------------------------------------------
>>>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>>For additional commands, e-mail: user-help@struts.apache.org
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>For additional commands, e-mail: user-help@struts.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: html:rewrite with params
Posted by Thomas Hamacher <th...@qualiads.de>.
Laurie,
thank you so for. This makes sense to me.
But the problem is, that I don´t really have a source-url, as it is used in
the examples. I´m using tiles and therefor I have to work with definitions. I
guess, I cannot add any definition as a source, can I?
Actually I always want to return to the same page, together with any used
params and all information of the form-bean, but with a different Locale.
That´s it. But this doesn´t seems to be that trivial, altough I thought this
would be a standard-problem...
Thomas
On Wednesday 16 November 2005 22:56, Laurie Harper wrote:
> You don't need to save the parameter, you can just append it to the URL
> you forward to at the end of your SwitchLanguage action, assuming you
> know it should be there. RedirectAction in Struts 1.2.7 and up gives you
> a relatively easy way to add parameters to a forward mapping before you
> return it.
>
> There's no way to save the parameter on the action forward, since such a
> feature wouldn't be very useful -- consider what would happen if two
> different users hit the switchLanguage action at the same time.
>
> If you need to solve the more general problem, where you don't know in
> your SwitchLanguage action where to return, it gets rather harder. See
> my post earlier today on this topic for some suggestions for that problem.
>
> L.
>
> Thomas Hamacher wrote:
> > Okay - here are some more details:
> >
> > Let's say I have the following URL: http://somehost/showEntry?entryID=343
> > I have multilanguage support in my application, so let´s assume, that I
> > click on the language-button and therefor call the page
> > /switchLanguage.do, which changes my Locale. The switchLanguage uses the
> > last ActionForward to link back to the refering page (showEntry). But the
> > problem is, that it doesn't have the param "entryID" anymore. So the page
> > shows an empty page. As I don't want to add this parameter in my
> > session-, but in the request scope I have to remember this param somehow.
> > So I thought if there might be a way to save this to the ActionForward,
> > because there is no request.setParameter()-Method anywhere. And I have
> > been told that the reques.getHeader("referer")-solution is pretty unsafe,
> > because of proxies and firewalls. So I wonder what would be the best way,
> > as I think refering back to one page and mulit-language-support should be
> > one of the standard-issues on modern webapplication.
> >
> > I hope that helps a little..
> >
> > Thanks
> > Thomas
> >
> > On Thursday 10 November 2005 22:31, Laurie Harper wrote:
> >>Thomas Hamacher wrote:
> >>>But anyways: does anybody know, if the parameters, given through paramId
> >>>are saved in an ActionForward? This would help me a lot, because I have
> >>>to remember the parameters - if any are used - together with my
> >>>ActionForward for later references. Right know I'm trying a workaround
> >>>with my own RequestProcessor, which tries to cut out the parameters and
> >>>save it somewhere and add it later to the ActionForward, but that
> >>> doesn't work that well.
> >>
> >>I'm not quite sure what you're trying to do. The parameters you specify
> >>through paramId are request parameters to include in the URL. They're
> >>available in your action through your form bean or from
> >>request.getParameter().
> >>
> >>An ActionForward is what your action returns to tell Struts where to
> >>forward control to after the request has been processed. So the
> >>parameters you setup when you construct the URL don't have anything to
> >>do it.
> >>
> >>Perhaps you can explain what you are trying to achieve by saving the
> >>parameters?
> >>
> >>L.
> >>
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >>For additional commands, e-mail: user-help@struts.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: html:rewrite with params
Posted by Laurie Harper <la...@holoweb.net>.
Or perhaps for the new Cookbook?
Frank W. Zammetti wrote:
> I just wanted to point out the 3rd question on this page:
>
> http://husted.com/struts/FAQ/view-i18n.htm
>
> Laurie, your a committer now... this seems to me like a good inclusions
> for the Actions package. Any thoughts from anyone?
>
> Frank
>
> Laurie Harper wrote:
>
>> You don't need to save the parameter, you can just append it to the
>> URL you forward to at the end of your SwitchLanguage action, assuming
>> you know it should be there. RedirectAction in Struts 1.2.7 and up
>> gives you a relatively easy way to add parameters to a forward mapping
>> before you return it.
>>
>> There's no way to save the parameter on the action forward, since such
>> a feature wouldn't be very useful -- consider what would happen if two
>> different users hit the switchLanguage action at the same time.
>>
>> If you need to solve the more general problem, where you don't know in
>> your SwitchLanguage action where to return, it gets rather harder. See
>> my post earlier today on this topic for some suggestions for that
>> problem.
>>
>> L.
>>
>> Thomas Hamacher wrote:
>>
>>> Okay - here are some more details:
>>>
>>> Let's say I have the following URL:
>>> http://somehost/showEntry?entryID=343
>>> I have multilanguage support in my application, so let´s assume, that
>>> I click on the language-button and therefor call the page
>>> /switchLanguage.do, which changes my Locale. The switchLanguage uses
>>> the last ActionForward to link back to the refering page (showEntry).
>>> But the problem is, that it doesn't have the param "entryID" anymore.
>>> So the page shows an empty page. As I don't want to add this
>>> parameter in my session-, but in the request scope I have to remember
>>> this param somehow. So I thought if there might be a way to save this
>>> to the ActionForward, because there is no
>>> request.setParameter()-Method anywhere. And I have been told that the
>>> reques.getHeader("referer")-solution is pretty unsafe, because of
>>> proxies and firewalls. So I wonder what would be the best way, as I
>>> think refering back to one page and mulit-language-support should be
>>> one of the standard-issues on modern webapplication.
>>>
>>> I hope that helps a little..
>>>
>>> Thanks
>>> Thomas
>>>
>>> On Thursday 10 November 2005 22:31, Laurie Harper wrote:
>>>
>>>> Thomas Hamacher wrote:
>>>>
>>>>> But anyways: does anybody know, if the parameters, given through
>>>>> paramId
>>>>> are saved in an ActionForward? This would help me a lot, because I
>>>>> have
>>>>> to remember the parameters - if any are used - together with my
>>>>> ActionForward for later references. Right know I'm trying a workaround
>>>>> with my own RequestProcessor, which tries to cut out the parameters
>>>>> and
>>>>> save it somewhere and add it later to the ActionForward, but that
>>>>> doesn't
>>>>> work that well.
>>>>
>>>>
>>>>
>>>> I'm not quite sure what you're trying to do. The parameters you specify
>>>> through paramId are request parameters to include in the URL. They're
>>>> available in your action through your form bean or from
>>>> request.getParameter().
>>>>
>>>> An ActionForward is what your action returns to tell Struts where to
>>>> forward control to after the request has been processed. So the
>>>> parameters you setup when you construct the URL don't have anything to
>>>> do it.
>>>>
>>>> Perhaps you can explain what you are trying to achieve by saving the
>>>> parameters?
>>>>
>>>> L.
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>>
>>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: html:rewrite with params
Posted by Laurie Harper <la...@holoweb.net>.
Hey, nice, I wasn't aware of that either :-)
Frank W. Zammetti wrote:
> Sorry, my bad... I wasn't aware of the LocaleAction. Apparently my
> suggestion was a good one, just late :)
>
> Frank
>
> Frank W. Zammetti wrote:
>
>> I just wanted to point out the 3rd question on this page:
>>
>> http://husted.com/struts/FAQ/view-i18n.htm
>>
>> Laurie, your a committer now... this seems to me like a good
>> inclusions for the Actions package. Any thoughts from anyone?
>>
>> Frank
>>
>> Laurie Harper wrote:
>>
>>> You don't need to save the parameter, you can just append it to the
>>> URL you forward to at the end of your SwitchLanguage action, assuming
>>> you know it should be there. RedirectAction in Struts 1.2.7 and up
>>> gives you a relatively easy way to add parameters to a forward
>>> mapping before you return it.
>>>
>>> There's no way to save the parameter on the action forward, since
>>> such a feature wouldn't be very useful -- consider what would happen
>>> if two different users hit the switchLanguage action at the same time.
>>>
>>> If you need to solve the more general problem, where you don't know
>>> in your SwitchLanguage action where to return, it gets rather harder.
>>> See my post earlier today on this topic for some suggestions for that
>>> problem.
>>>
>>> L.
>>>
>>> Thomas Hamacher wrote:
>>>
>>>> Okay - here are some more details:
>>>>
>>>> Let's say I have the following URL:
>>>> http://somehost/showEntry?entryID=343
>>>> I have multilanguage support in my application, so let´s assume,
>>>> that I click on the language-button and therefor call the page
>>>> /switchLanguage.do, which changes my Locale. The switchLanguage uses
>>>> the last ActionForward to link back to the refering page
>>>> (showEntry). But the problem is, that it doesn't have the param
>>>> "entryID" anymore. So the page shows an empty page. As I don't want
>>>> to add this parameter in my session-, but in the request scope I
>>>> have to remember this param somehow. So I thought if there might be
>>>> a way to save this to the ActionForward, because there is no
>>>> request.setParameter()-Method anywhere. And I have been told that
>>>> the reques.getHeader("referer")-solution is pretty unsafe, because
>>>> of proxies and firewalls. So I wonder what would be the best way, as
>>>> I think refering back to one page and mulit-language-support should
>>>> be one of the standard-issues on modern webapplication.
>>>>
>>>> I hope that helps a little..
>>>>
>>>> Thanks
>>>> Thomas
>>>>
>>>> On Thursday 10 November 2005 22:31, Laurie Harper wrote:
>>>>
>>>>> Thomas Hamacher wrote:
>>>>>
>>>>>> But anyways: does anybody know, if the parameters, given through
>>>>>> paramId
>>>>>> are saved in an ActionForward? This would help me a lot, because I
>>>>>> have
>>>>>> to remember the parameters - if any are used - together with my
>>>>>> ActionForward for later references. Right know I'm trying a
>>>>>> workaround
>>>>>> with my own RequestProcessor, which tries to cut out the
>>>>>> parameters and
>>>>>> save it somewhere and add it later to the ActionForward, but that
>>>>>> doesn't
>>>>>> work that well.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> I'm not quite sure what you're trying to do. The parameters you
>>>>> specify
>>>>> through paramId are request parameters to include in the URL. They're
>>>>> available in your action through your form bean or from
>>>>> request.getParameter().
>>>>>
>>>>> An ActionForward is what your action returns to tell Struts where to
>>>>> forward control to after the request has been processed. So the
>>>>> parameters you setup when you construct the URL don't have anything to
>>>>> do it.
>>>>>
>>>>> Perhaps you can explain what you are trying to achieve by saving the
>>>>> parameters?
>>>>>
>>>>> L.
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>>
>>>
>>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: html:rewrite with params
Posted by "Frank W. Zammetti" <fz...@omnytex.com>.
Sorry, my bad... I wasn't aware of the LocaleAction. Apparently my
suggestion was a good one, just late :)
Frank
Frank W. Zammetti wrote:
> I just wanted to point out the 3rd question on this page:
>
> http://husted.com/struts/FAQ/view-i18n.htm
>
> Laurie, your a committer now... this seems to me like a good inclusions
> for the Actions package. Any thoughts from anyone?
>
> Frank
>
> Laurie Harper wrote:
>
>> You don't need to save the parameter, you can just append it to the
>> URL you forward to at the end of your SwitchLanguage action, assuming
>> you know it should be there. RedirectAction in Struts 1.2.7 and up
>> gives you a relatively easy way to add parameters to a forward mapping
>> before you return it.
>>
>> There's no way to save the parameter on the action forward, since such
>> a feature wouldn't be very useful -- consider what would happen if two
>> different users hit the switchLanguage action at the same time.
>>
>> If you need to solve the more general problem, where you don't know in
>> your SwitchLanguage action where to return, it gets rather harder. See
>> my post earlier today on this topic for some suggestions for that
>> problem.
>>
>> L.
>>
>> Thomas Hamacher wrote:
>>
>>> Okay - here are some more details:
>>>
>>> Let's say I have the following URL:
>>> http://somehost/showEntry?entryID=343
>>> I have multilanguage support in my application, so let´s assume, that
>>> I click on the language-button and therefor call the page
>>> /switchLanguage.do, which changes my Locale. The switchLanguage uses
>>> the last ActionForward to link back to the refering page (showEntry).
>>> But the problem is, that it doesn't have the param "entryID" anymore.
>>> So the page shows an empty page. As I don't want to add this
>>> parameter in my session-, but in the request scope I have to remember
>>> this param somehow. So I thought if there might be a way to save this
>>> to the ActionForward, because there is no
>>> request.setParameter()-Method anywhere. And I have been told that the
>>> reques.getHeader("referer")-solution is pretty unsafe, because of
>>> proxies and firewalls. So I wonder what would be the best way, as I
>>> think refering back to one page and mulit-language-support should be
>>> one of the standard-issues on modern webapplication.
>>>
>>> I hope that helps a little..
>>>
>>> Thanks
>>> Thomas
>>>
>>> On Thursday 10 November 2005 22:31, Laurie Harper wrote:
>>>
>>>> Thomas Hamacher wrote:
>>>>
>>>>> But anyways: does anybody know, if the parameters, given through
>>>>> paramId
>>>>> are saved in an ActionForward? This would help me a lot, because I
>>>>> have
>>>>> to remember the parameters - if any are used - together with my
>>>>> ActionForward for later references. Right know I'm trying a workaround
>>>>> with my own RequestProcessor, which tries to cut out the parameters
>>>>> and
>>>>> save it somewhere and add it later to the ActionForward, but that
>>>>> doesn't
>>>>> work that well.
>>>>
>>>>
>>>>
>>>> I'm not quite sure what you're trying to do. The parameters you specify
>>>> through paramId are request parameters to include in the URL. They're
>>>> available in your action through your form bean or from
>>>> request.getParameter().
>>>>
>>>> An ActionForward is what your action returns to tell Struts where to
>>>> forward control to after the request has been processed. So the
>>>> parameters you setup when you construct the URL don't have anything to
>>>> do it.
>>>>
>>>> Perhaps you can explain what you are trying to achieve by saving the
>>>> parameters?
>>>>
>>>> L.
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>>
>>
>
--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: fzammetti@hotmail.com
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: html:rewrite with params
Posted by "Frank W. Zammetti" <fz...@omnytex.com>.
I just wanted to point out the 3rd question on this page:
http://husted.com/struts/FAQ/view-i18n.htm
Laurie, your a committer now... this seems to me like a good inclusions
for the Actions package. Any thoughts from anyone?
Frank
Laurie Harper wrote:
> You don't need to save the parameter, you can just append it to the URL
> you forward to at the end of your SwitchLanguage action, assuming you
> know it should be there. RedirectAction in Struts 1.2.7 and up gives you
> a relatively easy way to add parameters to a forward mapping before you
> return it.
>
> There's no way to save the parameter on the action forward, since such a
> feature wouldn't be very useful -- consider what would happen if two
> different users hit the switchLanguage action at the same time.
>
> If you need to solve the more general problem, where you don't know in
> your SwitchLanguage action where to return, it gets rather harder. See
> my post earlier today on this topic for some suggestions for that problem.
>
> L.
>
> Thomas Hamacher wrote:
>
>> Okay - here are some more details:
>>
>> Let's say I have the following URL: http://somehost/showEntry?entryID=343
>> I have multilanguage support in my application, so let´s assume, that
>> I click on the language-button and therefor call the page
>> /switchLanguage.do, which changes my Locale. The switchLanguage uses
>> the last ActionForward to link back to the refering page (showEntry).
>> But the problem is, that it doesn't have the param "entryID" anymore.
>> So the page shows an empty page. As I don't want to add this parameter
>> in my session-, but in the request scope I have to remember this param
>> somehow. So I thought if there might be a way to save this to the
>> ActionForward, because there is no request.setParameter()-Method
>> anywhere. And I have been told that the
>> reques.getHeader("referer")-solution is pretty unsafe, because of
>> proxies and firewalls. So I wonder what would be the best way, as I
>> think refering back to one page and mulit-language-support should be
>> one of the standard-issues on modern webapplication.
>>
>> I hope that helps a little..
>>
>> Thanks
>> Thomas
>>
>> On Thursday 10 November 2005 22:31, Laurie Harper wrote:
>>
>>> Thomas Hamacher wrote:
>>>
>>>> But anyways: does anybody know, if the parameters, given through
>>>> paramId
>>>> are saved in an ActionForward? This would help me a lot, because I have
>>>> to remember the parameters - if any are used - together with my
>>>> ActionForward for later references. Right know I'm trying a workaround
>>>> with my own RequestProcessor, which tries to cut out the parameters and
>>>> save it somewhere and add it later to the ActionForward, but that
>>>> doesn't
>>>> work that well.
>>>
>>>
>>> I'm not quite sure what you're trying to do. The parameters you specify
>>> through paramId are request parameters to include in the URL. They're
>>> available in your action through your form bean or from
>>> request.getParameter().
>>>
>>> An ActionForward is what your action returns to tell Struts where to
>>> forward control to after the request has been processed. So the
>>> parameters you setup when you construct the URL don't have anything to
>>> do it.
>>>
>>> Perhaps you can explain what you are trying to achieve by saving the
>>> parameters?
>>>
>>> L.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
>
--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: fzammetti@hotmail.com
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: html:rewrite with params
Posted by Laurie Harper <la...@holoweb.net>.
You don't need to save the parameter, you can just append it to the URL
you forward to at the end of your SwitchLanguage action, assuming you
know it should be there. RedirectAction in Struts 1.2.7 and up gives you
a relatively easy way to add parameters to a forward mapping before you
return it.
There's no way to save the parameter on the action forward, since such a
feature wouldn't be very useful -- consider what would happen if two
different users hit the switchLanguage action at the same time.
If you need to solve the more general problem, where you don't know in
your SwitchLanguage action where to return, it gets rather harder. See
my post earlier today on this topic for some suggestions for that problem.
L.
Thomas Hamacher wrote:
> Okay - here are some more details:
>
> Let's say I have the following URL: http://somehost/showEntry?entryID=343
> I have multilanguage support in my application, so let´s assume, that I click
> on the language-button and therefor call the page /switchLanguage.do, which
> changes my Locale. The switchLanguage uses the last ActionForward to link
> back to the refering page (showEntry). But the problem is, that it doesn't
> have the param "entryID" anymore. So the page shows an empty page. As I don't
> want to add this parameter in my session-, but in the request scope I have to
> remember this param somehow. So I thought if there might be a way to save
> this to the ActionForward, because there is no request.setParameter()-Method
> anywhere. And I have been told that the reques.getHeader("referer")-solution
> is pretty unsafe, because of proxies and firewalls. So I wonder what would be
> the best way, as I think refering back to one page and mulit-language-support
> should be one of the standard-issues on modern webapplication.
>
> I hope that helps a little..
>
> Thanks
> Thomas
>
> On Thursday 10 November 2005 22:31, Laurie Harper wrote:
>
>>Thomas Hamacher wrote:
>>
>>>But anyways: does anybody know, if the parameters, given through paramId
>>>are saved in an ActionForward? This would help me a lot, because I have
>>>to remember the parameters - if any are used - together with my
>>>ActionForward for later references. Right know I'm trying a workaround
>>>with my own RequestProcessor, which tries to cut out the parameters and
>>>save it somewhere and add it later to the ActionForward, but that doesn't
>>>work that well.
>>
>>I'm not quite sure what you're trying to do. The parameters you specify
>>through paramId are request parameters to include in the URL. They're
>>available in your action through your form bean or from
>>request.getParameter().
>>
>>An ActionForward is what your action returns to tell Struts where to
>>forward control to after the request has been processed. So the
>>parameters you setup when you construct the URL don't have anything to
>>do it.
>>
>>Perhaps you can explain what you are trying to achieve by saving the
>>parameters?
>>
>>L.
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>For additional commands, e-mail: user-help@struts.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: html:rewrite with params
Posted by Martin Gainty <mg...@hotmail.com>.
Thomas-
Taking a clue from http://husted.com/struts/tips/011.html
since you know the value of entryID from Querystring
can your form populate a html:hidden value with entryID value
and then reference that value later?
Viel Gluck,
Martin-
----- Original Message -----
From: "Thomas Hamacher" <th...@qualiads.de>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Monday, November 14, 2005 4:36 AM
Subject: Re: html:rewrite with params
Okay - here are some more details:
Let's say I have the following URL: http://somehost/showEntry?entryID=343
I have multilanguage support in my application, so let´s assume, that I
click
on the language-button and therefor call the page /switchLanguage.do, which
changes my Locale. The switchLanguage uses the last ActionForward to link
back to the refering page (showEntry). But the problem is, that it doesn't
have the param "entryID" anymore. So the page shows an empty page. As I
don't
want to add this parameter in my session-, but in the request scope I have
to
remember this param somehow. So I thought if there might be a way to save
this to the ActionForward, because there is no request.setParameter()-Method
anywhere. And I have been told that the reques.getHeader("referer")-solution
is pretty unsafe, because of proxies and firewalls. So I wonder what would
be
the best way, as I think refering back to one page and
mulit-language-support
should be one of the standard-issues on modern webapplication.
I hope that helps a little..
Thanks
Thomas
On Thursday 10 November 2005 22:31, Laurie Harper wrote:
> Thomas Hamacher wrote:
> > But anyways: does anybody know, if the parameters, given through paramId
> > are saved in an ActionForward? This would help me a lot, because I have
> > to remember the parameters - if any are used - together with my
> > ActionForward for later references. Right know I'm trying a workaround
> > with my own RequestProcessor, which tries to cut out the parameters and
> > save it somewhere and add it later to the ActionForward, but that
> > doesn't
> > work that well.
>
> I'm not quite sure what you're trying to do. The parameters you specify
> through paramId are request parameters to include in the URL. They're
> available in your action through your form bean or from
> request.getParameter().
>
> An ActionForward is what your action returns to tell Struts where to
> forward control to after the request has been processed. So the
> parameters you setup when you construct the URL don't have anything to
> do it.
>
> Perhaps you can explain what you are trying to achieve by saving the
> parameters?
>
> L.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: html:rewrite with params
Posted by Thomas Hamacher <th...@qualiads.de>.
Okay - here are some more details:
Let's say I have the following URL: http://somehost/showEntry?entryID=343
I have multilanguage support in my application, so let´s assume, that I click
on the language-button and therefor call the page /switchLanguage.do, which
changes my Locale. The switchLanguage uses the last ActionForward to link
back to the refering page (showEntry). But the problem is, that it doesn't
have the param "entryID" anymore. So the page shows an empty page. As I don't
want to add this parameter in my session-, but in the request scope I have to
remember this param somehow. So I thought if there might be a way to save
this to the ActionForward, because there is no request.setParameter()-Method
anywhere. And I have been told that the reques.getHeader("referer")-solution
is pretty unsafe, because of proxies and firewalls. So I wonder what would be
the best way, as I think refering back to one page and mulit-language-support
should be one of the standard-issues on modern webapplication.
I hope that helps a little..
Thanks
Thomas
On Thursday 10 November 2005 22:31, Laurie Harper wrote:
> Thomas Hamacher wrote:
> > But anyways: does anybody know, if the parameters, given through paramId
> > are saved in an ActionForward? This would help me a lot, because I have
> > to remember the parameters - if any are used - together with my
> > ActionForward for later references. Right know I'm trying a workaround
> > with my own RequestProcessor, which tries to cut out the parameters and
> > save it somewhere and add it later to the ActionForward, but that doesn't
> > work that well.
>
> I'm not quite sure what you're trying to do. The parameters you specify
> through paramId are request parameters to include in the URL. They're
> available in your action through your form bean or from
> request.getParameter().
>
> An ActionForward is what your action returns to tell Struts where to
> forward control to after the request has been processed. So the
> parameters you setup when you construct the URL don't have anything to
> do it.
>
> Perhaps you can explain what you are trying to achieve by saving the
> parameters?
>
> L.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: html:rewrite with params (solved)
Posted by Laurie Harper <la...@holoweb.net>.
Thomas Hamacher wrote:
> But anyways: does anybody know, if the parameters, given through paramId are
> saved in an ActionForward? This would help me a lot, because I have to
> remember the parameters - if any are used - together with my ActionForward
> for later references. Right know I'm trying a workaround with my own
> RequestProcessor, which tries to cut out the parameters and save it somewhere
> and add it later to the ActionForward, but that doesn't work that well.
I'm not quite sure what you're trying to do. The parameters you specify
through paramId are request parameters to include in the URL. They're
available in your action through your form bean or from
request.getParameter().
An ActionForward is what your action returns to tell Struts where to
forward control to after the request has been processed. So the
parameters you setup when you construct the URL don't have anything to
do it.
Perhaps you can explain what you are trying to achieve by saving the
parameters?
L.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: html:rewrite with params (solved)
Posted by Thomas Hamacher <th...@qualiads.de>.
Sorry,
I asked my question to quickly..
I found a solution myself now. Solved it as followed - if anyone might need
it:
<bean:define id="keyword" value="date" /><html:rewrite action="/popup/faq"
paramId="txt" paramName="keyword" />
But anyways: does anybody know, if the parameters, given through paramId are
saved in an ActionForward? This would help me a lot, because I have to
remember the parameters - if any are used - together with my ActionForward
for later references. Right know I'm trying a workaround with my own
RequestProcessor, which tries to cut out the parameters and save it somewhere
and add it later to the ActionForward, but that doesn't work that well.
Thanks
Thomas
On Thursday 10 November 2005 12:13, Thomas Hamacher wrote:
> Hi,
>
> just a quick question:
>
> I want to replace the following:
>
> javascript:newWindow('popup-faq.jsp?txt=date','350', '500')
>
> with the html:rewrite. So I added an entry into my struts-config and my
> tiles-def and changed it to:
>
> javascript:newWindow('<html:rewrite action="/popup/faq" />?txt=date','350',
> '500')
>
> Now a want to add the param dynamically as well. As I do not use forms in
> here, because I have multiple calls of the newWindow-function with
> different parameters I would like to add it manually. For example use the
> paramId attribute (e.g. paramId="txt") and add the value myself (e.g.
> value="date") and not through a formbean. Is this possible somehow? If not,
> what would be a good solution to solve this problem? I can stay with my
> current-solution so far, but I wonder if the ActionForward somehow saves
> the parameters in it's object, what I would need in my application. Does
> anyone have informations on this issue?
>
> Thanks so far
>
> Thomas
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org