This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Servlets and the fly likes linking to servlets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "linking to servlets" Watch "linking to servlets" New topic
Author

linking to servlets

Subil Abraham
Greenhorn

Joined: May 21, 2003
Posts: 4
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

Joined: May 26, 2003
Posts: 32481
    
214

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.


[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: linking to servlets
 
It's not a secret anymore!