You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by David Graham <dg...@hotmail.com> on 2003/02/06 03:48:52 UTC

Last Bug!

The last bug we have for 1.1 is stumping me.  o.a.s.validator.FieldChecks 
validation methods call Resources.getActionError(request...

Resources.getActionError() calls Resources.getMessageResources(request)

There are several versions of Resources.getMessageResources(), one that 
takes a request and one that takes a ServletContext.

We need a version of that method that takes both arguments so it can look in 
the context if the module's bundle isn't in the request.  However, I don't 
see any way of getting a ServletContext to pass in there starting from 
FieldChecks' validation methods.

Help?

Dave



_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online  
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org


Re: OT: Re: Last Bug!

Posted by Renaud Bruyeron <br...@fullsix.com>.
JNDI lookups don't work on iPlanet 6.0 (no JNDI) if I am not mistaken...

 - Renaud

"Benjamin Tomasini" <bt...@neteverything.com> wrote in message
news:1044502642.1940.6.camel@localhost.localdomain...
> Unless I am mistaken, I don't know if you can walk up request -> session
> -> application (context) in any version of the API w/o risking some
> problems, like if the container has sessions disabled.
>
> The trick is that FieldChecks has a static method, and of the arguments
> passed, only request is even in the servlet.http family.  Because the
> method is static you would have to change is signature to get the
> Context in there.
>
> Maybe get the context from a JNDI lookup. =)
>
> Ben
>
> On Wed, 2003-02-05 at 22:12, Vic Cekvenich wrote:
> > Excuse me, I am in a bad mood:
> >
> >
http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/http/HttpSess
ion.html
> > Can we just "ASSERT" the container servlet container is 2.2 or 2.3 and
> > call the right method?
> >
> > ASSERT- get it?
> >
> > Benjamin Tomasini wrote:
> > > FieldChecks doesn't extend Action, which has that method.  I think
that
> > > keeping with servlet spec 2.2 will prevent walking from request to
> > > session to context, too.
> > >
> > > On Wed, 2003-02-05 at 21:59, Vic Cekvenich wrote:
> > >
> > >>Stuipd answer- Xcuse me:
> > >>getServlet().getContext()?
> > >>
> > >>David Graham wrote:
> > >>
> > >>>The last bug we have for 1.1 is stumping me.
> > >>>o.a.s.validator.FieldChecks validation methods call
> > >>>Resources.getActionError(request...
> > >>>
> > >>>Resources.getActionError() calls
Resources.getMessageResources(request)
> > >>>
> > >>>There are several versions of Resources.getMessageResources(), one
that
> > >>>takes a request and one that takes a ServletContext.
> > >>>
> > >>>We need a version of that method that takes both arguments so it can
> > >>>look in the context if the module's bundle isn't in the request.
> > >>>However, I don't see any way of getting a ServletContext to pass in
> > >>>there starting from FieldChecks' validation methods.
> > >>>
> > >>>Help?
> > >>>
> > >>>Dave
> > >>>
> > >>>
> > >>>
> > >>>_________________________________________________________________
> > >>>Protect your PC - get McAfee.com VirusScan Online
> > >>>http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
> > >>
> > >>
> > >>
> > >>---------------------------------------------------------------------
> > >>To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
> > >>For additional commands, e-mail: struts-dev-help@jakarta.apache.org
> > >>
> > >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-dev-help@jakarta.apache.org
> >




---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org


Re: OT: Re: Last Bug!

Posted by Benjamin Tomasini <bt...@neteverything.com>.
Unless I am mistaken, I don't know if you can walk up request -> session
-> application (context) in any version of the API w/o risking some
problems, like if the container has sessions disabled.

The trick is that FieldChecks has a static method, and of the arguments
passed, only request is even in the servlet.http family.  Because the
method is static you would have to change is signature to get the
Context in there.

Maybe get the context from a JNDI lookup. =)

Ben

On Wed, 2003-02-05 at 22:12, Vic Cekvenich wrote:
> Excuse me, I am in a bad mood:
> 
> http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/http/HttpSession.html
> Can we just "ASSERT" the container servlet container is 2.2 or 2.3 and 
> call the right method?
> 
> ASSERT- get it?
> 
> Benjamin Tomasini wrote:
> > FieldChecks doesn't extend Action, which has that method.  I think that
> > keeping with servlet spec 2.2 will prevent walking from request to
> > session to context, too.
> > 
> > On Wed, 2003-02-05 at 21:59, Vic Cekvenich wrote:
> > 
> >>Stuipd answer- Xcuse me:
> >>getServlet().getContext()?
> >>
> >>David Graham wrote:
> >>
> >>>The last bug we have for 1.1 is stumping me.  
> >>>o.a.s.validator.FieldChecks validation methods call 
> >>>Resources.getActionError(request...
> >>>
> >>>Resources.getActionError() calls Resources.getMessageResources(request)
> >>>
> >>>There are several versions of Resources.getMessageResources(), one that 
> >>>takes a request and one that takes a ServletContext.
> >>>
> >>>We need a version of that method that takes both arguments so it can 
> >>>look in the context if the module's bundle isn't in the request.  
> >>>However, I don't see any way of getting a ServletContext to pass in 
> >>>there starting from FieldChecks' validation methods.
> >>>
> >>>Help?
> >>>
> >>>Dave
> >>>
> >>>
> >>>
> >>>_________________________________________________________________
> >>>Protect your PC - get McAfee.com VirusScan Online  
> >>>http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
> >>
> >>
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail: struts-dev-help@jakarta.apache.org
> >>
> > 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-dev-help@jakarta.apache.org
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org


OT: Re: Last Bug!

Posted by Vic Cekvenich <vc...@basebeans.com>.
Excuse me, I am in a bad mood:

http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/http/HttpSession.html
Can we just "ASSERT" the container servlet container is 2.2 or 2.3 and 
call the right method?

ASSERT- get it?

Benjamin Tomasini wrote:
> FieldChecks doesn't extend Action, which has that method.  I think that
> keeping with servlet spec 2.2 will prevent walking from request to
> session to context, too.
> 
> On Wed, 2003-02-05 at 21:59, Vic Cekvenich wrote:
> 
>>Stuipd answer- Xcuse me:
>>getServlet().getContext()?
>>
>>David Graham wrote:
>>
>>>The last bug we have for 1.1 is stumping me.  
>>>o.a.s.validator.FieldChecks validation methods call 
>>>Resources.getActionError(request...
>>>
>>>Resources.getActionError() calls Resources.getMessageResources(request)
>>>
>>>There are several versions of Resources.getMessageResources(), one that 
>>>takes a request and one that takes a ServletContext.
>>>
>>>We need a version of that method that takes both arguments so it can 
>>>look in the context if the module's bundle isn't in the request.  
>>>However, I don't see any way of getting a ServletContext to pass in 
>>>there starting from FieldChecks' validation methods.
>>>
>>>Help?
>>>
>>>Dave
>>>
>>>
>>>
>>>_________________________________________________________________
>>>Protect your PC - get McAfee.com VirusScan Online  
>>>http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: struts-dev-help@jakarta.apache.org
>>
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org


Re: Last Bug!

Posted by Benjamin Tomasini <bt...@neteverything.com>.
FieldChecks doesn't extend Action, which has that method.  I think that
keeping with servlet spec 2.2 will prevent walking from request to
session to context, too.

On Wed, 2003-02-05 at 21:59, Vic Cekvenich wrote:
> Stuipd answer- Xcuse me:
> getServlet().getContext()?
> 
> David Graham wrote:
> > The last bug we have for 1.1 is stumping me.  
> > o.a.s.validator.FieldChecks validation methods call 
> > Resources.getActionError(request...
> > 
> > Resources.getActionError() calls Resources.getMessageResources(request)
> > 
> > There are several versions of Resources.getMessageResources(), one that 
> > takes a request and one that takes a ServletContext.
> > 
> > We need a version of that method that takes both arguments so it can 
> > look in the context if the module's bundle isn't in the request.  
> > However, I don't see any way of getting a ServletContext to pass in 
> > there starting from FieldChecks' validation methods.
> > 
> > Help?
> > 
> > Dave
> > 
> > 
> > 
> > _________________________________________________________________
> > Protect your PC - get McAfee.com VirusScan Online  
> > http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-dev-help@jakarta.apache.org
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org


Re: Last Bug!

Posted by Vic Cekvenich <vc...@basebeans.com>.
Stuipd answer- Xcuse me:
getServlet().getContext()?

David Graham wrote:
> The last bug we have for 1.1 is stumping me.  
> o.a.s.validator.FieldChecks validation methods call 
> Resources.getActionError(request...
> 
> Resources.getActionError() calls Resources.getMessageResources(request)
> 
> There are several versions of Resources.getMessageResources(), one that 
> takes a request and one that takes a ServletContext.
> 
> We need a version of that method that takes both arguments so it can 
> look in the context if the module's bundle isn't in the request.  
> However, I don't see any way of getting a ServletContext to pass in 
> there starting from FieldChecks' validation methods.
> 
> Help?
> 
> Dave
> 
> 
> 
> _________________________________________________________________
> Protect your PC - get McAfee.com VirusScan Online  
> http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org