File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes JSP - Servlet Comm Pattern Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "JSP - Servlet Comm Pattern" Watch "JSP - Servlet Comm Pattern" New topic

JSP - Servlet Comm Pattern


Joined: Sep 23, 2005
Posts: 1
folks & gurus,
am trying to find a viable-tryable pattern that would allow me to inform my Servlet of a single change of value on my JSP. I need to send the new value and the field Name/ID that changed.

Thanks in advance.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63865


There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Forum Bartender

[Asking smart questions] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63865

Well, as I'm sure you know, once a page is sent to the browser the job of the servlet that generated the page is done and there can be no further communciation. Any subsequent interaction needs to happen in the guise of a new HTTP request back to the server.

You can generate such a request by submitting a page, but you can also use the XMLHttpRequest object (aka AJAX technology) to send a 'behind the scenes" request back to a servlet informing the server of changes.
I agree. Here's the link:
subject: JSP - Servlet Comm Pattern
It's not a secret anymore!