• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

how to send variable value through <html:link> tag  RSS feed

 
Greenhorn
Posts: 29
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
In my application I am displaying list of students. And when user clicks on student's name, his profile should be displayed. For this I want to send students name with the url. How can I do that?
Thanks..
 
Ranch Hand
Posts: 329
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Aniket,

If using html:link is the only option you are looking for then,
1. use "href/onclick" attribute to set the URL and append the values to the URL (not secure but works with/without java script browser)
2. use "href/onclick" attribute to call javascript method and pass this value as method parameter and submit the action in javascript.

 
Ranch Hand
Posts: 55
Hibernate Java Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Aniket,

Assuming the name of the ActionForm is 'StudentsForm' which has a student object.
The 'student' object contains 'studentName' as one of its property.
'stud' is the scripting variable in the <logic:iterator> tag.
Now, when the user clicks on the name of the student (defined in <bean:write> tag) the 'passStudentName' action is fired taking studentName as the value of the request parameter. And note that (paramId="name") 'name' of the request parameter.
So, in your ActionForm you should have a field called 'name' which will hold the value passed by the request parameter(i.e studentName).

If you have any problem in understanding the above one reply me back.

Regards,

Sandy
 
Aniket Khadke
Greenhorn
Posts: 29
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Sandy Chatterjee wrote:Hi Aniket,

Assuming the name of the ActionForm is 'StudentsForm' which has a student object.
The 'student' object contains 'studentName' as one of its property.
'stud' is the scripting variable in the <logic:iterator> tag.
Now, when the user clicks on the name of the student (defined in <bean:write> tag) the 'passStudentName' action is fired taking studentName as the value of the request parameter. And note that (paramId="name") 'name' of the request parameter.
So, in your ActionForm you should have a field called 'name' which will hold the value passed by the request parameter(i.e studentName).

If you have any problem in understanding the above one reply me back.

Regards,

Sandy




Hi Sandy,
Code worked like a champ... thanks.. :-)
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!