All,

I am having problems with the ActionForm's "getServlet" method and "servlet"
attribute.  I have created a class called "BaseForm" which simply extends
ActionForm.  When I attempt to get a reference to the ActionServlet using
the "getServlet" method or "servlet" attribute, I receive a null pointer
exception.  I found a post on a similar problem (below).  Is this behavior
still a bug?  I am also trying to get a reference to the ServeltContext.

Regards,

Joshua 







----------------------------------------------------------------------------
-------------
Date: Sun, 09 Jun 2002 16:04:17 -0400
From: Ted Husted <[EMAIL PROTECTED]>
Subject: getServlet()?
Content-Type: text/plain; charset=us-ascii

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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to