1. opensymphony
  2. webwork

Commits

mbogaert  committed fd05974

Fixed some javadoc and WW-695: JSP Form Tags does not have a target attribute.

git-svn-id: http://svn.opensymphony.com/svn/webwork/trunk@635573baa09-0c28-0410-bef9-dab3c582ae83

  • Participants
  • Parent commits d725a98
  • Branches master

Comments (0)

Files changed (4)

File src/etc/taglib.tld

View file
  • Ignore whitespace
             <rtexprvalue>true</rtexprvalue>
         </attribute>
         <attribute>
+            <name>target</name>
+            <required>false</required>
+            <rtexprvalue>true</rtexprvalue>
+        </attribute>
+        <attribute>
             <name>namespace</name>
             <required>false</required>
             <rtexprvalue>true</rtexprvalue>

File src/java/com/opensymphony/webwork/interceptor/PrincipalAware.java

View file
  • Ignore whitespace
  * <p>This interface is only relevant if the Action is used in a servlet environment.
  * By using this interface you will not become tied to servlet environment.</p>
  *
- * @see PrincipalInterceptor
- *
  * @author Remigijus Bauzys
  * @version $Revision$
  */

File src/java/com/opensymphony/webwork/views/jsp/ui/FormTag.java

View file
  • Ignore whitespace
     Class actionClass;
     List fieldParameters;
     List fieldValidators;
-    String actionAttr;
     String actionName;
+    JavaScriptValidationHolder javaScriptValidationHolder;
+
+    String actionAttr;
+    String targetAttr;
     String enctypeAttr;
     String methodAttr;
     String namespaceAttr;
     String validateAttr;
-    JavaScriptValidationHolder javaScriptValidationHolder;
-    
+
     //~ Methods ////////////////////////////////////////////////////////////////
 
     public void setAction(String action) {
         this.actionAttr = action;
     }
 
+    public void setTarget(String target) {
+        this.targetAttr = target;
+    }
+
     public Class getActionClass() {
         return actionClass;
     }
                 response = ServletActionContext.getResponse();
             }
 
-            String action = (String) findString(actionAttr);
+            final String action = (String) findString(actionAttr);
             String namespace;
 
             if (namespaceAttr == null) {
                 namespace = "";
             }
 
-            ActionConfig actionConfig = ConfigurationManager.getConfiguration().getRuntimeConfiguration().getActionConfig(namespace, action);
+            final ActionConfig actionConfig = ConfigurationManager.getConfiguration().getRuntimeConfiguration().getActionConfig(namespace, action);
 
             if (actionConfig != null) {
                 try {
                 String result = UrlHelper.buildUrl(action, request, response, null);
                 addParameter("action", result);
             }
-            
+
             // only create the javaScriptValidationHolder if the actionName,and class is known
             // and the javaScriptValidationHolder hasn't been created already
             // i.e. don'r re-create it on the second call to evaluateExtraParams
             }
         }
 
+        if (targetAttr != null) {
+            addParameter("target", findString(targetAttr));
+        }
+
         if (enctypeAttr != null) {
             addParameter("enctype", findString(enctypeAttr));
         }
         if (validateAttr != null) {
             addParameter("validate", findValue(validateAttr, Boolean.class));
         }
-        
-        
+
         if (javaScriptValidationHolder != null && javaScriptValidationHolder.hasValidators()) {
             addParameter("javascriptValidation", javaScriptValidationHolder.toJavaScript());
         } else {
     protected boolean evaluateNameValue() {
         return false;
     }
-    
+
     /**
      * Resets the attributes of this tag so that the tag may be reused.  As a general rule, only
      * properties that are not specified as an attribute or properties that are derived need to be
      */
     protected void reset() {
         super.reset();
-        
+
         javaScriptValidationHolder = null;
         if (getActionName() != null && getActionClass() != null) {
             javaScriptValidationHolder = new JavaScriptValidationHolder(getActionName(), getActionClass(), getStack());
         }
     }
-    
+
     /**
-     * provide access to the JavaScriptValidationHolder so that the AbstractUITag 
-     * can trigger the registration of all validators
+     * Provide access to the JavaScriptValidationHolder so that the AbstractUITag
+     * can trigger the registration of all validators.
      * @return
      */
     JavaScriptValidationHolder getJavaScriptValidationHolder() {

File src/java/template/simple/form.vm

View file
  • Ignore whitespace
 #if ($parameters.id)        id="$!webwork.htmlEncode($parameters.id)"           #end
 #if ($parameters.name)      name="$!webwork.htmlEncode($parameters.name)"       #end
 #if ($parameters.action)    action="$!webwork.htmlEncode($parameters.action)"   #end
+#if ($parameters.target)    target="$!webwork.htmlEncode($parameters.target)"   #end
 #if ($parameters.method)    method="$!webwork.htmlEncode($parameters.method)"   #end
 #if ($parameters.enctype)   enctype="$!webwork.htmlEncode($parameters.enctype)" #end
 #if ($parameters.validate)  onsubmit="return(${parameters.name}_validate())"    #end