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!!

Recommended Answers

All 7 Replies

<a href="ProductController?linkValue=A" target="right">A</a>

And at the servlet use the "request.getParameter"

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

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?

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

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

Post relevant code then

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.