0

I have a grid of links in ma jsp..in the href attribute, i ve specified the navigation to a servlet...... in the servlet, i want to read the value of the link that i clicked in the jsp.....

for example, If my link appears to be
<a href="ProductController" target="right">A</a>
in the servlet, i want to read the value of the link i click(here 'A').

Kindly help how do i proceed with this?????? can i use JSP custom tag link taglib??? if so, how should i do??????Please guide me wit example code... please help!!

2
Contributors
7
Replies
8
Views
7 Years
Discussion Span
Last Post by gaya123
0
<a href="ProductController?linkValue=A" target="right">A</a>

And at the servlet use the "request.getParameter"

0

i tried request.getParameter("linkValue");
but, it doesnt read the value A...... how can i solve this?

0

I have this in my code:

<a href="loginservlet?action=logout">Logout</a>
String action = request.getParameter("action");

And it prints correctly the value "logout".

How do you map the servelt at the web.xml file? Are you sure there is nothing wrong?

0

ya web.xml servlet mapping is proper..... anyway i ll try this... thanks

0

it doesnt print the value 'A' for me when i tried...... kindly temme a solution......

0

It works. thanks...... i tried with method as get and it worked..

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.