File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes How will i identify two hyperlink in one Servlet program. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "How will i identify two hyperlink in one Servlet program." Watch "How will i identify two hyperlink in one Servlet program." New topic
Author

How will i identify two hyperlink in one Servlet program.

Ritesh raushan
Ranch Hand

Joined: Aug 29, 2012
Posts: 100
i created a two hyperlink one is <a href="pageurl">next</a> and
other is<a href="pageurl">previous</a>.
my question is How will i identify two hyperlink(written above) in one Servlet program.
means if request comes from "next" hyperlink then do something and
and if comes from "previous" hyperlink then do something.
Ayan mallick
Ranch Hand

Joined: Nov 17, 2012
Posts: 46
one way is to add a queryparam along with url like
<a href="pageurl?link = next">next</a>
<a href="pageurl?link = previous">previous</a>

now inside servlet you can get it from request
if(request.getParameter("link").equals("next")){
// do next stuff

}

else if(request.getParameter("link").equals("previous")){
// do previous stuff

}
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How will i identify two hyperlink in one Servlet program.