You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@xml.apache.org by David Wall <dw...@Yozons.com> on 2001/04/26 00:24:50 UTC

any way to get the servlet environment

Is there any way for a service bean to get information about its servlet
environment (servlet config?, httprequest, httpsession....)?

While I don't need to keep a lot of state information for my beans -- they
are message-transactional -- it would be nice to be able to remember some
JDNI and RMI naming lookups, the database connection pool, etc.

Thanks,
David


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


AW: any way to get the servlet environment

Posted by Daniel Polack <dp...@delogix.de>.
HI, to use the context you need the latest jdsk included in:
* jakarta-tomcat-4.0-b3
* soap-2_1 nightly build 09.03.2001

in SOAP-2_1: WEB.XML add:
*************************

<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">


  <listener>
     <listener-class>delogix.server.context.ContextListener</listener-class>
  </listener>
****************************

Here you can create objects and bound them to your context.

Your service class must implement HttpSessionBindingListener

then

ServletContext context = session.getServletContext();
 now you can get your object from the context.




-----Ursprungliche Nachricht-----
Von: Rich Johns [mailto:rjohns@vignette.com]
Gesendet: Donnerstag, 26. April 2001 16:04
An: soap-user@xml.apache.org
Betreff: Re: any way to get the servlet environment


Unless I'm misunderstanding you, I think what you want is to
pass the SOAPContext to the service class. To do this, create an
implementation of the Provider interface that calls a setContext() method
on the service class. You might elect to have the service classes implement
an interface known to YourProvider. This interface would, at a minimum,
have a setContext( SOAPContext ) method. WRT the provider, you might
find deriving from RPCJavaProvider to be most expedient.

David Wall wrote:

> Is there any way for a service bean to get information about its servlet
> environment (servlet config?, httprequest, httpsession....)?
>
> While I don't need to keep a lot of state information for my beans -- they
> are message-transactional -- it would be nice to be able to remember some
> JDNI and RMI naming lookups, the database connection pool, etc.
>
> Thanks,
> David
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> For additional commands, email: soap-user-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


AW: any way to get the servlet environment

Posted by Daniel Polack <dp...@delogix.de>.
HI, to use the context you need the latest jdsk included in:
* jakarta-tomcat-4.0-b3
* soap-2_1 nightly build 09.03.2001

in SOAP-2_1: WEB.XML add:
*************************

<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">


  <listener>
     <listener-class>delogix.server.context.ContextListener</listener-class>
  </listener>
****************************

Here you can create objects and bound them to your context.

Your service class must implement HttpSessionBindingListener

then

ServletContext context = session.getServletContext();
 now you can get your object from the context.




-----Ursprungliche Nachricht-----
Von: Rich Johns [mailto:rjohns@vignette.com]
Gesendet: Donnerstag, 26. April 2001 16:04
An: soap-user@xml.apache.org
Betreff: Re: any way to get the servlet environment


Unless I'm misunderstanding you, I think what you want is to
pass the SOAPContext to the service class. To do this, create an
implementation of the Provider interface that calls a setContext() method
on the service class. You might elect to have the service classes implement
an interface known to YourProvider. This interface would, at a minimum,
have a setContext( SOAPContext ) method. WRT the provider, you might
find deriving from RPCJavaProvider to be most expedient.

David Wall wrote:

> Is there any way for a service bean to get information about its servlet
> environment (servlet config?, httprequest, httpsession....)?
>
> While I don't need to keep a lot of state information for my beans -- they
> are message-transactional -- it would be nice to be able to remember some
> JDNI and RMI naming lookups, the database connection pool, etc.
>
> Thanks,
> David
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> For additional commands, email: soap-user-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


Re: any way to get the servlet environment

Posted by Rich Johns <rj...@vignette.com>.
Unless I'm misunderstanding you, I think what you want is to
pass the SOAPContext to the service class. To do this, create an
implementation of the Provider interface that calls a setContext() method
on the service class. You might elect to have the service classes implement
an interface known to YourProvider. This interface would, at a minimum,
have a setContext( SOAPContext ) method. WRT the provider, you might
find deriving from RPCJavaProvider to be most expedient.

David Wall wrote:

> Is there any way for a service bean to get information about its servlet
> environment (servlet config?, httprequest, httpsession....)?
>
> While I don't need to keep a lot of state information for my beans -- they
> are message-transactional -- it would be nice to be able to remember some
> JDNI and RMI naming lookups, the database connection pool, etc.
>
> Thanks,
> David
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> For additional commands, email: soap-user-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


Re: any way to get the servlet environment

Posted by Rich Johns <rj...@vignette.com>.
Unless I'm misunderstanding you, I think what you want is to
pass the SOAPContext to the service class. To do this, create an
implementation of the Provider interface that calls a setContext() method
on the service class. You might elect to have the service classes implement
an interface known to YourProvider. This interface would, at a minimum,
have a setContext( SOAPContext ) method. WRT the provider, you might
find deriving from RPCJavaProvider to be most expedient.

David Wall wrote:

> Is there any way for a service bean to get information about its servlet
> environment (servlet config?, httprequest, httpsession....)?
>
> While I don't need to keep a lot of state information for my beans -- they
> are message-transactional -- it would be nice to be able to remember some
> JDNI and RMI naming lookups, the database connection pool, etc.
>
> Thanks,
> David
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> For additional commands, email: soap-user-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org