• Post Reply Bookmark Topic Watch Topic
  • New Topic

Passing JSP parameters to Java Method

 
amrit choong
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • 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.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • 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
  • 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??
 
M Raghid Sandouq
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • 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 Redhat VI Editor
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Thanks to both of u,
I have gone exactly tht way and received the exact results.
cheers
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!