struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mr...@apache.org
Subject svn commit: r647439 - /struts/struts2/trunk/plugins/dwr/src/main/java/org/apache/struts2/validators/DWRValidator.java
Date Sat, 12 Apr 2008 12:16:42 GMT
Author: mrdon
Date: Sat Apr 12 05:16:41 2008
New Revision: 647439

URL: http://svn.apache.org/viewvc?rev=647439&view=rev
Log:
Fixing javadoc, minor code improvements
WW-2589

Modified:
    struts/struts2/trunk/plugins/dwr/src/main/java/org/apache/struts2/validators/DWRValidator.java

Modified: struts/struts2/trunk/plugins/dwr/src/main/java/org/apache/struts2/validators/DWRValidator.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/dwr/src/main/java/org/apache/struts2/validators/DWRValidator.java?rev=647439&r1=647438&r2=647439&view=diff
==============================================================================
--- struts/struts2/trunk/plugins/dwr/src/main/java/org/apache/struts2/validators/DWRValidator.java
(original)
+++ struts/struts2/trunk/plugins/dwr/src/main/java/org/apache/struts2/validators/DWRValidator.java
Sat Apr 12 05:16:41 2008
@@ -56,12 +56,12 @@
  * <pre>
  * <!-- START SNIPPET: dwrConfiguration -->
  *
- * &lt;dwr&lt;
- *    &lt;allow&lt;
- *      &lt;create creator="new" javascript="validator" class="org.apache.struts2.validators.DWRValidator"/&lt;
- *      &lt;convert converter="bean" match="com.opensymphony.xwork2.ValidationAwareSupport"/&lt;
- *    &lt;/allow&lt;
- * &lt;/dwr&lt;
+ * &lt;dwr&gt;
+ *    &lt;allow&gt;
+ *      &lt;create creator="new" javascript="validator" class="org.apache.struts2.validators.DWRValidator"/&gt;
+ *      &lt;convert converter="bean" match="com.opensymphony.xwork2.ValidationAwareSupport"/&gt;
+ *    &lt;/allow&gt;
+ * &lt;/dwr&gt;
  *
  * <!-- END SNIPPET: dwrConfiguration -->
  * </pre>
@@ -69,19 +69,6 @@
 public class DWRValidator {
     private static final Logger LOG = LoggerFactory.getLogger(DWRValidator.class);
     
-    private ActionProxyFactory actionProxyFactory;
-    private ActionMapper actionMapper;
-
-    @Inject
-    public void setActionMapper(ActionMapper actionMapper) {
-        this.actionMapper = actionMapper;
-    }
-
-    @Inject
-    public void setActionProxyFactory(ActionProxyFactory fac) {
-        this.actionProxyFactory = fac;
-    }
-
     public ValidationAwareSupport doPost(String namespace, String action, Map params) throws
Exception {
         HttpServletRequest req = WebContextFactory.get().getHttpServletRequest();
         ServletContext servletContext = WebContextFactory.get().getServletContext();
@@ -106,8 +93,10 @@
                 servletContext);
 
         try {
+            ActionMapper actionMapper = du.getContainer().getInstance(ActionMapper.class);
             ActionMapping mapping = actionMapper.getMappingFromActionName(action);
             ActionInvocation inv = new ValidatorActionInvocation(ctx, true);
+            ActionProxyFactory actionProxyFactory = du.getContainer().getInstance(ActionProxyFactory.class);
             ActionProxy proxy = actionProxyFactory.createActionProxy(inv, namespace, mapping.getName(),
mapping.getMethod(), true, true);
             proxy.execute();
             Object a = proxy.getAction();



Mime
View raw message