You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Jamie Hayes <Ja...@three.co.uk> on 2003/05/12 18:24:29 UTC

Application Context in Axis?

Hi All,

For HTTP accessible web services, which will run as part of a web
application, which might include regular servlets, JSPs and web services,
there could well be information that needs to be made available throughout
the entire application. The normal servlet way of doing this is to make use
of the ServletContext object, which can be obtained via the
getServletContext method of either Servlet or ServletConfig. However, for
web services, these objects aren't available directly. Closer inspection
reveals two possible solutions:

1) The AxisEngine gives access to the current message context. This is
something that is built by the Axis servlet, used to service requests.
Within this message context, there is a property which contains the Axis
servlet used to process the request (property name:
HTTPConstants.MC_HTTP_SERVLET). This can be used to get at the ServletConfig
and, hence, the ServletContext. Application wide information can be accessed
here.

2) Axis also provides a Session object, which is sometimes referred to as
the "application session". I'm not sure how this could be accessed outside
of a web service but, if it could be, other servlets in the web application
could access it and place information into, or pull information out of, it.

I'd prefer direct use of the servlet context, since it is easily accessible
from web services, but does anyone have experience or opinion on either (or
another) design approach?

Thanks,

	- jamie



 -- 
  Jamie Hayes  Head of Architecture and Design, JCP Liaison, 3
  http://www.three.co.uk      	   jamie.hayes@three.co.uk


________________________________________________________________________

This e-mail message (including any attachment) is intended only for the personal 
use of the recipient(s) named above. This message is confidential and may be 
legally privileged.  If you are not an intended recipient, you may not review, copy or 
distribute this message. If you have received this communication in error, please notify 
us immediately by e-mail and delete the original message.

Any views or opinions expressed in this message are those of the author only. 
Furthermore, this message (including any attachment) does not create any legally 
binding rights or obligations whatsoever, which may only be created by the exchange 
of hard copy documents signed by a duly authorised representative of Hutchison 
3G UK Limited.
________________________________________________________________________