You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Calvin Yu <cy...@yahoo.com> on 2001/04/15 17:01:39 UTC

System level properties?

Hi,

I apologize in advance if this question has been asked
before, but I've search the mail archives and docs and
haven't come up with an answer.

Is there a place to specify system-level properties in
Struts?  For example, if the the Model components
needed to retrieve environment related properties
(remote server host and port, location of
initialization files, etc), where would we get them
from?  I saw the 'application' initialization
parameter, but that didn't seem to be the same context
of properties I'm trying to retrieve.

Another way to ask the question would be, where is the
equivalent of overriding init() in HttpServlet to
initializing the system?  Is subclassing ActionServlet
the preferred way?


Calvin

__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/

Re: Oracle Servlet Engine

Posted by Rob Leland <Ro...@freetocreate.org>.
No,
  And it will not work with 9i either. 
  Both use JServ which is a JSP 1.0, Servlet 2.0 container.
  However, I know 9i uses Apache which could then
  be modified to use tomcat. Oracle 8i may also
  use Apache but I am not sure.

-Rob

Michael Schommer wrote:
> 
> Hi,
> 
> we work with Oracle (8.1.7) in our company. Now, I want to know if Struts
> works with the Oracle ApplicationServer.
> If anyone has any know-how with the Oracle Servlet Engine and Struts or the
> Oracle 8i ApplicationServer I will be very happy for every information send
> directly to my eMail-address.
> 
> Bye
> Michael

Re: Oracle Servlet Engine

Posted by Incze Lajos <in...@mail.matav.hu>.
On Mon, Apr 16, 2001 at 07:14:15PM +0200, Michael Schommer wrote:
> Hi,
> 
> we work with Oracle (8.1.7) in our company. Now, I want to know if Struts
> works with the Oracle ApplicationServer.
> If anyone has any know-how with the Oracle Servlet Engine and Struts or the
> Oracle 8i ApplicationServer I will be very happy for every information send
> directly to my eMail-address.
> 
> Bye
> Michael
> 
You should check it, but as I heard it is based on apache-jserv.
Which is an older version of servlet engine, so struts will not
work with it. But Oracle probably should change to a more recent
servlet container really soon. Pleas, verify with your Oracle
support this, I'm not sure.                           icnze

Oracle Servlet Engine

Posted by Michael Schommer <mi...@Bitte1Bit.de>.
Hi,

we work with Oracle (8.1.7) in our company. Now, I want to know if Struts
works with the Oracle ApplicationServer.
If anyone has any know-how with the Oracle Servlet Engine and Struts or the
Oracle 8i ApplicationServer I will be very happy for every information send
directly to my eMail-address.

Bye
Michael


Re: System level properties?

Posted by Calvin Yu <cy...@yahoo.com>.
Yeah, that's a pretty good way to do it, better than
subclassing ActionServlet.  I'm still hoping though
that there is something that is built into Struts that
will make this cleaner than having to create a new
Servlet.


Calvin

--- Tharwat Abdul-Malik <ta...@grandtalent.com>
wrote:
> I don't know if this answers the first part of your
> question. But in your
> third paragraph where you seem to reframe the
> question. What I've done in
> that case was to create servlet who's sole purpose
> is to initialize certain
> parameters (database properties, other static
> properties, etc). The servlet
> loads at startup before the struts servlet. I hope
> this helps. I've been
> doing struts for a whole 2 days now!
> ----- Original Message -----
> From: "Calvin Yu" <cy...@yahoo.com>
> To: <st...@jakarta.apache.org>
> Sent: Sunday, April 15, 2001 11:01 AM
> Subject: System level properties?
> 
> 
> > Hi,
> >
> > I apologize in advance if this question has been
> asked
> > before, but I've search the mail archives and docs
> and
> > haven't come up with an answer.
> >
> > Is there a place to specify system-level
> properties in
> > Struts?  For example, if the the Model components
> > needed to retrieve environment related properties
> > (remote server host and port, location of
> > initialization files, etc), where would we get
> them
> > from?  I saw the 'application' initialization
> > parameter, but that didn't seem to be the same
> context
> > of properties I'm trying to retrieve.
> >
> > Another way to ask the question would be, where is
> the
> > equivalent of overriding init() in HttpServlet to
> > initializing the system?  Is subclassing
> ActionServlet
> > the preferred way?
> >
> >
> > Calvin
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Get email at your own domain with Yahoo! Mail.
> > http://personal.mail.yahoo.com/
> >
> 


__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/

Re: System level properties?

Posted by Tharwat Abdul-Malik <ta...@grandtalent.com>.
I don't know if this answers the first part of your question. But in your
third paragraph where you seem to reframe the question. What I've done in
that case was to create servlet who's sole purpose is to initialize certain
parameters (database properties, other static properties, etc). The servlet
loads at startup before the struts servlet. I hope this helps. I've been
doing struts for a whole 2 days now!
----- Original Message -----
From: "Calvin Yu" <cy...@yahoo.com>
To: <st...@jakarta.apache.org>
Sent: Sunday, April 15, 2001 11:01 AM
Subject: System level properties?


> Hi,
>
> I apologize in advance if this question has been asked
> before, but I've search the mail archives and docs and
> haven't come up with an answer.
>
> Is there a place to specify system-level properties in
> Struts?  For example, if the the Model components
> needed to retrieve environment related properties
> (remote server host and port, location of
> initialization files, etc), where would we get them
> from?  I saw the 'application' initialization
> parameter, but that didn't seem to be the same context
> of properties I'm trying to retrieve.
>
> Another way to ask the question would be, where is the
> equivalent of overriding init() in HttpServlet to
> initializing the system?  Is subclassing ActionServlet
> the preferred way?
>
>
> Calvin
>
> __________________________________________________
> Do You Yahoo!?
> Get email at your own domain with Yahoo! Mail.
> http://personal.mail.yahoo.com/
>


Re: System level properties?

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Sun, 15 Apr 2001, Calvin Yu wrote:

> Hi,
> 
> I apologize in advance if this question has been asked
> before, but I've search the mail archives and docs and
> haven't come up with an answer.
> 
> Is there a place to specify system-level properties in
> Struts?  For example, if the the Model components
> needed to retrieve environment related properties
> (remote server host and port, location of
> initialization files, etc), where would we get them
> from?  I saw the 'application' initialization
> parameter, but that didn't seem to be the same context
> of properties I'm trying to retrieve.
> 

One option to consider would be to use "context initialization
properties".  These are configured in your web.xml file:

  <context-param>
    <param-name>myparam</param-name>
    <parram-value>The value to be retrieved</param-value>
  </context-param>

and you can retrieve this from within a servlet by calling:

  String paramValue =
   getServletContext().getInitParameter("myparam");

> Another way to ask the question would be, where is the
> equivalent of overriding init() in HttpServlet to
> initializing the system?  Is subclassing ActionServlet
> the preferred way?
> 

There's nothing wrong with subclassing ActionServlet as well, and
overriding the init() method.  Just be sure you call super.init() so that
the standard initialization gets done.

This approach would be useful if you needed to dynamically construct an
aobject that you wanted to make available.  For example (assuming for the
moment that Struts did not support connection pools), you might do this in
your overridden init() method:

	ConnectionPool pool = new ConnectionPool(...);
	getServletContext().setAttribute("pool", pool);

to make a connection pool available as a servlet context attribute.

> 
> Calvin
> 

Craig