• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hyperlink click error processing

 
James Winfrey
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys

I have a jsp on which I dispaly table of hyperlinks.

On click of hyperlink I have to do some processing in a servlet and display an error mesage on jsp if something goes wrong.

but the control should remain on the same jsp.

Is this possible without submitting the page?

Thanks


 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like a perfect application for AJAX. Libraries like Prototype and jQuery make it easy to kick off a request, collect the result, and update the HTML page accordingly without actually leaving the page.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64958
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Example using jQuery:

Or, you could write a couple of pages of raw JavaScript to do the same...

The example code above doesn't account for error handling, but that's just a few more lines (which I didn't add for clarity) that we can discuss if you go this route.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic