Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / December 2005

Tip: Looking for answers? Try searching our database.

Struts, adding parameters to a request

Thread view: 
boanator@gmail.com - 02 Dec 2005 17:28 GMT
Let's say I have a web page called /emailForm.jsp with a form and a
submit button.  Let's also say that /emailForm.jsp receives some
request parameters.  When the user clicks the submit button on the
emailForm.jsp page, an http request is sent to /submitEmailForm.do.

I want the request parameters that were sent to /emailForm.jsp to be
added to the http request that is sent to /submitEmailForm.do.  Is this
possible?  Is there a way to use the jstl core tag library to append
those request parameters to the next request?  Is there a way to add
those request parameters to the application or session using a tag
library?

Thanks in advance for any advice...
Bryce - 02 Dec 2005 18:04 GMT
>Let's say I have a web page called /emailForm.jsp with a form and a
>submit button.  Let's also say that /emailForm.jsp receives some
[quoted text clipped - 7 lines]
>those request parameters to the application or session using a tag
>library?

Yes, just add them as a hidden field, (or visible if you want).

Signature

Last year I went to Iraq. Before Team America showed up, it was a happy place. They had flowery meadows and rainbow skies, and rivers made of chocolate, where the children danced and laughed and played with gumdrop smiles.

boanator@gmail.com - 02 Dec 2005 18:50 GMT
Thanks for the advice, it works just fine.  However, I create my form
on my jsp page using the tag:
<html:form>
...
</html:form>

In order to add these hidden fields, I need to add the regular html
input field inside my form.  For example:
<html:form method="POST" action="/submitEmailForm">
 ...
 <html:text property="from"/>
 <html:text property="to"/>
 ...
 <input type="hidden" name="comments" value="<%=
request.getParameter("comments") %>"/>
</html:form>

Since the parameters I would like to pass on are not part of the form
bean, I cannot use the tag:
<html:hidden property="comments"/>

So I must use the regular html tag:
<input type="hidden" name="comments" ... />

Is this a wise thing to do?  Could this possibly cause any errors with
my struts application?


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.