RE: Dynamic Forwards Offsite

2003-02-20 Thread Jerome Jacobsen
The javadoc for ActionForward state you can use an absolute URI for the path
parameter.  I've never tried it though.

 -Original Message-
 From: Micael [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, February 20, 2003 3:47 PM
 To: [EMAIL PROTECTED]
 Subject: Dynamic Forwards Offsite


 How does one do a dynamic forward offsite, e.g.
 http://www.somewhere.com/index.htm;, within the context of the struts
 framework?  This does not work with ActionForward, apparently,
 because the
 forwards there have a context of the application root in the
 container.  I
 know how to do these with html, of course.  I know, for example,
 how to use
 an action forward to a jsp page which will then forward to another
 website.  I need to know, if possible, how to do this within the struts
 framework.

 Also, if we get by that aspect, the address to forward to must be
 dynamic.  Thanks for any assistance.

 I have tried four books and the struts user archives without
 being able to
 find the answer to this.

 Thanks.


 LEGAL NOTICE

 This electronic mail  transmission and any accompanying documents contain
 information belonging to the sender which may be confidential and legally
 privileged.  This information is intended only for the use of the
 individual or entity to whom this electronic mail transmission
 was sent as
 indicated above. If you are not the intended recipient, any disclosure,
 copying, distribution, or action taken in reliance on the contents of the
 information contained in this transmission is strictly
 prohibited.  If you
 have received this transmission in error, please delete the
 message.  Thank you



 -
 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]




RE: Dynamic Forwards Offsite

2003-02-20 Thread Micael
Thanks for responding, however, I try the following:


StringBuffer sb = new StringBuffer();
sb.append(http://www.somewhere.com/message;);
ActionForward forward = new ActionForward(sb.toString(), false);
return forward;

or:
StringBuffer sb = new StringBuffer();
sb.append(http://www.somewhere.com/message;);
ActionForward forward = new ActionForward(sb.toString(), true);
return forward;

and I get:


type Status report

message /application/http://www.somewhere.com/message

description The requested resource 
(/application/http://www.somewhere.com/message) is not available.

com

At 04:08 PM 2/20/03 -0500, you wrote:
The javadoc for ActionForward state you can use an absolute URI for the path
parameter.  I've never tried it though.

 -Original Message-
 From: Micael [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, February 20, 2003 3:47 PM
 To: [EMAIL PROTECTED]
 Subject: Dynamic Forwards Offsite


 How does one do a dynamic forward offsite, e.g.
 http://www.somewhere.com/index.htm;, within the context of the struts
 framework?  This does not work with ActionForward, apparently,
 because the
 forwards there have a context of the application root in the
 container.  I
 know how to do these with html, of course.  I know, for example,
 how to use
 an action forward to a jsp page which will then forward to another
 website.  I need to know, if possible, how to do this within the struts
 framework.

 Also, if we get by that aspect, the address to forward to must be
 dynamic.  Thanks for any assistance.

 I have tried four books and the struts user archives without
 being able to
 find the answer to this.

 Thanks.


 LEGAL NOTICE

 This electronic mail  transmission and any accompanying documents contain
 information belonging to the sender which may be confidential and legally
 privileged.  This information is intended only for the use of the
 individual or entity to whom this electronic mail transmission
 was sent as
 indicated above. If you are not the intended recipient, any disclosure,
 copying, distribution, or action taken in reliance on the contents of the
 information contained in this transmission is strictly
 prohibited.  If you
 have received this transmission in error, please delete the
 message.  Thank you



 -
 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]




LEGAL NOTICE

This electronic mail  transmission and any accompanying documents contain 
information belonging to the sender which may be confidential and legally 
privileged.  This information is intended only for the use of the 
individual or entity to whom this electronic mail transmission was sent as 
indicated above. If you are not the intended recipient, any disclosure, 
copying, distribution, or action taken in reliance on the contents of the 
information contained in this transmission is strictly prohibited.  If you 
have received this transmission in error, please delete the message.  Thank 
you  



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



RE: Dynamic Forwards Offsite

2003-02-20 Thread David Bolsover
Micael

You might try this:
StringBuffer sb = new StringBuffer();
sb.append(http://www.somewhere.com/message;);
response.sendRedirect(sb.toString());
return null;

db


 -Original Message-
 From: Micael [mailto:[EMAIL PROTECTED]]
 Sent: 20 February 2003 21:30
 To: Struts Users Mailing List
 Subject: RE: Dynamic Forwards Offsite
 
 
 Thanks for responding, however, I try the following:
 
 
  StringBuffer sb = new StringBuffer();
  sb.append(http://www.somewhere.com/message;);
  ActionForward forward = new ActionForward(sb.toString(), false);
  return forward;
 
 or:
  StringBuffer sb = new StringBuffer();
  sb.append(http://www.somewhere.com/message;);
  ActionForward forward = new ActionForward(sb.toString(), true);
  return forward;
 
 and I get:
 
 
 type Status report
 
 message /application/http://www.somewhere.com/message
 
 description The requested resource 
 (/application/http://www.somewhere.com/message) is not available.
 
 com
 
 At 04:08 PM 2/20/03 -0500, you wrote:
 The javadoc for ActionForward state you can use an absolute URI for the path
 parameter.  I've never tried it though.
 
   -Original Message-
   From: Micael [mailto:[EMAIL PROTECTED]]
   Sent: Thursday, February 20, 2003 3:47 PM
   To: [EMAIL PROTECTED]
   Subject: Dynamic Forwards Offsite
  
  
   How does one do a dynamic forward offsite, e.g.
   http://www.somewhere.com/index.htm;, within the context of the struts
   framework?  This does not work with ActionForward, apparently,
   because the
   forwards there have a context of the application root in the
   container.  I
   know how to do these with html, of course.  I know, for example,
   how to use
   an action forward to a jsp page which will then forward to another
   website.  I need to know, if possible, how to do this within the struts
   framework.
  
   Also, if we get by that aspect, the address to forward to must be
   dynamic.  Thanks for any assistance.
  
   I have tried four books and the struts user archives without
   being able to
   find the answer to this.
  
   Thanks.
  
  
   LEGAL NOTICE
  
   This electronic mail  transmission and any accompanying documents contain
   information belonging to the sender which may be confidential and legally
   privileged.  This information is intended only for the use of the
   individual or entity to whom this electronic mail transmission
   was sent as
   indicated above. If you are not the intended recipient, any disclosure,
   copying, distribution, or action taken in reliance on the contents of the
   information contained in this transmission is strictly
   prohibited.  If you
   have received this transmission in error, please delete the
   message.  Thank you
  
  
  
   -
   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]
 
 
 
 LEGAL NOTICE
 
 This electronic mail  transmission and any accompanying documents contain 
 information belonging to the sender which may be confidential and legally 
 privileged.  This information is intended only for the use of the 
 individual or entity to whom this electronic mail transmission was sent as 
 indicated above. If you are not the intended recipient, any disclosure, 
 copying, distribution, or action taken in reliance on the contents of the 
 information contained in this transmission is strictly prohibited.  If you 
 have received this transmission in error, please delete the message.  Thank 
 you  
 
 
 
 -
 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]




RE: Dynamic Forwards Offsite

2003-02-20 Thread Micael
Thanks, David.  You the man!  LOL.

At 09:34 PM 2/20/03 +, you wrote:

Micael

You might try this:
StringBuffer sb = new StringBuffer();
sb.append(http://www.somewhere.com/message;);
response.sendRedirect(sb.toString());
return null;

db


 -Original Message-
 From: Micael [mailto:[EMAIL PROTECTED]]
 Sent: 20 February 2003 21:30
 To: Struts Users Mailing List
 Subject: RE: Dynamic Forwards Offsite


 Thanks for responding, however, I try the following:


  StringBuffer sb = new StringBuffer();
  sb.append(http://www.somewhere.com/message;);
  ActionForward forward = new ActionForward(sb.toString(), false);
  return forward;

 or:
  StringBuffer sb = new StringBuffer();
  sb.append(http://www.somewhere.com/message;);
  ActionForward forward = new ActionForward(sb.toString(), true);
  return forward;

 and I get:


 type Status report

 message /application/http://www.somewhere.com/message

 description The requested resource
 (/application/http://www.somewhere.com/message) is not available.

 com

 At 04:08 PM 2/20/03 -0500, you wrote:
 The javadoc for ActionForward state you can use an absolute URI for 
the path
 parameter.  I've never tried it though.
 
   -Original Message-
   From: Micael [mailto:[EMAIL PROTECTED]]
   Sent: Thursday, February 20, 2003 3:47 PM
   To: [EMAIL PROTECTED]
   Subject: Dynamic Forwards Offsite
  
  
   How does one do a dynamic forward offsite, e.g.
   http://www.somewhere.com/index.htm;, within the context of the struts
   framework?  This does not work with ActionForward, apparently,
   because the
   forwards there have a context of the application root in the
   container.  I
   know how to do these with html, of course.  I know, for example,
   how to use
   an action forward to a jsp page which will then forward to another
   website.  I need to know, if possible, how to do this within the struts
   framework.
  
   Also, if we get by that aspect, the address to forward to must be
   dynamic.  Thanks for any assistance.
  
   I have tried four books and the struts user archives without
   being able to
   find the answer to this.
  
   Thanks.
  
  
   LEGAL NOTICE
  
   This electronic mail  transmission and any accompanying documents 
contain
   information belonging to the sender which may be confidential and 
legally
   privileged.  This information is intended only for the use of the
   individual or entity to whom this electronic mail transmission
   was sent as
   indicated above. If you are not the intended recipient, any disclosure,
   copying, distribution, or action taken in reliance on the contents 
of the
   information contained in this transmission is strictly
   prohibited.  If you
   have received this transmission in error, please delete the
   message.  Thank you
  
  
  
   -
   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]



 LEGAL NOTICE

 This electronic mail  transmission and any accompanying documents contain
 information belonging to the sender which may be confidential and legally
 privileged.  This information is intended only for the use of the
 individual or entity to whom this electronic mail transmission was sent as
 indicated above. If you are not the intended recipient, any disclosure,
 copying, distribution, or action taken in reliance on the contents of the
 information contained in this transmission is strictly prohibited.  If you
 have received this transmission in error, please delete the 
message.  Thank
 you



 -
 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]



LEGAL NOTICE

This electronic mail  transmission and any accompanying documents contain 
information belonging to the sender which may be confidential and legally 
privileged.  This information is intended only for the use of the 
individual or entity to whom this electronic mail transmission was sent as 
indicated above. If you are not the intended recipient, any disclosure, 
copying, distribution, or action taken in reliance on the contents of the 
information contained in this transmission is strictly prohibited.  If you 
have received this transmission in error, please delete the message.  Thank 
you  



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



Re: dynamic forwards

2001-09-27 Thread Gregor Rayman

lisa ward [EMAIL PROTECTED]

 Hi again,

 The values in your hash map have been hardcoded in, which works fine.  But
 what do I if I do not know what the user's selection will be in advance.
 Take for instance, if I have a set of checkboxes on my page, I would like
to
 be able to initialize the map with the values that the user has selected.
 Or am I just missing the point here?

Hold on. You have to have all necessary information, when you are generating
the link. It does not matter, whether the keys in the map are hardcoded or
determined during the runtime. Important is that you are creating the link
on the server side, before the user clicks on any checkboxes.

If you want to use user's input, you can do it when serving the next page.
You can then generate the map in an Action and generate the link for the
next displayed page (so you will know all paramaters in advance, since
the checkboxes have been submitted already)

Or your Action can use the checkboxes to determine what to do or to
determine where to forward to. You don't need to use constant strings
in findForward.

Another possibility would be using JavaScript on the client, but since
many browsers have JavaScript disabled, you should not rely on it.

--
gR


 Please explain further and thank you very much for your patience.

 Thanks
 Lisa





 From: Gregor Rayman [EMAIL PROTECTED]
 Reply-To: [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 CC: lisa ward [EMAIL PROTECTED]
 Subject: Re: dynamic forwards
 Date: Wed, 26 Sep 2001 20:55:34 +0200
 
 lisa ward [EMAIL PROTECTED] wrote:
 
   Another quick question.  How would I be able to initialize the
hashMap.
 the
   problem Im facing is that when I use a forward the submit is not
called
 so
   the values are not initialized in my bean.
 
 Here an quick and dirty example. (Dirty beacuse it uses scriplte. Custom
 tag
 would be somehow more apprpriate.)
 
 %
HashMap linkParams = new HashMap(); // create the map
linkParams.put(areaId, a); // set the values
linkParams.put(aspectId, b);
pageContext.setAttribute(linkParams, linkParams); // make the map an
 attribute of page
 %
 
 html:link page=/deleteaspect.do name=linkParams
bean:message key=button.delete/
 /html:link
 
 The generated URL will be: .../deleteaspect.do?areaId=aaspectId=b
 
 The map does not have to be the attribute itself. It can be a property of
 an
 attribute. Then the html:link tag would look like this:
 
 html:link page=/deleteaspect.do name=linkAttribute
 property=propertyName
 
 --
 gR
 
 
 
 


 _
 Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp





Re: dynamic forwards

2001-09-27 Thread lisa ward


In your message you said:

so you will know all paramaters in advance, since the checkboxes have been 
submitted already.

But since Im using a html:link (forward) instead of a submit, at which point 
do I initialize the selected checkbox values in my hash map.

Thanks
Lisa

From: Gregor Rayman [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: dynamic forwards
Date: Thu, 27 Sep 2001 09:27:10 +0200

lisa ward [EMAIL PROTECTED]

  Hi again,
 
  The values in your hash map have been hardcoded in, which works fine.  
But
  what do I if I do not know what the user's selection will be in advance.
  Take for instance, if I have a set of checkboxes on my page, I would 
like
to
  be able to initialize the map with the values that the user has 
selected.
  Or am I just missing the point here?

Hold on. You have to have all necessary information, when you are 
generating
the link. It does not matter, whether the keys in the map are hardcoded or
determined during the runtime. Important is that you are creating the link
on the server side, before the user clicks on any checkboxes.

If you want to use user's input, you can do it when serving the next page.
You can then generate the map in an Action and generate the link for the
next displayed page (so you will know all paramaters in advance, since
the checkboxes have been submitted already)

Or your Action can use the checkboxes to determine what to do or to
determine where to forward to. You don't need to use constant strings
in findForward.

Another possibility would be using JavaScript on the client, but since
many browsers have JavaScript disabled, you should not rely on it.

--
gR

 
  Please explain further and thank you very much for your patience.
 
  Thanks
  Lisa



 
 
  From: Gregor Rayman [EMAIL PROTECTED]
  Reply-To: [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  CC: lisa ward [EMAIL PROTECTED]
  Subject: Re: dynamic forwards
  Date: Wed, 26 Sep 2001 20:55:34 +0200
  
  lisa ward [EMAIL PROTECTED] wrote:
  
Another quick question.  How would I be able to initialize the
hashMap.
  the
problem Im facing is that when I use a forward the submit is not
called
  so
the values are not initialized in my bean.
  
  Here an quick and dirty example. (Dirty beacuse it uses scriplte. 
Custom
  tag
  would be somehow more apprpriate.)
  
  %
 HashMap linkParams = new HashMap(); // create the map
 linkParams.put(areaId, a); // set the values
 linkParams.put(aspectId, b);
 pageContext.setAttribute(linkParams, linkParams); // make the map 
an
  attribute of page
  %
  
  html:link page=/deleteaspect.do name=linkParams
 bean:message key=button.delete/
  /html:link
  
  The generated URL will be: .../deleteaspect.do?areaId=aaspectId=b
  
  The map does not have to be the attribute itself. It can be a property 
of
  an
  attribute. Then the html:link tag would look like this:
  
  html:link page=/deleteaspect.do name=linkAttribute
  property=propertyName
  
  --
  gR
  
  
  
  
 
 
  _
  Get your FREE download of MSN Explorer at 
http://explorer.msn.com/intl.asp
 



_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp




Re: dynamic forwards

2001-09-27 Thread Gregor Rayman

lisa ward [EMAIL PROTECTED] wrote:

 In your message you said:

 so you will know all paramaters in advance, since the checkboxes have been
 submitted already.

 But since Im using a html:link (forward) instead of a submit, at which point
 do I initialize the selected checkbox values in my hash map.

You cannot. What are you talking about is dynamics which happens in the
browser.
There you can use JavaScript to create dynamic link. When you want to use
standard HTML form way to send parameters to the server, you have to do it
with submit. You can use a href=javascript:forms[0].submit(); to make
link, which submits. (I am not sure, whether the syntax above is ok)

--
gR




Re: dynamic forwards

2001-09-27 Thread lisa ward

Thanks,

I will try this, who knows maybe I have barking up the wrong tree and just 
trying to be too smart.


From: Gregor Rayman [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: dynamic forwards
Date: Thu, 27 Sep 2001 12:29:44 +0200

lisa ward [EMAIL PROTECTED] wrote:

  In your message you said:
 
  so you will know all paramaters in advance, since the checkboxes have 
been
  submitted already.
 
  But since Im using a html:link (forward) instead of a submit, at which 
point
  do I initialize the selected checkbox values in my hash map.

You cannot. What are you talking about is dynamics which happens in the
browser.
There you can use JavaScript to create dynamic link. When you want to use
standard HTML form way to send parameters to the server, you have to do it
with submit. You can use a href=javascript:forms[0].submit(); to make
link, which submits. (I am not sure, whether the syntax above is ok)

--
gR



_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp




RE: dynamic forwards

2001-09-26 Thread Martin, Margaret

Lisa, 
I haven't tried it myself, but according to the doc for the html:link tag,
you can specify a bean that returns a map which specifies all of the
parameters... the contents of that bean clearly could change between
invocations, thus giving you dynamic parameters...

Hope this helps -
Margaret

-Original Message-
From: lisa ward [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 26, 2001 12:52 PM
To: [EMAIL PROTECTED]
Subject: dynamic forwards




Hi all,

I am having the exact same problem as Chiji, so I have just copied and 
pasted a bulk of his email (Sorry Chiji) .  Im literally pulling my hair out

over this one.  Chiji, if you have solved the problem let me know or point 
me in the right direction.

Thanks

Chiji's email reads:

-- start of Chiji's email--
Hi,

Im in a bit of dilema, I don't understand is what I should do if the 
parameters which are used by the html:link (forward) tag are generated on 
the fly.  I can't hard code all the forwards in my config file because I 
don't know how may parameters there will be in advance.  Since I don't know 
the amount parameters in advance I can't specify which form bean each of the

actions with, appended parameter values, should use.

This is what my problem looks like:

in config file:

forward name=search  path=/do/search /

action path=/search
   name=searchForm
   input=/seach.jsp
   scope=request /

in jsp file:

logic:iterate id=pageNumber name=pageList offset=0
html:link forward=search paramName=pageNumber paramId=pageNumber
 bean:write name=pageNumber /
/html:link
/logic:iterate
html:hidden property=pageNumber /

when I use:

html:link forward=search 

it works fine and think this is because of the mapping in the config file.

I would want the forward to 'search' (/do/search) as well as the forward to
'search' and it parameters (/do/search?pageNumber=1) to use the same form
bean.

I hope this makes sense.

-- end of Chiji's email--

Thanks
Lisa

_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp



Re: dynamic forwards

2001-09-26 Thread Gregor Rayman

Martin, Margaret [EMAIL PROTECTED] wrote:

I have tried it. It works. (at least the CVS version)

--
gR

 Lisa,
 I haven't tried it myself, but according to the doc for the html:link tag,
 you can specify a bean that returns a map which specifies all of the
 parameters... the contents of that bean clearly could change between
 invocations, thus giving you dynamic parameters...

 Hope this helps -
 Margaret

 -Original Message-
 From: lisa ward [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, September 26, 2001 12:52 PM
 To: [EMAIL PROTECTED]
 Subject: dynamic forwards




 Hi all,

 I am having the exact same problem as Chiji, so I have just copied and
 pasted a bulk of his email (Sorry Chiji) .  Im literally pulling my hair out

 over this one.  Chiji, if you have solved the problem let me know or point
 me in the right direction.

 Thanks

 Chiji's email reads:

 -- start of Chiji's email--
 Hi,

 Im in a bit of dilema, I don't understand is what I should do if the
 parameters which are used by the html:link (forward) tag are generated on
 the fly.  I can't hard code all the forwards in my config file because I
 don't know how may parameters there will be in advance.  Since I don't know
 the amount parameters in advance I can't specify which form bean each of the

 actions with, appended parameter values, should use.

 This is what my problem looks like:

 in config file:

 forward name=search  path=/do/search /

 action path=/search
name=searchForm
input=/seach.jsp
scope=request /

 in jsp file:

 logic:iterate id=pageNumber name=pageList offset=0
 html:link forward=search paramName=pageNumber paramId=pageNumber
  bean:write name=pageNumber /
 /html:link
 /logic:iterate
 html:hidden property=pageNumber /

 when I use:

 html:link forward=search 

 it works fine and think this is because of the mapping in the config file.

 I would want the forward to 'search' (/do/search) as well as the forward to
 'search' and it parameters (/do/search?pageNumber=1) to use the same form
 bean.

 I hope this makes sense.

 -- end of Chiji's email--

 Thanks
 Lisa

 _
 Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp





Re: dynamic forwards

2001-09-26 Thread Gregor Rayman

lisa ward [EMAIL PROTECTED] wrote:

 Another quick question.  How would I be able to initialize the hashMap.  the
 problem Im facing is that when I use a forward the submit is not called so
 the values are not initialized in my bean.

Here an quick and dirty example. (Dirty beacuse it uses scriplte. Custom tag
would be somehow more apprpriate.)

%
  HashMap linkParams = new HashMap(); // create the map
  linkParams.put(areaId, a); // set the values
  linkParams.put(aspectId, b);
  pageContext.setAttribute(linkParams, linkParams); // make the map an
attribute of page
%

html:link page=/deleteaspect.do name=linkParams
  bean:message key=button.delete/
/html:link

The generated URL will be: .../deleteaspect.do?areaId=aaspectId=b

The map does not have to be the attribute itself. It can be a property of an
attribute. Then the html:link tag would look like this:

html:link page=/deleteaspect.do name=linkAttribute
property=propertyName

--
gR







Re: dynamic forwards

2001-09-26 Thread lisa ward


Hi again,

The values in your hash map have been hardcoded in, which works fine.  But 
what do I if I do not know what the user's selection will be in advance.  
Take for instance, if I have a set of checkboxes on my page, I would like to 
be able to initialize the map with the values that the user has selected.  
Or am I just missing the point here?

Please explain further and thank you very much for your patience.

Thanks
Lisa


From: Gregor Rayman [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
CC: lisa ward [EMAIL PROTECTED]
Subject: Re: dynamic forwards
Date: Wed, 26 Sep 2001 20:55:34 +0200

lisa ward [EMAIL PROTECTED] wrote:

  Another quick question.  How would I be able to initialize the hashMap.  
the
  problem Im facing is that when I use a forward the submit is not called 
so
  the values are not initialized in my bean.

Here an quick and dirty example. (Dirty beacuse it uses scriplte. Custom 
tag
would be somehow more apprpriate.)

%
   HashMap linkParams = new HashMap(); // create the map
   linkParams.put(areaId, a); // set the values
   linkParams.put(aspectId, b);
   pageContext.setAttribute(linkParams, linkParams); // make the map an
attribute of page
%

html:link page=/deleteaspect.do name=linkParams
   bean:message key=button.delete/
/html:link

The generated URL will be: .../deleteaspect.do?areaId=aaspectId=b

The map does not have to be the attribute itself. It can be a property of 
an
attribute. Then the html:link tag would look like this:

html:link page=/deleteaspect.do name=linkAttribute
property=propertyName

--
gR






_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp