• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Passing JSP parameters to Java Method

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Friends,
I am using a JSP and Java Class(no servlets).I have a table,with column headers as hyperlinks.I want that when the header(or link)is clicked a parameter should pass to a method in the java class,and it should send back the results accordingly.

Can anyone help me plz.
 
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
Not sure what the question is.

Your code looks good. Although you should get rid of the spaces in
the useBean tag:

Are you asking for the syntax of the hyperlink?
 
amrit choong
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks ben,
I want to sort a table depending upon the column header values.So I display a table,and the user clicks on anyone header,I want to pass the column header parameter to my java file,so that I can sort the appropriate column.The only problem I am facing is I am not able to pass the parameter from JSP to my java method.Can u tell me how to do that.Got my question??
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,

the most easiet way i use is to add a new parameter for sorting in the hyper link use -let say that the jsp page name is test.jsp and the param name is sortby- <a href="test.jsp?sortby=1"> bla bla </a>...

i hope that this will be helpfull.

regards,
 
Ben Souther
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
To add the the excellent advise you've received so far...
You would retrieve the parameter with the request's getParameter method.
 
amrit choong
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks to both of u,
I have gone exactly tht way and received the exact results.
cheers
reply
    Bookmark Topic Watch Topic
  • New Topic