getServlet?

2003-09-16 Thread Andy Kriger
The ServletContext.getServlet() method has been deprecated. Is it possible
to get a Servlet (or the ServletConfig, which is what I'm really after) in a
Struts Action?

thx
andy


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: getServlet?

2003-09-16 Thread Andrew Kuzmin
getServlet().getServletConfig() ?

--
Andrew Kuzmin
http://www.java201.com


- Original Message -
From: Andy Kriger [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Tuesday, September 16, 2003 5:04 PM
Subject: getServlet?


 The ServletContext.getServlet() method has been deprecated. Is it possible
 to get a Servlet (or the ServletConfig, which is what I'm really after) in
a
 Struts Action?

 thx
 andy


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: getServlet?

2003-09-16 Thread Craig R. McClanahan
On Tue, 16 Sep 2003, Andy Kriger wrote:

 Date: Tue, 16 Sep 2003 10:04:06 -0400
 From: Andy Kriger [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED]
 Subject: getServlet?

 The ServletContext.getServlet() method has been deprecated.

Yes.

 Is it possible
 to get a Servlet (or the ServletConfig, which is what I'm really after) in a
 Struts Action?

You can get the ServletConfig for the controller servlet itself by calling
getServlet().getServletConfig().  You cannot get the ServletConfig for any
other servlet.  If that other servlet needs to share info, have it put
things into servlet context attributes.


 thx
 andy

Craig

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



How can I subclass ActionServlet to work? (null getservlet in the ActionForm)

2003-06-25 Thread rablists
I actually found  similar questions on the list but none were 
answered. I am now confident that the ActionForm does not set the 
servlet. So how can I subclass the ActionServlet to make it to work, 
so the ActionForm's servlet will be set everytime we initialize it. 
Any ideas? thanks a lot..

--- In [EMAIL PROTECTED], rablists [EMAIL PROTECTED] wrote:

ActionServlet as = this.getServlet(); return null from ActionForm 
constructor.

I am having problem getting hold on the ActionServlet from an 
ActionForm constructor. It returns null. I dont want to populate the 
form by an Action, I want to do it through the form's constructor. I 
want to get the servlet in the form's constructor because I want to 
acess the MessageResources from the ActionForm. Any idea? Thanks



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: getServlet()?

2002-06-09 Thread Ted Husted

The ActionServletWrapper class was provided as a security patch. As
such, it takes the stances that we should start by shutting everything
down, and then open things up as needed. 

Off-hand, wanting to access servlet initialization parameters in
validate() sounds like a reasonable use-case. If you want to post a
patch to bugzilla, I'll see if we can do something about a 1.0.3
release.

-- Ted Husted, Husted dot Com, Fairport NY US
-- Developing Java Web Applications with Struts
-- Tel: +1 585 737-3463
-- Web: http://husted.com/about/services


Geoffrey Corb wrote:
 
 I have been attempting to update a project from Struts 1.0 to 1.0.2 to
 resolve some file upload problems.  Now, I've found that the ActionForm's
 getServlet() method no longer exposes the ActionServlet.  This is especially
 problematic to me, since a fair number of our ActionForm-derived classes use
 the ActionServlet to get at the ServletContext in their validation scripts.
 Is there a workaround possible?  I'm trying to retrieve initialization
 parameters from the ServletContext in the validate() methods of my
 ActionForm-derived classes.
 
 Another question:  What good is the ActionServletWrapper when it *barely*
 wraps the ActionServlet class?  I understand wanting to prevent public
 String properties of ActionServlet from being changed via a query string
 (quoted from release notes), but why not provide access to other, relatively
 important, methods, like getServletContext()?
 
 - G. Corb
 
 This communication, including attachments, is for the exclusive use of
 addressee and may contain proprietary, confidential  or privileged
 information. If you are not the intended recipient, any use, copying,
 disclosure, dissemination or distribution is strictly prohibited. When
 addressed to our clients any opinions or advice contained in this email are
 subject to the terms and conditions expressed in the governing Synergenic
 client Agreement.

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




getServlet()?

2002-05-29 Thread Geoffrey Corb

I have been attempting to update a project from Struts 1.0 to 1.0.2 to
resolve some file upload problems.  Now, I've found that the ActionForm's
getServlet() method no longer exposes the ActionServlet.  This is especially
problematic to me, since a fair number of our ActionForm-derived classes use
the ActionServlet to get at the ServletContext in their validation scripts.
Is there a workaround possible?  I'm trying to retrieve initialization
parameters from the ServletContext in the validate() methods of my
ActionForm-derived classes.
 
Another question:  What good is the ActionServletWrapper when it *barely*
wraps the ActionServlet class?  I understand wanting to prevent public
String properties of ActionServlet from being changed via a query string
(quoted from release notes), but why not provide access to other, relatively
important, methods, like getServletContext()?
 
- G. Corb
 
This communication, including attachments, is for the exclusive use of
addressee and may contain proprietary, confidential  or privileged
information. If you are not the intended recipient, any use, copying,
disclosure, dissemination or distribution is strictly prohibited. When
addressed to our clients any opinions or advice contained in this email are
subject to the terms and conditions expressed in the governing Synergenic
client Agreement.