You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by strutstwouser <st...@gmail.com> on 2009/04/24 14:18:39 UTC

DWRValidator not working in Struts 2.1.6

Hi,
I'm getting an NPE when trying to use DWR validation in Struts 2.1.6.
Basically, porting a Struts 2.0.x app that used DWR validation.

The ValueStackFactory is null during the invocation and this throws the NPE
while calling valueStackFactory.createValueStack(); 
In normal invocation, all is fine.

How is the valueStackFactory set ? . Do i need to add any config so that the
DWR flow initializes valueStackFactory properly?

Below is the stacktrace and web.xml config:


[4/24/09 17:25:15:942 IST] 0000002b DWRValidator  E
com.opensymphony.xwork2.util.logging.commons.CommonsLogger error Error while
trying to validate
                                 java.lang.NullPointerException
	at
com.opensymphony.xwork2.DefaultActionInvocation.createContextMap(DefaultActionInvocation.java:331)
	at
com.opensymphony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:377)
	at
com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:186)
	at
org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:61)
	at
org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39)
	at org.apache.struts2.validators.DWRValidator.doPost(DWRValidator.java:106)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:618)
	at uk.ltd.getahead.dwr.impl.ExecuteQuery.execute(ExecuteQuery.java:233)
	at
uk.ltd.getahead.dwr.impl.DefaultExecProcessor.handle(DefaultExecProcessor.java:48)
	at
uk.ltd.getahead.dwr.impl.DefaultProcessor.handle(DefaultProcessor.java:83)
	at
uk.ltd.getahead.dwr.AbstractDWRServlet.doPost(AbstractDWRServlet.java:162)

---------web.xml---------------
<filter>
	<filter-name>struts2</filter-name>

<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<servlet>
<servlet-name>dwr</servlet-name>
<servlet-class>uk.ltd.getahead.dwr.DWRServlet</servlet-class>
<init-param>
    <param-name>debug</param-name>
    <param-value>true</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>dwr</servlet-name>
<url-pattern>/dwr/*</url-pattern>
</servlet-mapping>
---------end web.xml---------------

Any help is very much appreciated,
s2user


-- 
View this message in context: http://www.nabble.com/DWRValidator-not-working-in-Struts-2.1.6-tp23215316p23215316.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: DWRValidator not working in Struts 2.1.6

Posted by j alex <st...@gmail.com>.
Done - https://issues.apache.org/struts/browse/WW-3138 . I've mentioned
about the method name not being picked up as well.

Thanks,
Joseph

On Mon, May 18, 2009 at 11:34 PM, Martin Gainty <mg...@hotmail.com> wrote:

>
> thats a bug ..
>
> xwork version 1.2.3
> com.opensymphony.xwork.ActionProxyFactory
>    public abstract ActionProxy createActionProxy(String namespace, String
> actionName, Map extraContext, boolean executeResult, boolean cleanupContext)
> throws Exception;
> }
>
> xwork 2.1.2
> com.opensymphony.xwork.ActionProxyFactory
>  public ActionProxy createActionProxy(String namespace, String actionName,
> String methodName, Map<String, Object> extraContext, boolean executeResult,
> boolean cleanupContext);
>
> the only changes are addition of methodName and the 4th extraContext param
> changes to Map<String,Object>
>
> do you want to put in a bug report?
>
> good catch!
> Martin
>

RE: DWRValidator not working in Struts 2.1.6

Posted by Martin Gainty <mg...@hotmail.com>.
thats a bug ..

xwork version 1.2.3
com.opensymphony.xwork.ActionProxyFactory
    public abstract ActionProxy createActionProxy(String namespace, String actionName, Map extraContext, boolean executeResult, boolean cleanupContext) throws Exception;
}

xwork 2.1.2
com.opensymphony.xwork.ActionProxyFactory
  public ActionProxy createActionProxy(String namespace, String actionName, String methodName, Map<String, Object> extraContext, boolean executeResult, boolean cleanupContext);

the only changes are addition of methodName and the 4th extraContext param changes to Map<String,Object>

do you want to put in a bug report?

good catch!
Martin 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.




> Date: Mon, 18 May 2009 23:15:25 +0530
> Subject: Re: DWRValidator not working in Struts 2.1.6
> From: strutstwouser@gmail.com
> To: user@struts.apache.org
> 
> I meant that there is a problem with DWRValidator.java , not the
> documentation.
> 
> Referring to
> http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/dwr/src/main/java/org/apache/struts2/validators/DWRValidator.java?revision=670170
> (hope
> this is the latest?) , the line :
> 
> ActionProxy proxy = actionProxyFactory.createActionProxy(inv, namespace,
> mapping.getName(), mapping.getMethod(), *true*, *true*);
> 
> had to be changed to :
> 
> ActionProxy proxy = actionProxyFactory.createActionProxy(namespace,
> mapping.getName(), mapping.getMethod(), ctx);
> 
> in order to make the validation work.
> 
> Also, the mapping.getMethod() returns null , so we can't do validation on
> any other method than "execute"
> 
> I wanted to know if i'm missing anything here, or is this a bug with
> DWRValidator?
> 
> Thanks,
> 
> Joseph
> 
> 
> 
> 
> 
> 
> 
> On Fri, May 15, 2009 at 5:36 PM, Dave Newton <ne...@yahoo.com> wrote:
> 
> > Martin Gainty wrote:
> >
> >> the 3rd parameter is a map extraContext - a Map of extra parameters to be
> >> provided to the ActionProxy
> >> xwork is the higher authority since it is a base library..here is the doc
> >> from
> >> xwork 1.2.3
> >>
> >
> > S2 uses XW2.
> >
> > apparently Struts Doc is out of synch with xwork doc
> >>
> >
> > No.
> >
> > Dave
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >

_________________________________________________________________
Hotmail® has a new way to see what's up with your friends.
http://windowslive.com/Tutorial/Hotmail/WhatsNew?ocid=TXT_TAGLM_WL_HM_Tutorial_WhatsNew1_052009

Re: DWRValidator not working in Struts 2.1.6

Posted by j alex <st...@gmail.com>.
I meant that there is a problem with DWRValidator.java , not the
documentation.

Referring to
http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/dwr/src/main/java/org/apache/struts2/validators/DWRValidator.java?revision=670170
(hope
this is the latest?) , the line :

ActionProxy proxy = actionProxyFactory.createActionProxy(inv, namespace,
mapping.getName(), mapping.getMethod(), *true*, *true*);

had to be changed to :

ActionProxy proxy = actionProxyFactory.createActionProxy(namespace,
mapping.getName(), mapping.getMethod(), ctx);

in order to make the validation work.

Also, the mapping.getMethod() returns null , so we can't do validation on
any other method than "execute"

I wanted to know if i'm missing anything here, or is this a bug with
DWRValidator?

Thanks,

Joseph







On Fri, May 15, 2009 at 5:36 PM, Dave Newton <ne...@yahoo.com> wrote:

> Martin Gainty wrote:
>
>> the 3rd parameter is a map extraContext - a Map of extra parameters to be
>> provided to the ActionProxy
>> xwork is the higher authority since it is a base library..here is the doc
>> from
>> xwork 1.2.3
>>
>
> S2 uses XW2.
>
> apparently Struts Doc is out of synch with xwork doc
>>
>
> No.
>
> Dave
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: DWRValidator not working in Struts 2.1.6

Posted by Dave Newton <ne...@yahoo.com>.
Martin Gainty wrote:
> the 3rd parameter is a map 
> extraContext - a Map of extra parameters to be provided to the ActionProxy
> xwork is the higher authority since it is a base library..here is the doc from
> xwork 1.2.3

S2 uses XW2.

> apparently Struts Doc is out of synch with xwork doc

No.

Dave


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


RE: DWRValidator not working in Struts 2.1.6

Posted by Martin Gainty <mg...@hotmail.com>.
seems to be a disconnect between xwork and struts
the 3rd parameter is a map 
extraContext - a Map of extra parameters to be provided to the ActionProxy
xwork is the higher authority since it is a base library..here is the doc from
xwork 1.2.3

createActionProxyhttp://www.opensymphony.com/xwork/api/com/opensymphony/xwork2/ActionProxyFactory.html

public abstract ActionProxy createActionProxy(String namespace,
                                              String actionName,
                                              Map extraContext,
                                              boolean executeResult,
                                              boolean cleanupContext)
                                       throws Exception
Creates an ActionProxy for the given namespace and action name by looking up the configuration. The ActionProxy
 should be fully initialized when it is returned, including having an ActionInvocation instance associated.


Parameters:namespace - the namespace of the actionactionName - extraContext - a Map of extra parameters to be provided to the ActionProxyexecuteResult - flag which tells whether the result should be executed after the actioncleanupContext - 
Returns:ActionProxy
Throws:
Exception

apparently Struts Doc is out of synch with xwork doc
huihoo gets it right
 
ActionProxy
createActionProxy(String namespace,
                  String actionName,
                  Map extraContext,
                  boolean executeResult,
                  boolean cleanupContext)



          Creates an ActionProxy for the given namespace and action name by looking up the configuration.

and yes please file a JIRA in Struts Documentation

Thanks
Martin Gainty 
______________________________________________ 
Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
This message is confidential. If you should not be the intended receiver, then we ask politely to report. Each unauthorized forwarding or manufacturing of a copy is inadmissible. This message serves only for the exchange of information and has no legal binding effect. Due to the easy manipulation of emails we cannot take responsibility over the the contents.
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.




> Date: Fri, 15 May 2009 07:29:24 +0530
> Subject: Re: DWRValidator not working in Struts 2.1.6
> From: strutstwouser@gmail.com
> To: user@struts.apache.org
> 
> Martin,
> 
> I tried with :
> 
> ActionProxy proxy = actionProxyFactory.createActionProxy(namespace,
> mapping.getName(), "execute", ctx);
> 
> Somehow the method name is coming in as null, so i hardcoded it to execute
> for now ; need to see why.
> 
> This seems to work fine, i'm getting the errors as an alert box on the page,
> but that's a different story.
> 
> Should i open a JIRA for this ?
> 
> Thanks,
> Joseph
> 
> 
> 
> 
> On Fri, May 15, 2009 at 6:41 AM, j alex <st...@gmail.com> wrote:
> 
> > Hi Martin,
> >
> > I had seen the configs in the struts-showcase, and used all of them as-is ;
> > just added a javascript fn. to invoke DWR and was getting the NPE. So, looks
> > like there's something broken in the default distro. I'll try your
> > suggestion of using :
> >
> > *
> >
> > public
> > * ActionProxy createActionProxy(String namespace, String actionName,
> > String methodName, Map<String, Object> extraContext, *boolean*executeResult,
> > *boolean* cleanupContext);
> > instead of :
> >
> > *public* ActionProxy createActionProxy(ActionInvocation actionInvocation,
> > String namespace, String actionName, String methodName,*boolean*executeResult,
> > *boolean* cleanupContext);
> >
> > Hope this is what you meant?
> >
> > Thanks,
> > Joseph
> >
> >
> >
> >
> >
> >
> > On Fri, May 15, 2009 at 3:40 AM, Martin Gainty <mg...@hotmail.com>wrote:
> >
> >>
> >> the DWR configuration you will need is located at
> >> struts-showcase\WEB-INF\dwr.xml
> >>
> >> <?xml version="1.0" encoding="UTF-8"?>
> >> <!-- START SNIPPET: dwr -->
> >> <!DOCTYPE dwr PUBLIC
> >>    "-//GetAhead Limited//DTD Direct Web Remoting 1.0//EN"
> >>    "http://www.getahead.ltd.uk/dwr/dwr10.dtd">
> >> <dwr>
> >>    <allow>
> >>        <create creator="new" javascript="validator">
> >>            <param name="class"
> >> value="org.apache.struts2.validators.DWRValidator"/>
> >>        </create>
> >>        <convert converter="bean"
> >> match="com.opensymphony.xwork2.ValidationAwareSupport"/>
> >>    </allow>
> >>    <signatures>
> >>        <![CDATA[
> >>        import java.util.Map;
> >>        import org.apache.struts2.validators.DWRValidator;
> >>
> >>        DWRValidator.doPost(String, String, Map<String, String>);
> >>        ]]>
> >>    </signatures>
> >> </dwr>
> >> <!-- END SNIPPET: dwr -->
> >>
> >> where the servlet would be defined in WEB-INF/web.xml configuration
> >>   <servlet>
> >>        <servlet-name>dwr</servlet-name>
> >>        <servlet-class>uk.ltd.getahead.dwr.DWRServlet</servlet-class>
> >>        <init-param>
> >>            <param-name>debug</param-name>
> >>            <param-value>true</param-value>
> >>        </init-param>
> >>    </servlet>
> >>    <servlet-mapping>
> >>        <servlet-name>dwr</servlet-name>
> >>        <url-pattern>/dwr/*</url-pattern>
> >>    </servlet-mapping>
> >>
> >> the config files struts.xml or struts-default.xml would contain the bean
> >> definitions for OgnlValueStackFactory e.g.
> >>
> >> <bean type="com.opensymphony.xwork2.util.ValueStackFactory" name="struts"
> >> class="com.opensymphony.xwork2.ognl.OgnlValueStackFactory" />
> >>
> >> <bean type="com.opensymphony.xwork2.ActionProxyFactory" name="xwork"
> >> class="com.opensymphony.xwork2.DefaultActionProxyFactory"/>
> >>
> >> your webapp's
> >> execution flow is governed by interceptors you insert into (defaultStack)
> >> interceptor stack declaration as seen here
> >>            <interceptor-stack name="defaultStack">
> >>                <interceptor-ref name="exception"/>
> >>                <interceptor-ref name="alias"/>
> >>                <interceptor-ref name="servletConfig"/>
> >>                <interceptor-ref name="i18n"/>
> >>                <interceptor-ref name="prepare"/>
> >>                <interceptor-ref name="chain"/>
> >>                <interceptor-ref name="debugging"/>
> >>                <interceptor-ref name="profiling"/>
> >>                <interceptor-ref name="scopedModelDriven"/>
> >>                <interceptor-ref name="modelDriven"/>
> >>                <interceptor-ref name="fileUpload"/>
> >>                <interceptor-ref name="checkbox"/>
> >>                <interceptor-ref name="staticParams"/>
> >>                <interceptor-ref name="actionMappingParams"/>
> >>                <interceptor-ref name="params">
> >>                  <param name="excludeParams">dojo\..*,^struts\..*</param>
> >>                </interceptor-ref>
> >>                <interceptor-ref name="conversionError"/>
> >>                <interceptor-ref name="validation">
> >>                    <param
> >> name="excludeMethods">input,back,cancel,browse</param>
> >>                </interceptor-ref>
> >>                <interceptor-ref name="workflow">
> >>                    <param
> >> name="excludeMethods">input,back,cancel,browse</param>
> >>                </interceptor-ref>
> >>            </interceptor-stack>
> >>
> >> The ActionProxyFactory is used to create ActionProxies to be executed. It
> >> is the entry point to XWork that is used
> >>  by a dispatcher to create an ActionProxy to execute for a particular
> >> namespace and action name.
> >>
> >> where xwork 1.2.3 specifies createActionProxy with 5 parameters
> >> createActionProxy(String namespace,
> >>                  String actionName,
> >>                  Map extraContext,
> >>                  boolean executeResult,
> >>                  boolean cleanupContext)
> >>
> >>
> >> Creates an ActionProxy for the given namespace and action name by looking
> >> up the configuration.
> >>
> >> instead of
> >>  ActionProxy proxy = actionProxyFactory.createActionProxy(inv, namespace,
> >> > mapping.getName(), mapping.getMethod(), *true*, *true*);
> >>
> >> switch the 1st arg of inv (assuming that contains action) and 2nd arg of
> >> namespace(assuming that contains namespace) and drop getMethod() unless of
> >> course that has the desired extraContext
> >> then proxy.execute()
> >> will set the ActionContext from the ActionInvocation into the desired
> >> ActionContext
> >>
> >> documentation available at
> >>
> >> http://struts.apache.org/2.1.6/struts2-core/apidocs/com/opensymphony/xwork2/ActionProxy.html
> >>
> >> hope that answers your question
> >> Martin
> >> ______________________________________________
> >> Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung/Note
> >> de déni et de confidentialité
> >> This message is confidential. If you should not be the intended receiver,
> >> then we ask politely to report. Each unauthorized forwarding or
> >> manufacturing of a copy is inadmissible. This message serves only for the
> >> exchange of information and has no legal binding effect. Due to the easy
> >> manipulation of emails we cannot take responsibility over the the contents.
> >> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
> >> Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte
> >> Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht
> >> dient lediglich dem Austausch von Informationen und entfaltet keine
> >> rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
> >> E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> >> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le
> >> destinataire prévu, nous te demandons avec bonté que pour satisfaire
> >> informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie
> >> de ceci est interdite. Ce message sert à l'information seulement et n'aura
> >> pas n'importe quel effet légalement obligatoire. Étant donné que les email
> >> peuvent facilement être sujets à la manipulation, nous ne pouvons accepter
> >> aucune responsabilité pour le contenu fourni.
> >>
> >>
> >>
> >>
> >> > Date: Fri, 15 May 2009 01:50:27 +0530
> >> > Subject: Re: DWRValidator not working in Struts 2.1.6
> >> > From: strutstwouser@gmail.com
> >> > To: user@struts.apache.org
> >>  >
> >> > martin,
> >> >
> >> > i had seen the StrutsPrepareFilter API and as it says "Prepares the
> >> request
> >> > for execution by a later StrutsExecuteFilter filter instance. " . I've
> >> both
> >> > the StrutsPrepare and Execute filters configured plus the DWR servlet.
> >> >
> >> > You were mentioning a working example of DWRValidator in the showcase,
> >> but i
> >> > couldn't find it.
> >> >
> >> > My understanding is that when a DWR request is sent - it goes thru
> >> > StrutsPrepareFilter ,  StrutsExecuteFilter (which executes the Action
> >> > preceded by interceptor stack) , finally DWRServlet. So, by the time the
> >> > request reaches DWRServlet, it would have done the validations and the
> >> > errors would be populated.
> >> >
> >> > The point i'm confused is that in DWRValidator doPost method, there's
> >> again
> >> > a call to execute the Action like :
> >> >
> >> > ActionProxy proxy = actionProxyFactory.createActionProxy(inv, namespace,
> >> > mapping.getName(), mapping.getMethod(), *true*, *true*);
> >> > proxy.execute();
> >> > and this fails for some reason since valuestackfactory is null.
> >> >
> >> > Thanks,
> >> > Joseph
> >> >
> >> > On Fri, May 15, 2009 at 1:22 AM, Martin Gainty <mg...@hotmail.com>
> >> wrote:
> >> >
> >> > >
> >> > > StrutsPrepareFilter documentation is available at
> >> > >
> >> > >
> >> http://struts.apache.org/2.1.6/struts2-core/apidocs/org/apache/struts2/dispatcher/ng/filter/StrutsPrepareFilter.html
> >> > >
> >> > > there is a brand new feature that musachy put in svn on monday to
> >> > > specifically work-around action execute
> >> > > i would ping him to see if this made was built into latest distro
> >> > >
> >> > > Thanks,
> >> > > Martin Gainty
> >> > > ______________________________________________
> >> > > Disclaimer and Confidentiality/Verzicht und
> >> Vertraulichkeitanmerkung/Note
> >> > > de déni et de confidentialité
> >> > > This message is confidential. If you should not be the intended
> >> receiver,
> >> > > then we ask politely to report. Each unauthorized forwarding or
> >> > > manufacturing of a copy is inadmissible. This message serves only for
> >> the
> >> > > exchange of information and has no legal binding effect. Due to the
> >> easy
> >> > > manipulation of emails we cannot take responsibility over the the
> >> contents.
> >> > > Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
> >> > > Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede
> >> unbefugte
> >> > > Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese
> >> Nachricht
> >> > > dient lediglich dem Austausch von Informationen und entfaltet keine
> >> > > rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit
> >> von
> >> > > E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> >> > > Ce message est confidentiel et peut être privilégié. Si vous n'êtes
> >> pas le
> >> > > destinataire prévu, nous te demandons avec bonté que pour satisfaire
> >> > > informez l'expéditeur. N'importe quelle diffusion non autorisée ou la
> >> copie
> >> > > de ceci est interdite. Ce message sert à l'information seulement et
> >> n'aura
> >> > > pas n'importe quel effet légalement obligatoire. Étant donné que les
> >> email
> >> > > peuvent facilement être sujets à la manipulation, nous ne pouvons
> >> accepter
> >> > > aucune responsabilité pour le contenu fourni.
> >> > >
> >> > >
> >> > >
> >> > >
> >> > > > Date: Thu, 14 May 2009 23:55:34 +0530
> >> > > > Subject: Re: DWRValidator not working in Struts 2.1.6
> >> > > > From: strutstwouser@gmail.com
> >> > > > To: mgainty@hotmail.com; user@struts.apache.org
> >> > >  >
> >> > > > Just wanted to make sure my email reached the full users' list. I
> >> > > > still havent been able to make any progress on this. Has anyone got
> >> > > > the DWRValidator working in Struts 2.1?
> >> > > >
> >> > > > On 4/24/09, j alex <st...@gmail.com> wrote:
> >> > > > > Martin,
> >> > > > >
> >> > > > > I want DWRServlet to handle only the Action validations, not
> >> Action
> >> > > > > execution. I'm invoking the validator.doPost() when user tabs off
> >> a
> >> > > field
> >> > > > > in
> >> > > > > order to validate the entered data.
> >> > > > >
> >> > > > > I couldn't find the example you are referring to in
> >> > > > > http://struts.apache.org/2.1.6/docs/tutorials.html . Could you
> >> please
> >> > > tell
> >> > > > > me a specific link ?
> >> > > > >
> >> > > > > Thanks
> >> > > > > s2user
> >> > > > >
> >> > > > >
> >> > > > >
> >> > > > > On Fri, Apr 24, 2009 at 7:50 PM, Martin Gainty <
> >> mgainty@hotmail.com>
> >> > > wrote:
> >> > > > >
> >> > > > >>  who handles the action execution DWRServlet or
> >> > > > >> StrutsPrepareAndExecuteFilter?
> >> > > > >>
> >> > > > >> If you want to use DWRServlet to handle action execution you are
> >> > > better
> >> > > > >> off
> >> > > > >> just using StrutsPrepareFilter to prepare the request as in this
> >> > > example
> >> > > > >>
> >> > > > >>
> >> > > > >>
> >> > >
> >> http://struts.apache.org/2.1.6/struts2-core/apidocs/org/apache/struts2/dispatcher/ng/filter/StrutsPrepareFilter.html
> >> > > > >>
> >> > > > >> web.xml entry
> >> > > > >>     <filter>
> >> > > > >>         <filter-name>struts-prepare</filter-name>
> >> > > > >>
> >> > > > >>
> >> > >
> >> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter</filter-class>
> >> > > > >>         <init-param>
> >> > > > >>             <param-name>actionPackages</param-name>
> >> > > > >>
> >> > > <param-value>org.apache.struts2.showcase.person</param-value>
> >> > > > >>         </init-param>
> >> > > > >>     </filter>
> >> > > > >>
> >> > > > >> There is a very good example of StrutsPrepareFilter functionality
> >> > > working
> >> > > > >> in combination with DWRServlet in struts2-showcase tutorial
> >> located at
> >> > > > >>
> >> > > > >>
> >> > > > >>
> >> > > > >
> >> > > >
> >> > >  >
> >> ---------------------------------------------------------------------
> >> > > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> > > > For additional commands, e-mail: user-help@struts.apache.org
> >> > > >
> >> > >
> >> > > _________________________________________________________________
> >> > > Hotmail® has a new way to see what's up with your friends.
> >> > >
> >> > >
> >> http://windowslive.com/Tutorial/Hotmail/WhatsNew?ocid=TXT_TAGLM_WL_HM_Tutorial_WhatsNew1_052009
> >> > >
> >>
> >> _________________________________________________________________
> >> Insert movie times and more without leaving Hotmail®.
> >>
> >> http://windowslive.com/Tutorial/Hotmail/QuickAdd?ocid=TXT_TAGLM_WL_HM_Tutorial_QuickAdd1_052009
> >>
> >
> >

_________________________________________________________________
Insert movie times and more without leaving Hotmail®.
http://windowslive.com/Tutorial/Hotmail/QuickAdd?ocid=TXT_TAGLM_WL_HM_Tutorial_QuickAdd1_052009

Re: DWRValidator not working in Struts 2.1.6

Posted by j alex <st...@gmail.com>.
Martin,

I tried with :

ActionProxy proxy = actionProxyFactory.createActionProxy(namespace,
mapping.getName(), "execute", ctx);

Somehow the method name is coming in as null, so i hardcoded it to execute
for now ; need to see why.

This seems to work fine, i'm getting the errors as an alert box on the page,
but that's a different story.

Should i open a JIRA for this ?

Thanks,
Joseph




On Fri, May 15, 2009 at 6:41 AM, j alex <st...@gmail.com> wrote:

> Hi Martin,
>
> I had seen the configs in the struts-showcase, and used all of them as-is ;
> just added a javascript fn. to invoke DWR and was getting the NPE. So, looks
> like there's something broken in the default distro. I'll try your
> suggestion of using :
>
> *
>
> public
> * ActionProxy createActionProxy(String namespace, String actionName,
> String methodName, Map<String, Object> extraContext, *boolean*executeResult,
> *boolean* cleanupContext);
> instead of :
>
> *public* ActionProxy createActionProxy(ActionInvocation actionInvocation,
> String namespace, String actionName, String methodName,*boolean*executeResult,
> *boolean* cleanupContext);
>
> Hope this is what you meant?
>
> Thanks,
> Joseph
>
>
>
>
>
>
> On Fri, May 15, 2009 at 3:40 AM, Martin Gainty <mg...@hotmail.com>wrote:
>
>>
>> the DWR configuration you will need is located at
>> struts-showcase\WEB-INF\dwr.xml
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <!-- START SNIPPET: dwr -->
>> <!DOCTYPE dwr PUBLIC
>>    "-//GetAhead Limited//DTD Direct Web Remoting 1.0//EN"
>>    "http://www.getahead.ltd.uk/dwr/dwr10.dtd">
>> <dwr>
>>    <allow>
>>        <create creator="new" javascript="validator">
>>            <param name="class"
>> value="org.apache.struts2.validators.DWRValidator"/>
>>        </create>
>>        <convert converter="bean"
>> match="com.opensymphony.xwork2.ValidationAwareSupport"/>
>>    </allow>
>>    <signatures>
>>        <![CDATA[
>>        import java.util.Map;
>>        import org.apache.struts2.validators.DWRValidator;
>>
>>        DWRValidator.doPost(String, String, Map<String, String>);
>>        ]]>
>>    </signatures>
>> </dwr>
>> <!-- END SNIPPET: dwr -->
>>
>> where the servlet would be defined in WEB-INF/web.xml configuration
>>   <servlet>
>>        <servlet-name>dwr</servlet-name>
>>        <servlet-class>uk.ltd.getahead.dwr.DWRServlet</servlet-class>
>>        <init-param>
>>            <param-name>debug</param-name>
>>            <param-value>true</param-value>
>>        </init-param>
>>    </servlet>
>>    <servlet-mapping>
>>        <servlet-name>dwr</servlet-name>
>>        <url-pattern>/dwr/*</url-pattern>
>>    </servlet-mapping>
>>
>> the config files struts.xml or struts-default.xml would contain the bean
>> definitions for OgnlValueStackFactory e.g.
>>
>> <bean type="com.opensymphony.xwork2.util.ValueStackFactory" name="struts"
>> class="com.opensymphony.xwork2.ognl.OgnlValueStackFactory" />
>>
>> <bean type="com.opensymphony.xwork2.ActionProxyFactory" name="xwork"
>> class="com.opensymphony.xwork2.DefaultActionProxyFactory"/>
>>
>> your webapp's
>> execution flow is governed by interceptors you insert into (defaultStack)
>> interceptor stack declaration as seen here
>>            <interceptor-stack name="defaultStack">
>>                <interceptor-ref name="exception"/>
>>                <interceptor-ref name="alias"/>
>>                <interceptor-ref name="servletConfig"/>
>>                <interceptor-ref name="i18n"/>
>>                <interceptor-ref name="prepare"/>
>>                <interceptor-ref name="chain"/>
>>                <interceptor-ref name="debugging"/>
>>                <interceptor-ref name="profiling"/>
>>                <interceptor-ref name="scopedModelDriven"/>
>>                <interceptor-ref name="modelDriven"/>
>>                <interceptor-ref name="fileUpload"/>
>>                <interceptor-ref name="checkbox"/>
>>                <interceptor-ref name="staticParams"/>
>>                <interceptor-ref name="actionMappingParams"/>
>>                <interceptor-ref name="params">
>>                  <param name="excludeParams">dojo\..*,^struts\..*</param>
>>                </interceptor-ref>
>>                <interceptor-ref name="conversionError"/>
>>                <interceptor-ref name="validation">
>>                    <param
>> name="excludeMethods">input,back,cancel,browse</param>
>>                </interceptor-ref>
>>                <interceptor-ref name="workflow">
>>                    <param
>> name="excludeMethods">input,back,cancel,browse</param>
>>                </interceptor-ref>
>>            </interceptor-stack>
>>
>> The ActionProxyFactory is used to create ActionProxies to be executed. It
>> is the entry point to XWork that is used
>>  by a dispatcher to create an ActionProxy to execute for a particular
>> namespace and action name.
>>
>> where xwork 1.2.3 specifies createActionProxy with 5 parameters
>> createActionProxy(String namespace,
>>                  String actionName,
>>                  Map extraContext,
>>                  boolean executeResult,
>>                  boolean cleanupContext)
>>
>>
>> Creates an ActionProxy for the given namespace and action name by looking
>> up the configuration.
>>
>> instead of
>>  ActionProxy proxy = actionProxyFactory.createActionProxy(inv, namespace,
>> > mapping.getName(), mapping.getMethod(), *true*, *true*);
>>
>> switch the 1st arg of inv (assuming that contains action) and 2nd arg of
>> namespace(assuming that contains namespace) and drop getMethod() unless of
>> course that has the desired extraContext
>> then proxy.execute()
>> will set the ActionContext from the ActionInvocation into the desired
>> ActionContext
>>
>> documentation available at
>>
>> http://struts.apache.org/2.1.6/struts2-core/apidocs/com/opensymphony/xwork2/ActionProxy.html
>>
>> hope that answers your question
>> Martin
>> ______________________________________________
>> Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung/Note
>> de déni et de confidentialité
>> This message is confidential. If you should not be the intended receiver,
>> then we ask politely to report. Each unauthorized forwarding or
>> manufacturing of a copy is inadmissible. This message serves only for the
>> exchange of information and has no legal binding effect. Due to the easy
>> manipulation of emails we cannot take responsibility over the the contents.
>> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
>> Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte
>> Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht
>> dient lediglich dem Austausch von Informationen und entfaltet keine
>> rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
>> E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
>> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le
>> destinataire prévu, nous te demandons avec bonté que pour satisfaire
>> informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie
>> de ceci est interdite. Ce message sert à l'information seulement et n'aura
>> pas n'importe quel effet légalement obligatoire. Étant donné que les email
>> peuvent facilement être sujets à la manipulation, nous ne pouvons accepter
>> aucune responsabilité pour le contenu fourni.
>>
>>
>>
>>
>> > Date: Fri, 15 May 2009 01:50:27 +0530
>> > Subject: Re: DWRValidator not working in Struts 2.1.6
>> > From: strutstwouser@gmail.com
>> > To: user@struts.apache.org
>>  >
>> > martin,
>> >
>> > i had seen the StrutsPrepareFilter API and as it says "Prepares the
>> request
>> > for execution by a later StrutsExecuteFilter filter instance. " . I've
>> both
>> > the StrutsPrepare and Execute filters configured plus the DWR servlet.
>> >
>> > You were mentioning a working example of DWRValidator in the showcase,
>> but i
>> > couldn't find it.
>> >
>> > My understanding is that when a DWR request is sent - it goes thru
>> > StrutsPrepareFilter ,  StrutsExecuteFilter (which executes the Action
>> > preceded by interceptor stack) , finally DWRServlet. So, by the time the
>> > request reaches DWRServlet, it would have done the validations and the
>> > errors would be populated.
>> >
>> > The point i'm confused is that in DWRValidator doPost method, there's
>> again
>> > a call to execute the Action like :
>> >
>> > ActionProxy proxy = actionProxyFactory.createActionProxy(inv, namespace,
>> > mapping.getName(), mapping.getMethod(), *true*, *true*);
>> > proxy.execute();
>> > and this fails for some reason since valuestackfactory is null.
>> >
>> > Thanks,
>> > Joseph
>> >
>> > On Fri, May 15, 2009 at 1:22 AM, Martin Gainty <mg...@hotmail.com>
>> wrote:
>> >
>> > >
>> > > StrutsPrepareFilter documentation is available at
>> > >
>> > >
>> http://struts.apache.org/2.1.6/struts2-core/apidocs/org/apache/struts2/dispatcher/ng/filter/StrutsPrepareFilter.html
>> > >
>> > > there is a brand new feature that musachy put in svn on monday to
>> > > specifically work-around action execute
>> > > i would ping him to see if this made was built into latest distro
>> > >
>> > > Thanks,
>> > > Martin Gainty
>> > > ______________________________________________
>> > > Disclaimer and Confidentiality/Verzicht und
>> Vertraulichkeitanmerkung/Note
>> > > de déni et de confidentialité
>> > > This message is confidential. If you should not be the intended
>> receiver,
>> > > then we ask politely to report. Each unauthorized forwarding or
>> > > manufacturing of a copy is inadmissible. This message serves only for
>> the
>> > > exchange of information and has no legal binding effect. Due to the
>> easy
>> > > manipulation of emails we cannot take responsibility over the the
>> contents.
>> > > Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
>> > > Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede
>> unbefugte
>> > > Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese
>> Nachricht
>> > > dient lediglich dem Austausch von Informationen und entfaltet keine
>> > > rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit
>> von
>> > > E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
>> > > Ce message est confidentiel et peut être privilégié. Si vous n'êtes
>> pas le
>> > > destinataire prévu, nous te demandons avec bonté que pour satisfaire
>> > > informez l'expéditeur. N'importe quelle diffusion non autorisée ou la
>> copie
>> > > de ceci est interdite. Ce message sert à l'information seulement et
>> n'aura
>> > > pas n'importe quel effet légalement obligatoire. Étant donné que les
>> email
>> > > peuvent facilement être sujets à la manipulation, nous ne pouvons
>> accepter
>> > > aucune responsabilité pour le contenu fourni.
>> > >
>> > >
>> > >
>> > >
>> > > > Date: Thu, 14 May 2009 23:55:34 +0530
>> > > > Subject: Re: DWRValidator not working in Struts 2.1.6
>> > > > From: strutstwouser@gmail.com
>> > > > To: mgainty@hotmail.com; user@struts.apache.org
>> > >  >
>> > > > Just wanted to make sure my email reached the full users' list. I
>> > > > still havent been able to make any progress on this. Has anyone got
>> > > > the DWRValidator working in Struts 2.1?
>> > > >
>> > > > On 4/24/09, j alex <st...@gmail.com> wrote:
>> > > > > Martin,
>> > > > >
>> > > > > I want DWRServlet to handle only the Action validations, not
>> Action
>> > > > > execution. I'm invoking the validator.doPost() when user tabs off
>> a
>> > > field
>> > > > > in
>> > > > > order to validate the entered data.
>> > > > >
>> > > > > I couldn't find the example you are referring to in
>> > > > > http://struts.apache.org/2.1.6/docs/tutorials.html . Could you
>> please
>> > > tell
>> > > > > me a specific link ?
>> > > > >
>> > > > > Thanks
>> > > > > s2user
>> > > > >
>> > > > >
>> > > > >
>> > > > > On Fri, Apr 24, 2009 at 7:50 PM, Martin Gainty <
>> mgainty@hotmail.com>
>> > > wrote:
>> > > > >
>> > > > >>  who handles the action execution DWRServlet or
>> > > > >> StrutsPrepareAndExecuteFilter?
>> > > > >>
>> > > > >> If you want to use DWRServlet to handle action execution you are
>> > > better
>> > > > >> off
>> > > > >> just using StrutsPrepareFilter to prepare the request as in this
>> > > example
>> > > > >>
>> > > > >>
>> > > > >>
>> > >
>> http://struts.apache.org/2.1.6/struts2-core/apidocs/org/apache/struts2/dispatcher/ng/filter/StrutsPrepareFilter.html
>> > > > >>
>> > > > >> web.xml entry
>> > > > >>     <filter>
>> > > > >>         <filter-name>struts-prepare</filter-name>
>> > > > >>
>> > > > >>
>> > >
>> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter</filter-class>
>> > > > >>         <init-param>
>> > > > >>             <param-name>actionPackages</param-name>
>> > > > >>
>> > > <param-value>org.apache.struts2.showcase.person</param-value>
>> > > > >>         </init-param>
>> > > > >>     </filter>
>> > > > >>
>> > > > >> There is a very good example of StrutsPrepareFilter functionality
>> > > working
>> > > > >> in combination with DWRServlet in struts2-showcase tutorial
>> located at
>> > > > >>
>> > > > >>
>> > > > >>
>> > > > >
>> > > >
>> > >  >
>> ---------------------------------------------------------------------
>> > > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> > > > For additional commands, e-mail: user-help@struts.apache.org
>> > > >
>> > >
>> > > _________________________________________________________________
>> > > Hotmail® has a new way to see what's up with your friends.
>> > >
>> > >
>> http://windowslive.com/Tutorial/Hotmail/WhatsNew?ocid=TXT_TAGLM_WL_HM_Tutorial_WhatsNew1_052009
>> > >
>>
>> _________________________________________________________________
>> Insert movie times and more without leaving Hotmail®.
>>
>> http://windowslive.com/Tutorial/Hotmail/QuickAdd?ocid=TXT_TAGLM_WL_HM_Tutorial_QuickAdd1_052009
>>
>
>

Re: DWRValidator not working in Struts 2.1.6

Posted by j alex <st...@gmail.com>.
Hi Martin,

I had seen the configs in the struts-showcase, and used all of them as-is ;
just added a javascript fn. to invoke DWR and was getting the NPE. So, looks
like there's something broken in the default distro. I'll try your
suggestion of using :

*

public* ActionProxy createActionProxy(String namespace, String actionName,
String methodName, Map<String, Object> extraContext, *boolean*executeResult,
*boolean* cleanupContext);
instead of :


*public* ActionProxy createActionProxy(ActionInvocation actionInvocation,
String namespace, String actionName, String methodName,*boolean*executeResult,
*boolean* cleanupContext);

Hope this is what you meant?

Thanks,
Joseph






On Fri, May 15, 2009 at 3:40 AM, Martin Gainty <mg...@hotmail.com> wrote:

>
> the DWR configuration you will need is located at
> struts-showcase\WEB-INF\dwr.xml
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!-- START SNIPPET: dwr -->
> <!DOCTYPE dwr PUBLIC
>    "-//GetAhead Limited//DTD Direct Web Remoting 1.0//EN"
>    "http://www.getahead.ltd.uk/dwr/dwr10.dtd">
> <dwr>
>    <allow>
>        <create creator="new" javascript="validator">
>            <param name="class"
> value="org.apache.struts2.validators.DWRValidator"/>
>        </create>
>        <convert converter="bean"
> match="com.opensymphony.xwork2.ValidationAwareSupport"/>
>    </allow>
>    <signatures>
>        <![CDATA[
>        import java.util.Map;
>        import org.apache.struts2.validators.DWRValidator;
>
>        DWRValidator.doPost(String, String, Map<String, String>);
>        ]]>
>    </signatures>
> </dwr>
> <!-- END SNIPPET: dwr -->
>
> where the servlet would be defined in WEB-INF/web.xml configuration
>   <servlet>
>        <servlet-name>dwr</servlet-name>
>        <servlet-class>uk.ltd.getahead.dwr.DWRServlet</servlet-class>
>        <init-param>
>            <param-name>debug</param-name>
>            <param-value>true</param-value>
>        </init-param>
>    </servlet>
>    <servlet-mapping>
>        <servlet-name>dwr</servlet-name>
>        <url-pattern>/dwr/*</url-pattern>
>    </servlet-mapping>
>
> the config files struts.xml or struts-default.xml would contain the bean
> definitions for OgnlValueStackFactory e.g.
>
> <bean type="com.opensymphony.xwork2.util.ValueStackFactory" name="struts"
> class="com.opensymphony.xwork2.ognl.OgnlValueStackFactory" />
>
> <bean type="com.opensymphony.xwork2.ActionProxyFactory" name="xwork"
> class="com.opensymphony.xwork2.DefaultActionProxyFactory"/>
>
> your webapp's
> execution flow is governed by interceptors you insert into (defaultStack)
> interceptor stack declaration as seen here
>            <interceptor-stack name="defaultStack">
>                <interceptor-ref name="exception"/>
>                <interceptor-ref name="alias"/>
>                <interceptor-ref name="servletConfig"/>
>                <interceptor-ref name="i18n"/>
>                <interceptor-ref name="prepare"/>
>                <interceptor-ref name="chain"/>
>                <interceptor-ref name="debugging"/>
>                <interceptor-ref name="profiling"/>
>                <interceptor-ref name="scopedModelDriven"/>
>                <interceptor-ref name="modelDriven"/>
>                <interceptor-ref name="fileUpload"/>
>                <interceptor-ref name="checkbox"/>
>                <interceptor-ref name="staticParams"/>
>                <interceptor-ref name="actionMappingParams"/>
>                <interceptor-ref name="params">
>                  <param name="excludeParams">dojo\..*,^struts\..*</param>
>                </interceptor-ref>
>                <interceptor-ref name="conversionError"/>
>                <interceptor-ref name="validation">
>                    <param
> name="excludeMethods">input,back,cancel,browse</param>
>                </interceptor-ref>
>                <interceptor-ref name="workflow">
>                    <param
> name="excludeMethods">input,back,cancel,browse</param>
>                </interceptor-ref>
>            </interceptor-stack>
>
> The ActionProxyFactory is used to create ActionProxies to be executed. It
> is the entry point to XWork that is used
>  by a dispatcher to create an ActionProxy to execute for a particular
> namespace and action name.
>
> where xwork 1.2.3 specifies createActionProxy with 5 parameters
> createActionProxy(String namespace,
>                  String actionName,
>                  Map extraContext,
>                  boolean executeResult,
>                  boolean cleanupContext)
>
>
> Creates an ActionProxy for the given namespace and action name by looking
> up the configuration.
>
> instead of
>  ActionProxy proxy = actionProxyFactory.createActionProxy(inv, namespace,
> > mapping.getName(), mapping.getMethod(), *true*, *true*);
>
> switch the 1st arg of inv (assuming that contains action) and 2nd arg of
> namespace(assuming that contains namespace) and drop getMethod() unless of
> course that has the desired extraContext
> then proxy.execute()
> will set the ActionContext from the ActionInvocation into the desired
> ActionContext
>
> documentation available at
>
> http://struts.apache.org/2.1.6/struts2-core/apidocs/com/opensymphony/xwork2/ActionProxy.html
>
> hope that answers your question
> Martin
> ______________________________________________
> Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung/Note
> de déni et de confidentialité
> This message is confidential. If you should not be the intended receiver,
> then we ask politely to report. Each unauthorized forwarding or
> manufacturing of a copy is inadmissible. This message serves only for the
> exchange of information and has no legal binding effect. Due to the easy
> manipulation of emails we cannot take responsibility over the the contents.
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
> Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte
> Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht
> dient lediglich dem Austausch von Informationen und entfaltet keine
> rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
> E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le
> destinataire prévu, nous te demandons avec bonté que pour satisfaire
> informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie
> de ceci est interdite. Ce message sert à l'information seulement et n'aura
> pas n'importe quel effet légalement obligatoire. Étant donné que les email
> peuvent facilement être sujets à la manipulation, nous ne pouvons accepter
> aucune responsabilité pour le contenu fourni.
>
>
>
>
> > Date: Fri, 15 May 2009 01:50:27 +0530
> > Subject: Re: DWRValidator not working in Struts 2.1.6
> > From: strutstwouser@gmail.com
> > To: user@struts.apache.org
>  >
> > martin,
> >
> > i had seen the StrutsPrepareFilter API and as it says "Prepares the
> request
> > for execution by a later StrutsExecuteFilter filter instance. " . I've
> both
> > the StrutsPrepare and Execute filters configured plus the DWR servlet.
> >
> > You were mentioning a working example of DWRValidator in the showcase,
> but i
> > couldn't find it.
> >
> > My understanding is that when a DWR request is sent - it goes thru
> > StrutsPrepareFilter ,  StrutsExecuteFilter (which executes the Action
> > preceded by interceptor stack) , finally DWRServlet. So, by the time the
> > request reaches DWRServlet, it would have done the validations and the
> > errors would be populated.
> >
> > The point i'm confused is that in DWRValidator doPost method, there's
> again
> > a call to execute the Action like :
> >
> > ActionProxy proxy = actionProxyFactory.createActionProxy(inv, namespace,
> > mapping.getName(), mapping.getMethod(), *true*, *true*);
> > proxy.execute();
> > and this fails for some reason since valuestackfactory is null.
> >
> > Thanks,
> > Joseph
> >
> > On Fri, May 15, 2009 at 1:22 AM, Martin Gainty <mg...@hotmail.com>
> wrote:
> >
> > >
> > > StrutsPrepareFilter documentation is available at
> > >
> > >
> http://struts.apache.org/2.1.6/struts2-core/apidocs/org/apache/struts2/dispatcher/ng/filter/StrutsPrepareFilter.html
> > >
> > > there is a brand new feature that musachy put in svn on monday to
> > > specifically work-around action execute
> > > i would ping him to see if this made was built into latest distro
> > >
> > > Thanks,
> > > Martin Gainty
> > > ______________________________________________
> > > Disclaimer and Confidentiality/Verzicht und
> Vertraulichkeitanmerkung/Note
> > > de déni et de confidentialité
> > > This message is confidential. If you should not be the intended
> receiver,
> > > then we ask politely to report. Each unauthorized forwarding or
> > > manufacturing of a copy is inadmissible. This message serves only for
> the
> > > exchange of information and has no legal binding effect. Due to the
> easy
> > > manipulation of emails we cannot take responsibility over the the
> contents.
> > > Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
> > > Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede
> unbefugte
> > > Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese
> Nachricht
> > > dient lediglich dem Austausch von Informationen und entfaltet keine
> > > rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
> > > E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> > > Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas
> le
> > > destinataire prévu, nous te demandons avec bonté que pour satisfaire
> > > informez l'expéditeur. N'importe quelle diffusion non autorisée ou la
> copie
> > > de ceci est interdite. Ce message sert à l'information seulement et
> n'aura
> > > pas n'importe quel effet légalement obligatoire. Étant donné que les
> email
> > > peuvent facilement être sujets à la manipulation, nous ne pouvons
> accepter
> > > aucune responsabilité pour le contenu fourni.
> > >
> > >
> > >
> > >
> > > > Date: Thu, 14 May 2009 23:55:34 +0530
> > > > Subject: Re: DWRValidator not working in Struts 2.1.6
> > > > From: strutstwouser@gmail.com
> > > > To: mgainty@hotmail.com; user@struts.apache.org
> > >  >
> > > > Just wanted to make sure my email reached the full users' list. I
> > > > still havent been able to make any progress on this. Has anyone got
> > > > the DWRValidator working in Struts 2.1?
> > > >
> > > > On 4/24/09, j alex <st...@gmail.com> wrote:
> > > > > Martin,
> > > > >
> > > > > I want DWRServlet to handle only the Action validations, not Action
> > > > > execution. I'm invoking the validator.doPost() when user tabs off a
> > > field
> > > > > in
> > > > > order to validate the entered data.
> > > > >
> > > > > I couldn't find the example you are referring to in
> > > > > http://struts.apache.org/2.1.6/docs/tutorials.html . Could you
> please
> > > tell
> > > > > me a specific link ?
> > > > >
> > > > > Thanks
> > > > > s2user
> > > > >
> > > > >
> > > > >
> > > > > On Fri, Apr 24, 2009 at 7:50 PM, Martin Gainty <
> mgainty@hotmail.com>
> > > wrote:
> > > > >
> > > > >>  who handles the action execution DWRServlet or
> > > > >> StrutsPrepareAndExecuteFilter?
> > > > >>
> > > > >> If you want to use DWRServlet to handle action execution you are
> > > better
> > > > >> off
> > > > >> just using StrutsPrepareFilter to prepare the request as in this
> > > example
> > > > >>
> > > > >>
> > > > >>
> > >
> http://struts.apache.org/2.1.6/struts2-core/apidocs/org/apache/struts2/dispatcher/ng/filter/StrutsPrepareFilter.html
> > > > >>
> > > > >> web.xml entry
> > > > >>     <filter>
> > > > >>         <filter-name>struts-prepare</filter-name>
> > > > >>
> > > > >>
> > >
> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter</filter-class>
> > > > >>         <init-param>
> > > > >>             <param-name>actionPackages</param-name>
> > > > >>
> > > <param-value>org.apache.struts2.showcase.person</param-value>
> > > > >>         </init-param>
> > > > >>     </filter>
> > > > >>
> > > > >> There is a very good example of StrutsPrepareFilter functionality
> > > working
> > > > >> in combination with DWRServlet in struts2-showcase tutorial
> located at
> > > > >>
> > > > >>
> > > > >>
> > > > >
> > > >
> > >  >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > > For additional commands, e-mail: user-help@struts.apache.org
> > > >
> > >
> > > _________________________________________________________________
> > > Hotmail® has a new way to see what's up with your friends.
> > >
> > >
> http://windowslive.com/Tutorial/Hotmail/WhatsNew?ocid=TXT_TAGLM_WL_HM_Tutorial_WhatsNew1_052009
> > >
>
> _________________________________________________________________
> Insert movie times and more without leaving Hotmail®.
>
> http://windowslive.com/Tutorial/Hotmail/QuickAdd?ocid=TXT_TAGLM_WL_HM_Tutorial_QuickAdd1_052009
>

RE: DWRValidator not working in Struts 2.1.6

Posted by Martin Gainty <mg...@hotmail.com>.
the DWR configuration you will need is located at struts-showcase\WEB-INF\dwr.xml

<?xml version="1.0" encoding="UTF-8"?>
<!-- START SNIPPET: dwr -->
<!DOCTYPE dwr PUBLIC 
    "-//GetAhead Limited//DTD Direct Web Remoting 1.0//EN" 
    "http://www.getahead.ltd.uk/dwr/dwr10.dtd">
<dwr>
    <allow>
        <create creator="new" javascript="validator">
            <param name="class" value="org.apache.struts2.validators.DWRValidator"/>
        </create>
        <convert converter="bean" match="com.opensymphony.xwork2.ValidationAwareSupport"/>
    </allow>
    <signatures>
        <![CDATA[
        import java.util.Map;
        import org.apache.struts2.validators.DWRValidator;

        DWRValidator.doPost(String, String, Map<String, String>);
        ]]>
    </signatures>
</dwr>
<!-- END SNIPPET: dwr -->

where the servlet would be defined in WEB-INF/web.xml configuration 
   <servlet>
        <servlet-name>dwr</servlet-name>
        <servlet-class>uk.ltd.getahead.dwr.DWRServlet</servlet-class>
        <init-param>
            <param-name>debug</param-name>
            <param-value>true</param-value>
        </init-param>
    </servlet>
    <servlet-mapping>
        <servlet-name>dwr</servlet-name>
        <url-pattern>/dwr/*</url-pattern>
    </servlet-mapping>

the config files struts.xml or struts-default.xml would contain the bean definitions for OgnlValueStackFactory e.g.

<bean type="com.opensymphony.xwork2.util.ValueStackFactory" name="struts" class="com.opensymphony.xwork2.ognl.OgnlValueStackFactory" />

<bean type="com.opensymphony.xwork2.ActionProxyFactory" name="xwork" class="com.opensymphony.xwork2.DefaultActionProxyFactory"/>

your webapp's
execution flow is governed by interceptors you insert into (defaultStack) interceptor stack declaration as seen here
            <interceptor-stack name="defaultStack">
                <interceptor-ref name="exception"/>
                <interceptor-ref name="alias"/>
                <interceptor-ref name="servletConfig"/>
                <interceptor-ref name="i18n"/>
                <interceptor-ref name="prepare"/>
                <interceptor-ref name="chain"/>
                <interceptor-ref name="debugging"/>
                <interceptor-ref name="profiling"/>
                <interceptor-ref name="scopedModelDriven"/>
                <interceptor-ref name="modelDriven"/>
                <interceptor-ref name="fileUpload"/>
                <interceptor-ref name="checkbox"/>
                <interceptor-ref name="staticParams"/>
                <interceptor-ref name="actionMappingParams"/>
                <interceptor-ref name="params">
                  <param name="excludeParams">dojo\..*,^struts\..*</param>
                </interceptor-ref>
                <interceptor-ref name="conversionError"/>
                <interceptor-ref name="validation">
                    <param name="excludeMethods">input,back,cancel,browse</param>
                </interceptor-ref>
                <interceptor-ref name="workflow">
                    <param name="excludeMethods">input,back,cancel,browse</param>
                </interceptor-ref>
            </interceptor-stack>

The ActionProxyFactory is used to create ActionProxies to be executed. It is the entry point to XWork that is used
 by a dispatcher to create an ActionProxy to execute for a particular namespace and action name.

where xwork 1.2.3 specifies createActionProxy with 5 parameters
createActionProxy(String namespace,
                  String actionName,
                  Map extraContext,
                  boolean executeResult,
                  boolean cleanupContext)


Creates an ActionProxy for the given namespace and action name by looking up the configuration.

instead of 
 ActionProxy proxy = actionProxyFactory.createActionProxy(inv, namespace,
> mapping.getName(), mapping.getMethod(), *true*, *true*);

switch the 1st arg of inv (assuming that contains action) and 2nd arg of namespace(assuming that contains namespace) and drop getMethod() unless of course that has the desired extraContext
then proxy.execute()
will set the ActionContext from the ActionInvocation into the desired ActionContext

documentation available at
http://struts.apache.org/2.1.6/struts2-core/apidocs/com/opensymphony/xwork2/ActionProxy.html

hope that answers your question
Martin 
______________________________________________ 
Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
This message is confidential. If you should not be the intended receiver, then we ask politely to report. Each unauthorized forwarding or manufacturing of a copy is inadmissible. This message serves only for the exchange of information and has no legal binding effect. Due to the easy manipulation of emails we cannot take responsibility over the the contents.
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.




> Date: Fri, 15 May 2009 01:50:27 +0530
> Subject: Re: DWRValidator not working in Struts 2.1.6
> From: strutstwouser@gmail.com
> To: user@struts.apache.org
> 
> martin,
> 
> i had seen the StrutsPrepareFilter API and as it says "Prepares the request
> for execution by a later StrutsExecuteFilter filter instance. " . I've both
> the StrutsPrepare and Execute filters configured plus the DWR servlet.
> 
> You were mentioning a working example of DWRValidator in the showcase, but i
> couldn't find it.
> 
> My understanding is that when a DWR request is sent - it goes thru
> StrutsPrepareFilter ,  StrutsExecuteFilter (which executes the Action
> preceded by interceptor stack) , finally DWRServlet. So, by the time the
> request reaches DWRServlet, it would have done the validations and the
> errors would be populated.
> 
> The point i'm confused is that in DWRValidator doPost method, there's again
> a call to execute the Action like :
> 
> ActionProxy proxy = actionProxyFactory.createActionProxy(inv, namespace,
> mapping.getName(), mapping.getMethod(), *true*, *true*);
> proxy.execute();
> and this fails for some reason since valuestackfactory is null.
> 
> Thanks,
> Joseph
> 
> On Fri, May 15, 2009 at 1:22 AM, Martin Gainty <mg...@hotmail.com> wrote:
> 
> >
> > StrutsPrepareFilter documentation is available at
> >
> > http://struts.apache.org/2.1.6/struts2-core/apidocs/org/apache/struts2/dispatcher/ng/filter/StrutsPrepareFilter.html
> >
> > there is a brand new feature that musachy put in svn on monday to
> > specifically work-around action execute
> > i would ping him to see if this made was built into latest distro
> >
> > Thanks,
> > Martin Gainty
> > ______________________________________________
> > Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung/Note
> > de déni et de confidentialité
> > This message is confidential. If you should not be the intended receiver,
> > then we ask politely to report. Each unauthorized forwarding or
> > manufacturing of a copy is inadmissible. This message serves only for the
> > exchange of information and has no legal binding effect. Due to the easy
> > manipulation of emails we cannot take responsibility over the the contents.
> > Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
> > Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte
> > Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht
> > dient lediglich dem Austausch von Informationen und entfaltet keine
> > rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
> > E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> > Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le
> > destinataire prévu, nous te demandons avec bonté que pour satisfaire
> > informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie
> > de ceci est interdite. Ce message sert à l'information seulement et n'aura
> > pas n'importe quel effet légalement obligatoire. Étant donné que les email
> > peuvent facilement être sujets à la manipulation, nous ne pouvons accepter
> > aucune responsabilité pour le contenu fourni.
> >
> >
> >
> >
> > > Date: Thu, 14 May 2009 23:55:34 +0530
> > > Subject: Re: DWRValidator not working in Struts 2.1.6
> > > From: strutstwouser@gmail.com
> > > To: mgainty@hotmail.com; user@struts.apache.org
> >  >
> > > Just wanted to make sure my email reached the full users' list. I
> > > still havent been able to make any progress on this. Has anyone got
> > > the DWRValidator working in Struts 2.1?
> > >
> > > On 4/24/09, j alex <st...@gmail.com> wrote:
> > > > Martin,
> > > >
> > > > I want DWRServlet to handle only the Action validations, not Action
> > > > execution. I'm invoking the validator.doPost() when user tabs off a
> > field
> > > > in
> > > > order to validate the entered data.
> > > >
> > > > I couldn't find the example you are referring to in
> > > > http://struts.apache.org/2.1.6/docs/tutorials.html . Could you please
> > tell
> > > > me a specific link ?
> > > >
> > > > Thanks
> > > > s2user
> > > >
> > > >
> > > >
> > > > On Fri, Apr 24, 2009 at 7:50 PM, Martin Gainty <mg...@hotmail.com>
> > wrote:
> > > >
> > > >>  who handles the action execution DWRServlet or
> > > >> StrutsPrepareAndExecuteFilter?
> > > >>
> > > >> If you want to use DWRServlet to handle action execution you are
> > better
> > > >> off
> > > >> just using StrutsPrepareFilter to prepare the request as in this
> > example
> > > >>
> > > >>
> > > >>
> > http://struts.apache.org/2.1.6/struts2-core/apidocs/org/apache/struts2/dispatcher/ng/filter/StrutsPrepareFilter.html
> > > >>
> > > >> web.xml entry
> > > >>     <filter>
> > > >>         <filter-name>struts-prepare</filter-name>
> > > >>
> > > >>
> > <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter</filter-class>
> > > >>         <init-param>
> > > >>             <param-name>actionPackages</param-name>
> > > >>
> > <param-value>org.apache.struts2.showcase.person</param-value>
> > > >>         </init-param>
> > > >>     </filter>
> > > >>
> > > >> There is a very good example of StrutsPrepareFilter functionality
> > working
> > > >> in combination with DWRServlet in struts2-showcase tutorial located at
> > > >>
> > > >>
> > > >>
> > > >
> > >
> >  > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > For additional commands, e-mail: user-help@struts.apache.org
> > >
> >
> > _________________________________________________________________
> > Hotmail® has a new way to see what's up with your friends.
> >
> > http://windowslive.com/Tutorial/Hotmail/WhatsNew?ocid=TXT_TAGLM_WL_HM_Tutorial_WhatsNew1_052009
> >

_________________________________________________________________
Insert movie times and more without leaving Hotmail®.
http://windowslive.com/Tutorial/Hotmail/QuickAdd?ocid=TXT_TAGLM_WL_HM_Tutorial_QuickAdd1_052009

Re: DWRValidator not working in Struts 2.1.6

Posted by j alex <st...@gmail.com>.
martin,

i had seen the StrutsPrepareFilter API and as it says "Prepares the request
for execution by a later StrutsExecuteFilter filter instance. " . I've both
the StrutsPrepare and Execute filters configured plus the DWR servlet.

You were mentioning a working example of DWRValidator in the showcase, but i
couldn't find it.

My understanding is that when a DWR request is sent - it goes thru
StrutsPrepareFilter ,  StrutsExecuteFilter (which executes the Action
preceded by interceptor stack) , finally DWRServlet. So, by the time the
request reaches DWRServlet, it would have done the validations and the
errors would be populated.

The point i'm confused is that in DWRValidator doPost method, there's again
a call to execute the Action like :

ActionProxy proxy = actionProxyFactory.createActionProxy(inv, namespace,
mapping.getName(), mapping.getMethod(), *true*, *true*);
proxy.execute();
and this fails for some reason since valuestackfactory is null.

Thanks,
Joseph

On Fri, May 15, 2009 at 1:22 AM, Martin Gainty <mg...@hotmail.com> wrote:

>
> StrutsPrepareFilter documentation is available at
>
> http://struts.apache.org/2.1.6/struts2-core/apidocs/org/apache/struts2/dispatcher/ng/filter/StrutsPrepareFilter.html
>
> there is a brand new feature that musachy put in svn on monday to
> specifically work-around action execute
> i would ping him to see if this made was built into latest distro
>
> Thanks,
> Martin Gainty
> ______________________________________________
> Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung/Note
> de déni et de confidentialité
> This message is confidential. If you should not be the intended receiver,
> then we ask politely to report. Each unauthorized forwarding or
> manufacturing of a copy is inadmissible. This message serves only for the
> exchange of information and has no legal binding effect. Due to the easy
> manipulation of emails we cannot take responsibility over the the contents.
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
> Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte
> Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht
> dient lediglich dem Austausch von Informationen und entfaltet keine
> rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
> E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le
> destinataire prévu, nous te demandons avec bonté que pour satisfaire
> informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie
> de ceci est interdite. Ce message sert à l'information seulement et n'aura
> pas n'importe quel effet légalement obligatoire. Étant donné que les email
> peuvent facilement être sujets à la manipulation, nous ne pouvons accepter
> aucune responsabilité pour le contenu fourni.
>
>
>
>
> > Date: Thu, 14 May 2009 23:55:34 +0530
> > Subject: Re: DWRValidator not working in Struts 2.1.6
> > From: strutstwouser@gmail.com
> > To: mgainty@hotmail.com; user@struts.apache.org
>  >
> > Just wanted to make sure my email reached the full users' list. I
> > still havent been able to make any progress on this. Has anyone got
> > the DWRValidator working in Struts 2.1?
> >
> > On 4/24/09, j alex <st...@gmail.com> wrote:
> > > Martin,
> > >
> > > I want DWRServlet to handle only the Action validations, not Action
> > > execution. I'm invoking the validator.doPost() when user tabs off a
> field
> > > in
> > > order to validate the entered data.
> > >
> > > I couldn't find the example you are referring to in
> > > http://struts.apache.org/2.1.6/docs/tutorials.html . Could you please
> tell
> > > me a specific link ?
> > >
> > > Thanks
> > > s2user
> > >
> > >
> > >
> > > On Fri, Apr 24, 2009 at 7:50 PM, Martin Gainty <mg...@hotmail.com>
> wrote:
> > >
> > >>  who handles the action execution DWRServlet or
> > >> StrutsPrepareAndExecuteFilter?
> > >>
> > >> If you want to use DWRServlet to handle action execution you are
> better
> > >> off
> > >> just using StrutsPrepareFilter to prepare the request as in this
> example
> > >>
> > >>
> > >>
> http://struts.apache.org/2.1.6/struts2-core/apidocs/org/apache/struts2/dispatcher/ng/filter/StrutsPrepareFilter.html
> > >>
> > >> web.xml entry
> > >>     <filter>
> > >>         <filter-name>struts-prepare</filter-name>
> > >>
> > >>
> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter</filter-class>
> > >>         <init-param>
> > >>             <param-name>actionPackages</param-name>
> > >>
> <param-value>org.apache.struts2.showcase.person</param-value>
> > >>         </init-param>
> > >>     </filter>
> > >>
> > >> There is a very good example of StrutsPrepareFilter functionality
> working
> > >> in combination with DWRServlet in struts2-showcase tutorial located at
> > >>
> > >>
> > >>
> > >
> >
>  > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
>
> _________________________________________________________________
> Hotmail® has a new way to see what's up with your friends.
>
> http://windowslive.com/Tutorial/Hotmail/WhatsNew?ocid=TXT_TAGLM_WL_HM_Tutorial_WhatsNew1_052009
>

RE: DWRValidator not working in Struts 2.1.6

Posted by Martin Gainty <mg...@hotmail.com>.
StrutsPrepareFilter documentation is available at
http://struts.apache.org/2.1.6/struts2-core/apidocs/org/apache/struts2/dispatcher/ng/filter/StrutsPrepareFilter.html

there is a brand new feature that musachy put in svn on monday to specifically work-around action execute
i would ping him to see if this made was built into latest distro

Thanks,
Martin Gainty 
______________________________________________ 
Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
This message is confidential. If you should not be the intended receiver, then we ask politely to report. Each unauthorized forwarding or manufacturing of a copy is inadmissible. This message serves only for the exchange of information and has no legal binding effect. Due to the easy manipulation of emails we cannot take responsibility over the the contents.
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.




> Date: Thu, 14 May 2009 23:55:34 +0530
> Subject: Re: DWRValidator not working in Struts 2.1.6
> From: strutstwouser@gmail.com
> To: mgainty@hotmail.com; user@struts.apache.org
> 
> Just wanted to make sure my email reached the full users' list. I
> still havent been able to make any progress on this. Has anyone got
> the DWRValidator working in Struts 2.1?
> 
> On 4/24/09, j alex <st...@gmail.com> wrote:
> > Martin,
> >
> > I want DWRServlet to handle only the Action validations, not Action
> > execution. I'm invoking the validator.doPost() when user tabs off a field
> > in
> > order to validate the entered data.
> >
> > I couldn't find the example you are referring to in
> > http://struts.apache.org/2.1.6/docs/tutorials.html . Could you please tell
> > me a specific link ?
> >
> > Thanks
> > s2user
> >
> >
> >
> > On Fri, Apr 24, 2009 at 7:50 PM, Martin Gainty <mg...@hotmail.com> wrote:
> >
> >>  who handles the action execution DWRServlet or
> >> StrutsPrepareAndExecuteFilter?
> >>
> >> If you want to use DWRServlet to handle action execution you are better
> >> off
> >> just using StrutsPrepareFilter to prepare the request as in this example
> >>
> >>
> >> http://struts.apache.org/2.1.6/struts2-core/apidocs/org/apache/struts2/dispatcher/ng/filter/StrutsPrepareFilter.html
> >>
> >> web.xml entry
> >>     <filter>
> >>         <filter-name>struts-prepare</filter-name>
> >>
> >> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter</filter-class>
> >>         <init-param>
> >>             <param-name>actionPackages</param-name>
> >>             <param-value>org.apache.struts2.showcase.person</param-value>
> >>         </init-param>
> >>     </filter>
> >>
> >> There is a very good example of StrutsPrepareFilter functionality working
> >> in combination with DWRServlet in struts2-showcase tutorial located at
> >>
> >>
> >>
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 

_________________________________________________________________
Hotmail® has a new way to see what's up with your friends.
http://windowslive.com/Tutorial/Hotmail/WhatsNew?ocid=TXT_TAGLM_WL_HM_Tutorial_WhatsNew1_052009

Re: DWRValidator not working in Struts 2.1.6

Posted by j alex <st...@gmail.com>.
Just wanted to make sure my email reached the full users' list. I
still havent been able to make any progress on this. Has anyone got
the DWRValidator working in Struts 2.1?

On 4/24/09, j alex <st...@gmail.com> wrote:
> Martin,
>
> I want DWRServlet to handle only the Action validations, not Action
> execution. I'm invoking the validator.doPost() when user tabs off a field
> in
> order to validate the entered data.
>
> I couldn't find the example you are referring to in
> http://struts.apache.org/2.1.6/docs/tutorials.html . Could you please tell
> me a specific link ?
>
> Thanks
> s2user
>
>
>
> On Fri, Apr 24, 2009 at 7:50 PM, Martin Gainty <mg...@hotmail.com> wrote:
>
>>  who handles the action execution DWRServlet or
>> StrutsPrepareAndExecuteFilter?
>>
>> If you want to use DWRServlet to handle action execution you are better
>> off
>> just using StrutsPrepareFilter to prepare the request as in this example
>>
>>
>> http://struts.apache.org/2.1.6/struts2-core/apidocs/org/apache/struts2/dispatcher/ng/filter/StrutsPrepareFilter.html
>>
>> web.xml entry
>>     <filter>
>>         <filter-name>struts-prepare</filter-name>
>>
>> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter</filter-class>
>>         <init-param>
>>             <param-name>actionPackages</param-name>
>>             <param-value>org.apache.struts2.showcase.person</param-value>
>>         </init-param>
>>     </filter>
>>
>> There is a very good example of StrutsPrepareFilter functionality working
>> in combination with DWRServlet in struts2-showcase tutorial located at
>>
>>
>>
>

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