File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

linking to servlets

 
Subil Abraham
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a JSP page which contains a 3 links shown below
<a href=".../MyServlet">Function1</a>
<a href=".../MyServlet">Function2</a>
<a href=".../MyServlet">Function3</a>
and they reference the same Servlet(viz MyServlet). I was wondering if the Servlet(MyServlet) is capable of identifying which link is clicked. I know it possible using forms but i wanted to know if i could associate a unique action for each link. Any kind of help would be appreciated.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33674
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Subil,
You can use a form in the link:

Alternatively, you can use different names (instead of MyServlet). In your web.xml, set all of them to redirect to MyServlet. Then, you can see what path the request came from.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic