aspose 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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
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: 44
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.
 
Similar Threads
declaration of pageNumber in "pg:pager" that is pager taglib
probelm in pager tab.
[pages tags & jsp] - How can I make TOP and BOTTOM paging work?
How to make a paging
Knowning which link was clicked (take 2)