Let's remove AJAX from the equation and take a look at it. AJAX is
client side code acting on behalf of the user, so it should be regarded
essentially the same as the browser itself when it comes to object
access. Where people tend to get confused is in where the code is being
executed -- on
Reading the rest of your message, regarding the AJAX equivalent of
jsp:useBean, you'll need a servlet that can respond to AJAX requests for
session bean information handing back XML fragments with session data in
them. Then your AJAX code on the client would use that to pull XML
fragments
Is it possible to put a servlet in a .jar file and be able to access it
via AJAX?
I have some support servlets that I want to share via a common library.
To this point Ive only been putting session beans in there. Its easy to
point to those using 'jsp:usebean' tags and entries in 'web.xml'.
Yes, certainly you can put a servlet in a JAR... after all, Struts is
based on a servlet, and you generally just drop the Struts JAR into your
webapp... accessing a servlet via AJAX is, in simplest terms, just a
plain old HTTP request like any non-AJAX request, so yes, you can do
that too.