• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

Passing values to JSp with href

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have 2 jsp�s (First.jsp, second.jsp).
I have one a:href on First.jsp where it goes to Second.jsp , and also it needs to take some ID values from First.jsp to Second.jsp.

Below is my code (First.jsp):
<h:inputHidden id =�employeeId� value = �#{employee.employeeID}�
<h:inputHidden id =�applicationId� value = �#{employee.appliationID}�
Below iy my href:
<a href = �/jsp/Second.jsp� > Add Application </a>

How can I send values of employeeId and applicationID to Second.jsp , on clicking Add Application on first.jsp
Any suggestions
Thanks..
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Rahul Gosh:

<h:inputHidden id =�employeeId� value = �#{employee.employeeID}�
<h:inputHidden id =�applicationId� value = �#{employee.appliationID}�



These aren't standard HTML or JSP tags.
What framework/library are you using?
 
Rohit Kumar
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
am Using JSF
 
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Rahul,

You can either submit the form with the 2 fields to your second.jsp or call a javascript function onClick of your anchor link, add fields as querystring and then pass the queryString to your second.jsp. Your second jsp will get the values as request parameters.
[ August 17, 2007: Message edited by: Shailesh Kini ]
 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you can still used the standard foward and redirect
 
Rohit Kumar
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thnx for suggestions Shailesh..

Do you have any code for example ..

Thanks
 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you using an IDE? If so which one??
 
Rohit Kumar
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Elipse 3.1
 
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
use this.

 
Rohit Kumar
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Sushma for the sample. If I pass appId, how can I print this appId on the next screen.


Thanks,
Rahul
 
Sushma Sharma
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you can get the values of parameter like this


where employeeId is the name of the parameter.
 
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the scope of your employee bean? If it is in session scope, the employeeId and appId are automatically available in your second jsp. You can refer these properties in the same way as you referred them in your first jsp.
 
Rohit Kumar
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using request scope. Thannks for your tip to keep in session scope.
 
In the renaissance, how big were the dinosaurs? Did you have tiny ads?
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic