mirror of
https://github.com/apache/struts.git
synced 2026-08-07 15:46:57 +00:00
Reverting bad commit that didn't properly merge changes with updated
code...what better way to spend a Saturday night... git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@439739 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -17,15 +17,14 @@
|
||||
*/
|
||||
package org.apache.struts2;
|
||||
|
||||
import java.util.Map;
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.jsp.PageContext;
|
||||
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
@@ -39,7 +38,6 @@ public class ServletActionContext extends ActionContext implements StrutsStatics
|
||||
|
||||
public static final String STRUTS_VALUESTACK_KEY = "struts.valueStack";
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private ServletActionContext(Map context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
@@ -122,6 +122,6 @@ public final class StrutsConstants {
|
||||
/** If static content served by the Struts filter should set browser caching header properties or not */
|
||||
public static final String STRUTS_SERVE_STATIC_BROWSER_CACHE = "struts.serve.static.browserCache";
|
||||
|
||||
/** Whether Struts is in WebWork 2.2 compatibility mode or not */
|
||||
public static final String STRUTS_COMPATIBILITY_MODE = "struts.compatibilityMode";
|
||||
/** Allows one to disable dynamic method invocation from the URL */
|
||||
public static final String STRUTS_ENABLE_DYNAMIC_METHOD_INVOCATION = "struts.enable.DynamicMethodInvocation";
|
||||
}
|
||||
|
||||
@@ -26,9 +26,6 @@ import com.opensymphony.xwork2.util.location.Locatable;
|
||||
*/
|
||||
public class StrutsException extends XWorkException implements Locatable {
|
||||
|
||||
private static final long serialVersionUID = 888724366243600135L;
|
||||
|
||||
|
||||
/**
|
||||
* Constructs a <code>StrutsException</code> with no detail message.
|
||||
*/
|
||||
|
||||
@@ -17,29 +17,28 @@
|
||||
*/
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Writer;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.jsp.PageContext;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
import org.apache.struts2.StrutsException;
|
||||
import org.apache.struts2.dispatcher.Dispatcher;
|
||||
import org.apache.struts2.dispatcher.RequestMap;
|
||||
import org.apache.struts2.views.jsp.TagUtils;
|
||||
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.ActionProxy;
|
||||
import com.opensymphony.xwork2.ActionProxyFactory;
|
||||
import com.opensymphony.xwork2.config.Configuration;
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.jsp.PageContext;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Writer;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
@@ -93,20 +92,20 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* <!-- START SNIPPET: example -->
|
||||
* <div>The following action tag will execute result and include it in this page</div>
|
||||
* <br />
|
||||
* <a:action name="actionTagAction" executeResult="true" />
|
||||
* <s:action name="actionTagAction" executeResult="true" />
|
||||
* <br />
|
||||
* <div>The following action tag will do the same as above, but invokes method specialMethod in action</div>
|
||||
* <br />
|
||||
* <a:action name="actionTagAction!specialMethod" executeResult="true" />
|
||||
* <s:action name="actionTagAction!specialMethod" executeResult="true" />
|
||||
* <br />
|
||||
* <div>The following action tag will not execute result, but put a String in request scope
|
||||
* under an id "stringByAction" which will be retrieved using property tag</div>
|
||||
* <a:action name="actionTagAction!default" executeResult="false" />
|
||||
* <a:property value="#attr.stringByAction" />
|
||||
* <s:action name="actionTagAction!default" executeResult="false" />
|
||||
* <s:property value="#attr.stringByAction" />
|
||||
* <!-- END SNIPPET: example -->
|
||||
* </pre>
|
||||
*
|
||||
* @a2.tag name="action" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ActionTag"
|
||||
* @s.tag name="action" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ActionTag"
|
||||
* description="Execute an action from within a view"
|
||||
*/
|
||||
public class ActionComponent extends Component {
|
||||
@@ -144,7 +143,7 @@ public class ActionComponent extends Component {
|
||||
} finally {
|
||||
popComponentStack();
|
||||
}
|
||||
return end;
|
||||
return end;
|
||||
}
|
||||
|
||||
private Map createExtraContext() {
|
||||
@@ -253,7 +252,7 @@ public class ActionComponent extends Component {
|
||||
|
||||
/**
|
||||
* the id (if speficied) to put the action under stack's context.
|
||||
* @a2.tagattribute required="false" type="String"
|
||||
* @s.tagattribute required="false" type="String"
|
||||
*/
|
||||
public void setId(String id) {
|
||||
super.setId(id);
|
||||
@@ -261,7 +260,7 @@ public class ActionComponent extends Component {
|
||||
|
||||
/**
|
||||
* name of the action to be executed (without the extension suffix eg. .action)
|
||||
* @a2.tagattribute required="true" type="String"
|
||||
* @s.tagattribute required="true" type="String"
|
||||
*/
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
@@ -269,7 +268,7 @@ public class ActionComponent extends Component {
|
||||
|
||||
/**
|
||||
* namespace for action to call
|
||||
* @a2.tagattribute required="false" type="String" default="namespace from where tag is used"
|
||||
* @s.tagattribute required="false" type="String" default="namespace from where tag is used"
|
||||
*/
|
||||
public void setNamespace(String namespace) {
|
||||
this.namespace = namespace;
|
||||
@@ -277,7 +276,7 @@ public class ActionComponent extends Component {
|
||||
|
||||
/**
|
||||
* whether the result of this action (probably a view) should be executed/rendered
|
||||
* @a2.tagattribute required="false" type="Boolean" default="false"
|
||||
* @s.tagattribute required="false" type="Boolean" default="false"
|
||||
*/
|
||||
public void setExecuteResult(boolean executeResult) {
|
||||
this.executeResult = executeResult;
|
||||
@@ -285,7 +284,7 @@ public class ActionComponent extends Component {
|
||||
|
||||
/**
|
||||
* whether the request parameters are to be included when the action is invoked
|
||||
* @a2.tagattribute required="false" type="Boolean" default="false"
|
||||
* @s.tagattribute required="false" type="Boolean" default="false"
|
||||
*/
|
||||
public void setIgnoreContextParams(boolean ignoreContextParams) {
|
||||
this.ignoreContextParams = ignoreContextParams;
|
||||
|
||||
@@ -17,15 +17,15 @@
|
||||
*/
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
*
|
||||
* Render action errors if they exists the specific layout of the rendering depends on
|
||||
* Render action errors if they exists the specific layout of the rendering depends on
|
||||
* the theme itself.
|
||||
*
|
||||
* <!-- END SNIPPET: javadoc -->
|
||||
@@ -34,16 +34,16 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
*
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example -->
|
||||
*
|
||||
* <a:actionerror />
|
||||
* <a:form .... >>
|
||||
*
|
||||
* <s:actionerror />
|
||||
* <s:form .... >>
|
||||
* ....
|
||||
* </a:form>
|
||||
*
|
||||
* </s:form>
|
||||
*
|
||||
* <!-- END SNIPPET: example -->
|
||||
* </pre>
|
||||
*
|
||||
* @a2.tag name="actionerror" tld-body-content="empty" tld-tag-class="org.apache.struts2.views.jsp.ui.ActionErrorTag"
|
||||
* @s.tag name="actionerror" tld-body-content="empty" tld-tag-class="org.apache.struts2.views.jsp.ui.ActionErrorTag"
|
||||
* description="Render action errors if they exists"
|
||||
*/
|
||||
public class ActionError extends UIBean {
|
||||
|
||||
@@ -17,11 +17,11 @@
|
||||
*/
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
*
|
||||
@@ -34,14 +34,14 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
*
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example -->
|
||||
* <a:actionmessage />
|
||||
* <a:form .... >
|
||||
* <s:actionmessage />
|
||||
* <s:form .... >
|
||||
* ....
|
||||
* </a:form>
|
||||
* </s:form>
|
||||
* <!-- END SNIPPET: example -->
|
||||
* </pre>
|
||||
*
|
||||
* @a2.tag name="actionmessage" tld-body-content="empty" tld-tag-class="org.apache.struts2.views.jsp.ui.ActionMessageTag"
|
||||
* @s.tag name="actionmessage" tld-body-content="empty" tld-tag-class="org.apache.struts2.views.jsp.ui.ActionMessageTag"
|
||||
* description="Render action messages if they exists"
|
||||
*/
|
||||
public class ActionMessage extends UIBean {
|
||||
|
||||
@@ -17,11 +17,11 @@
|
||||
*/
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
*
|
||||
@@ -35,10 +35,10 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
*
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example1 -->
|
||||
* <a:a id="link1" theme="ajax" href="/DoIt.action" errorText="An error ocurred" showErrorTransportText="true">
|
||||
* <s:a id="link1" theme="ajax" href="/DoIt.action" errorText="An error ocurred" showErrorTransportText="true">
|
||||
* <img border="none" src="<%=request.getContextPath()%>/images/delete.gif"/>
|
||||
* <a:param name="id" value="1"/>
|
||||
* </a:a>
|
||||
* <s:param name="id" value="1"/>
|
||||
* </s:a>
|
||||
* <!-- END SNIPPET: example1 -->
|
||||
* </pre>
|
||||
*
|
||||
@@ -71,13 +71,13 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
*
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example3 -->
|
||||
* <a:a id="test" theme="ajax" href="/simpeResult.action" preInvokeJS="confirm(\'You sure\')">
|
||||
* <s:a id="test" theme="ajax" href="/simpeResult.action" preInvokeJS="confirm(\'You sure\')">
|
||||
* A
|
||||
* </a:a>
|
||||
* </s:a>
|
||||
* <!-- END SNIPPET: example3 -->
|
||||
* </pre>
|
||||
*
|
||||
* @a2.tag name="a" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.AnchorTag"
|
||||
* @s.tag name="a" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.AnchorTag"
|
||||
* description="Render a HTML href element that when clicked calls a URL via remote XMLHttpRequest"
|
||||
*
|
||||
*/
|
||||
@@ -115,7 +115,7 @@ public class Anchor extends RemoteCallUIBean {
|
||||
|
||||
/**
|
||||
* The id to assign the component
|
||||
* @a2.tagattribute required="false" type="String"
|
||||
* @s.tagattribute required="false" type="String"
|
||||
*/
|
||||
public void setId(String id) {
|
||||
super.setId(id);
|
||||
@@ -123,7 +123,7 @@ public class Anchor extends RemoteCallUIBean {
|
||||
|
||||
/**
|
||||
* Topic names to post an event to after the remote call has been made
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setNotifyTopics(String notifyTopics) {
|
||||
this.notifyTopics = notifyTopics;
|
||||
@@ -131,7 +131,7 @@ public class Anchor extends RemoteCallUIBean {
|
||||
|
||||
/**
|
||||
* A javascript snippet that will be invoked prior to the execution of the target href. If provided must return true or false. True indicates to continue executing target, false says do not execute link target. Possible uses are for confirm dialogs.
|
||||
* @a2.tagattribute required="false" type="String"
|
||||
* @s.tagattribute required="false" type="String"
|
||||
*/
|
||||
public void setPreInvokeJS(String preInvokeJS) {
|
||||
this.preInvokeJS = preInvokeJS;
|
||||
|
||||
@@ -24,10 +24,10 @@ import java.util.List;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import org.apache.struts2.components.Param.UnnamedParametric;
|
||||
import org.apache.struts2.util.AppendIteratorFilter;
|
||||
import org.apache.struts2.util.MakeIterator;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
/**
|
||||
@@ -95,21 +95,21 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* <!-- END SNIPPET: code -->
|
||||
*
|
||||
* <!-- START SNIPPET: example -->
|
||||
* <a:append id="myAppendIterator">
|
||||
* <a:param value="%{myList1}" />
|
||||
* <a:param value="%{myList2}" />
|
||||
* <a:param value="%{myList3}" />
|
||||
* </a:append>
|
||||
* <a:iterator value="%{#myAppendIterator}">
|
||||
* <a:property />
|
||||
* </a:iterator>
|
||||
* <s:append id="myAppendIterator">
|
||||
* <s:param value="%{myList1}" />
|
||||
* <s:param value="%{myList2}" />
|
||||
* <s:param value="%{myList3}" />
|
||||
* </s:append>
|
||||
* <s:iterator value="%{#myAppendIterator}">
|
||||
* <s:property />
|
||||
* </s:iterator>
|
||||
* <!-- END SNIPPET: example -->
|
||||
*
|
||||
*
|
||||
* @see org.apache.struts2.util.AppendIteratorFilter
|
||||
* @see org.apache.struts2.views.jsp.iterator.AppendIteratorTag
|
||||
*
|
||||
* @a2.tag name="append" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.iterator.AppendIteratorTag"
|
||||
* @s.tag name="append" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.iterator.AppendIteratorTag"
|
||||
* description="Append the values of a list of iterators to one iterator"
|
||||
*/
|
||||
public class AppendIterator extends Component implements UnnamedParametric {
|
||||
@@ -160,7 +160,7 @@ public class AppendIterator extends Component implements UnnamedParametric {
|
||||
|
||||
/**
|
||||
* the id of which if supplied will have the resultant appended iterator stored under in the stack's context
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setId(String id) {
|
||||
super.setId(id);
|
||||
|
||||
@@ -17,15 +17,14 @@
|
||||
*/
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import java.io.Writer;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import com.opensymphony.util.ClassLoaderUtil;
|
||||
import com.opensymphony.xwork2.ObjectFactory;
|
||||
import com.opensymphony.xwork2.util.OgnlUtil;
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import java.io.Writer;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
@@ -51,16 +50,16 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: examples -->
|
||||
* <-- in freemarker form -->
|
||||
* [ww.bean name="org.apache.struts2.example.counter.SimpleCounter" id="counter"]
|
||||
* [a:param name="foo" value="BAR"/]
|
||||
* The value of foo is : [a:property value="foo"/], when inside the bean tag.<br />
|
||||
* [/a:bean]
|
||||
* [@s.bean name="org.apache.struts2.example.counter.SimpleCounter" id="counter"]
|
||||
* [s:param name="foo" value="BAR"/]
|
||||
* The value of foo is : [s:property value="foo"/], when inside the bean tag.<br />
|
||||
* [/s:bean]
|
||||
*
|
||||
* <-- in jsp form -->
|
||||
* <a:bean name="org.apache.struts2.example.counter.SimpleCounter" id="counter">
|
||||
* <a:param name="foo" value="BAR" />
|
||||
* The value of foot is : <a:property value="foo"/>, when inside the bean tag <br />
|
||||
* </a:bean>
|
||||
* <s:bean name="org.apache.struts2.example.counter.SimpleCounter" id="counter">
|
||||
* <s:param name="foo" value="BAR" />
|
||||
* The value of foot is : <s:property value="foo"/>, when inside the bean tag <br />
|
||||
* </s:bean>
|
||||
* <!-- END SNIPPET: examples -->
|
||||
* </pre>
|
||||
* <p/>
|
||||
@@ -71,14 +70,14 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* with the Property tag and get their values.</p>
|
||||
* <p/>
|
||||
* <p>In the above example, the id has been set to a value of <i>counter</i>. This means that the SimpleCounter class
|
||||
* will be placed into the stack's context. You can access the SimpleCounter class using WW's tag:</p>
|
||||
* will be placed into the stack's context. You can access the SimpleCounter class using a Struts tag:</p>
|
||||
* <p/>
|
||||
* <pre>
|
||||
* <-- jsp form -->
|
||||
* <a:property value="#counter" />
|
||||
* <s:property value="#counter" />
|
||||
*
|
||||
* <-- freemarker form -->
|
||||
* [a:property value="#counter.foo"/]
|
||||
* [s:property value="#counter.foo"/]
|
||||
* </pre>
|
||||
* <p/>
|
||||
* <p>In the property tag example, the <i>#</i> tells Ognl to search the context for the SimpleCounter class which has
|
||||
@@ -87,7 +86,7 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
*
|
||||
* @see Param
|
||||
*
|
||||
* @a2.tag name="bean" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.BeanTag"
|
||||
* @s.tag name="bean" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.BeanTag"
|
||||
* description="Instantiate a JavaBean and place it in the context."
|
||||
*/
|
||||
public class Bean extends Component {
|
||||
@@ -138,7 +137,7 @@ public class Bean extends Component {
|
||||
|
||||
/**
|
||||
* the class name of the bean to be instantiated (must respect JavaBean specification)
|
||||
* @a2.tagattribute required="true" type="String"
|
||||
* @s.tagattribute required="true" type="String"
|
||||
*/
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
|
||||
@@ -17,11 +17,11 @@
|
||||
*/
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
* Renders an HTML input element of type checkbox, populated by the specified property from the OgnlValueStack.
|
||||
@@ -32,7 +32,7 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example -->
|
||||
* JSP:
|
||||
* <a:checkbox label="checkbox test" name="checkboxField1" value="aBoolean" fieldValue="true"/>
|
||||
* <s:checkbox label="checkbox test" name="checkboxField1" value="aBoolean" fieldValue="true"/>
|
||||
*
|
||||
* Velocity:
|
||||
* #tag( Checkbox "label=checkbox test" "name=checkboxField1" "value=aBoolean" )
|
||||
@@ -43,7 +43,7 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* <!-- END SNIPPET: example -->
|
||||
* </pre>
|
||||
*
|
||||
* @a2.tag name="checkbox" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.CheckboxTag"
|
||||
* @s.tag name="checkbox" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.CheckboxTag"
|
||||
* description="Render a checkbox input field"
|
||||
*/
|
||||
public class Checkbox extends UIBean {
|
||||
@@ -73,7 +73,7 @@ public class Checkbox extends UIBean {
|
||||
|
||||
/**
|
||||
* The actual HTML value attribute of the checkbox.
|
||||
* @a2.tagattribute required="false" default="'true'"
|
||||
* @s.tagattribute required="false" default="'true'"
|
||||
*/
|
||||
public void setFieldValue(String fieldValue) {
|
||||
this.fieldValue = fieldValue;
|
||||
|
||||
@@ -17,15 +17,15 @@
|
||||
*/
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
*
|
||||
* Creates a series of checkboxes from a list. Setup is like <a:select /> or <a:radio />, but creates checkbox tags.
|
||||
* Creates a series of checkboxes from a list. Setup is like <s:select /> or <s:radio />, but creates checkbox tags.
|
||||
*
|
||||
* <!-- END SNIPPET: javadoc -->
|
||||
*
|
||||
@@ -33,11 +33,11 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
*
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example -->
|
||||
* <a:checkboxlist name="foo" list="bar"/>
|
||||
* <s:checkboxlist name="foo" list="bar"/>
|
||||
* <!-- END SNIPPET: example -->
|
||||
* </pre>
|
||||
*
|
||||
* @a2.tag name="checkboxlist" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.CheckboxListTag"
|
||||
* @s.tag name="checkboxlist" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.CheckboxListTag"
|
||||
* description="Render a list of checkboxes"
|
||||
*/
|
||||
public class CheckboxList extends ListUIBean {
|
||||
|
||||
@@ -17,15 +17,13 @@
|
||||
*/
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import java.io.Writer;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.Writer;
|
||||
|
||||
/**
|
||||
* ClosingUIBean is the standard superclass for UI components such as div etc.
|
||||
@@ -43,7 +41,7 @@ public abstract class ClosingUIBean extends UIBean {
|
||||
|
||||
/**
|
||||
* Set template to use for opening the rendered html.
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setOpenTemplate(String openTemplate) {
|
||||
this.openTemplate = openTemplate;
|
||||
|
||||
@@ -17,17 +17,19 @@
|
||||
*/
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import java.lang.reflect.Array;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.util.MakeIterator;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
* The combo box is basically an HTML INPUT of type text and HTML SELECT grouped together to give you a combo box
|
||||
@@ -38,7 +40,7 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* span from first to last. The population is done via javascript, and requires that this tag be surrounded by a
|
||||
* <form>.<p/>
|
||||
*
|
||||
* Note that unlike the <a:select/> tag, there is no ability to define the individual <option> tags' id attribute
|
||||
* Note that unlike the <s:select/> tag, there is no ability to define the individual <option> tags' id attribute
|
||||
* or content separately. Each of these is simply populated from the toString() method of the list item. Presumably
|
||||
* this is because the select box isn't intended to actually submit useful data, but to assist the user in filling
|
||||
* out the text field.<p/>
|
||||
@@ -50,15 +52,15 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* <!-- START SNIPPET: example -->
|
||||
* JSP:
|
||||
* <-- Example One -->
|
||||
* <a:bean name="struts.util.Counter" id="year">
|
||||
* <a:param name="first" value="text('firstBirthYear')"/>
|
||||
* <a:param name="last" value="2000"/>
|
||||
* <s:bean name="struts.util.Counter" id="year">
|
||||
* <s:param name="first" value="text('firstBirthYear')"/>
|
||||
* <s:param name="last" value="2000"/>
|
||||
*
|
||||
* <a:combobox label="Birth year" size="6" maxlength="4" name="birthYear" list="#year"/>
|
||||
* </a:bean>
|
||||
* <s:combobox label="Birth year" size="6" maxlength="4" name="birthYear" list="#year"/>
|
||||
* </s:bean>
|
||||
*
|
||||
* <-- Example Two -->
|
||||
* <a:combobox
|
||||
* <s:combobox
|
||||
* label="My Favourite Fruit"
|
||||
* name="myFavouriteFruit"
|
||||
* list="{'apple','banana','grape','pear'}"
|
||||
@@ -68,7 +70,7 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* value="banana" />
|
||||
*
|
||||
* <-- Example Two -->
|
||||
* <a:combobox
|
||||
* <s:combobox
|
||||
* label="My Favourite Color"
|
||||
* name="myFavouriteColor"
|
||||
* list="#{'red':'red','green':'green','blue':'blue'}"
|
||||
@@ -82,7 +84,7 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* <!-- END SNIPPET: example -->
|
||||
* </pre>
|
||||
*
|
||||
* @a2.tag name="combobox" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.ComboBoxTag"
|
||||
* @s.tag name="combobox" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.ComboBoxTag"
|
||||
* description="Widget that fills a text box from a select"
|
||||
*/
|
||||
public class ComboBox extends TextField {
|
||||
@@ -161,7 +163,7 @@ public class ComboBox extends TextField {
|
||||
|
||||
/**
|
||||
* Iteratable source to populate from. If this is missing, the select widget is simply not displayed.
|
||||
* @a2.tagattribute required="true"
|
||||
* @s.tagattribute required="true"
|
||||
*/
|
||||
public void setList(String list) {
|
||||
this.list = list;
|
||||
@@ -169,7 +171,7 @@ public class ComboBox extends TextField {
|
||||
|
||||
/**
|
||||
* Decide if an empty option is to be inserted. Default false.
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setEmptyOption(String emptyOption) {
|
||||
this.emptyOption = emptyOption;
|
||||
@@ -177,7 +179,7 @@ public class ComboBox extends TextField {
|
||||
|
||||
/**
|
||||
* set the header key for the header option.
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setHeaderKey(String headerKey) {
|
||||
this.headerKey = headerKey;
|
||||
@@ -185,7 +187,7 @@ public class ComboBox extends TextField {
|
||||
|
||||
/**
|
||||
* set the header value for the header option.
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setHeaderValue(String headerValue) {
|
||||
this.headerValue = headerValue;
|
||||
@@ -193,7 +195,7 @@ public class ComboBox extends TextField {
|
||||
|
||||
/**
|
||||
* set the key used to retrive the option key.
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setListKey(String listKey) {
|
||||
this.listKey = listKey;
|
||||
@@ -201,7 +203,7 @@ public class ComboBox extends TextField {
|
||||
|
||||
/**
|
||||
* set the value used to retrive the option value.
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setListValue(String listValue) {
|
||||
this.listValue = listValue;
|
||||
|
||||
@@ -17,6 +17,21 @@
|
||||
*/
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import org.apache.struts2.StrutsException;
|
||||
import org.apache.struts2.util.FastByteArrayOutputStream;
|
||||
import org.apache.struts2.views.jsp.TagUtils;
|
||||
import org.apache.struts2.views.util.ContextUtil;
|
||||
import org.apache.struts2.views.util.UrlHelper;
|
||||
import org.apache.struts2.dispatcher.mapper.ActionMapping;
|
||||
import org.apache.struts2.dispatcher.mapper.ActionMapper;
|
||||
import org.apache.struts2.dispatcher.mapper.ActionMapperFactory;
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
import com.opensymphony.xwork2.util.TextParseUtil;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.Writer;
|
||||
@@ -25,21 +40,6 @@ import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Stack;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.StrutsException;
|
||||
import org.apache.struts2.dispatcher.mapper.ActionMapper;
|
||||
import org.apache.struts2.dispatcher.mapper.ActionMapperFactory;
|
||||
import org.apache.struts2.dispatcher.mapper.ActionMapping;
|
||||
import org.apache.struts2.util.FastByteArrayOutputStream;
|
||||
import org.apache.struts2.views.jsp.TagUtils;
|
||||
import org.apache.struts2.views.util.ContextUtil;
|
||||
import org.apache.struts2.views.util.UrlHelper;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
import com.opensymphony.xwork2.util.TextParseUtil;
|
||||
|
||||
/**
|
||||
* Base class to extend for UI components.
|
||||
* <p/>
|
||||
@@ -47,6 +47,8 @@ import com.opensymphony.xwork2.util.TextParseUtil;
|
||||
*
|
||||
*/
|
||||
public class Component {
|
||||
private static final Log LOG = LogFactory.getLog(Component.class);
|
||||
|
||||
public static final String COMPONENT_STACK = "__component_stack";
|
||||
|
||||
protected OgnlValueStack stack;
|
||||
@@ -322,6 +324,7 @@ public class Component {
|
||||
* @param scheme http or https
|
||||
* @param includeContext should the context path be included or not
|
||||
* @param encodeResult should the url be encoded
|
||||
* @deprecated Since Struts 2.0.0
|
||||
* @return the action url.
|
||||
*/
|
||||
protected String determineActionURL(String action, String namespace, String method,
|
||||
@@ -335,6 +338,25 @@ public class Component {
|
||||
return UrlHelper.buildUrl(uri, req, res, parameters, scheme, includeContext, encodeResult);
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders an action URL by consulting the {@link org.apache.struts2.dispatcher.mapper.ActionMapper}.
|
||||
* @param action the action
|
||||
* @param namespace the namespace
|
||||
* @param req HTTP request
|
||||
* @param res HTTP response
|
||||
* @param parameters parameters
|
||||
* @param scheme http or https
|
||||
* @param includeContext should the context path be included or not
|
||||
* @param encodeResult should the url be encoded
|
||||
* @return the action url.
|
||||
*/
|
||||
protected String determineActionURL(String action, String namespace,
|
||||
HttpServletRequest req, HttpServletResponse res, Map parameters, String scheme,
|
||||
boolean includeContext, boolean encodeResult) {
|
||||
return determineActionURL(action, namespace, null, req, res, parameters,
|
||||
scheme, includeContext, encodeResult);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines the namespace of the current page being renderdd. Useful for Form, URL, and href generations.
|
||||
* @param namespace the namespace
|
||||
@@ -442,7 +464,7 @@ public class Component {
|
||||
|
||||
/**
|
||||
* id for referencing element. For UI and form tags it will be used as HTML id attribute
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setId(String id) {
|
||||
if (id != null) {
|
||||
|
||||
@@ -17,6 +17,12 @@
|
||||
*/
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.TextProvider;
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Writer;
|
||||
import java.text.DateFormat;
|
||||
@@ -25,13 +31,6 @@ import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.TextProvider;
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
*
|
||||
@@ -123,16 +122,16 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* <p/> <b>Examples</b>
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example -->
|
||||
* <a:date name="person.birthday" format="dd/MM/yyyy" />
|
||||
* <a:date name="person.birthday" format="%{getText('some.i18n.key')}" />
|
||||
* <a:date name="person.birthday" nice="true" />
|
||||
* <a:date name="person.birthday" />
|
||||
* <s:date name="person.birthday" format="dd/MM/yyyy" />
|
||||
* <s:date name="person.birthday" format="%{getText('some.i18n.key')}" />
|
||||
* <s:date name="person.birthday" nice="true" />
|
||||
* <s:date name="person.birthday" />
|
||||
* <!-- END SNIPPET: example -->
|
||||
* </pre>
|
||||
*
|
||||
* <code>Date</code>
|
||||
*
|
||||
* @a2.tag name="date" tld-body-content="empty"
|
||||
* @s.tag name="date" tld-body-content="empty"
|
||||
* tld-tag-class="org.apache.struts2.views.jsp.DateTag"
|
||||
* description="Render a formatted date."
|
||||
*/
|
||||
@@ -336,7 +335,7 @@ public class Date extends Component {
|
||||
/**
|
||||
* Date or DateTime format pattern
|
||||
*
|
||||
* @a2.tagattribute required="false" rtexprvalue="false"
|
||||
* @s.tagattribute required="false" rtexprvalue="false"
|
||||
*/
|
||||
public void setFormat(String format) {
|
||||
this.format = format;
|
||||
@@ -345,7 +344,7 @@ public class Date extends Component {
|
||||
/**
|
||||
* Whether to print out the date nicely
|
||||
*
|
||||
* @a2.tagattribute required="false" type="Boolean" default="false"
|
||||
* @s.tagattribute required="false" type="Boolean" default="false"
|
||||
*/
|
||||
public void setNice(boolean nice) {
|
||||
this.nice = nice;
|
||||
@@ -361,7 +360,7 @@ public class Date extends Component {
|
||||
/**
|
||||
* The date value to format
|
||||
*
|
||||
* @a2.tagattribute required="true" type="String"
|
||||
* @s.tagattribute required="true" type="String"
|
||||
*/
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
|
||||
@@ -17,11 +17,11 @@
|
||||
*/
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
*
|
||||
@@ -72,9 +72,9 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* <!-- START SNIPPET: expl1 -->
|
||||
*
|
||||
* Example 1:
|
||||
* <a:datepicker name="order.date" label="Order Date" />
|
||||
* <s:datepicker name="order.date" label="Order Date" />
|
||||
* Example 2:
|
||||
* <a:datepicker name="delivery.date" label="Delivery Date" format="#yyyy-#MM-#dd" />
|
||||
* <s:datepicker name="delivery.date" label="Delivery Date" format="#yyyy-#MM-#dd" />
|
||||
*
|
||||
* <!-- END SNIPPET: expl1 -->
|
||||
* </pre>
|
||||
@@ -89,12 +89,12 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: expl2 -->
|
||||
*
|
||||
* <a:datepicker name="birthday" label="Birthday" templateCss="...." />
|
||||
* <s:datepicker name="birthday" label="Birthday" templateCss="...." />
|
||||
*
|
||||
* <!-- END SNIPPET: expl2 -->
|
||||
* </pre>
|
||||
*
|
||||
* @a2.tag name="datepicker" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.DatePickerTag"
|
||||
* @s.tag name="datepicker" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.DatePickerTag"
|
||||
* description="Render datepicker"
|
||||
*/
|
||||
public class DatePicker extends TextField {
|
||||
@@ -137,7 +137,7 @@ public class DatePicker extends TextField {
|
||||
|
||||
/**
|
||||
* The format to use for date field.
|
||||
* @a2.tagattribute required="false" type="String" default="Dateformat specified by language preset (%Y/%m/%d for en)"
|
||||
* @s.tagattribute required="false" type="String" default="Dateformat specified by language preset (%Y/%m/%d for en)"
|
||||
*/
|
||||
public void setFormat(String format) {
|
||||
this.format = format;
|
||||
@@ -145,7 +145,7 @@ public class DatePicker extends TextField {
|
||||
|
||||
/**
|
||||
* The date picker icon path
|
||||
* @a2.tagattribute required="false" type="String" default="/struts/dojo/struts/widgets/dateIcon.gif"
|
||||
* @s.tagattribute required="false" type="String" default="/struts/dojo/struts/widgets/dateIcon.gif"
|
||||
*/
|
||||
public void setDateIconPath(String dateIconPath) {
|
||||
this.dateIconPath = dateIconPath;
|
||||
@@ -153,7 +153,7 @@ public class DatePicker extends TextField {
|
||||
|
||||
/**
|
||||
* The datepicker template path.
|
||||
* @a2.tagattribute required="false" type="String"
|
||||
* @s.tagattribute required="false" type="String"
|
||||
*/
|
||||
public void setTemplatePath(String templatePath) {
|
||||
this.templatePath = templatePath;
|
||||
@@ -161,7 +161,7 @@ public class DatePicker extends TextField {
|
||||
|
||||
/**
|
||||
* The datepicker template css path.
|
||||
* @a2.tagattribute required="false" type="String"
|
||||
* @s.tagattribute required="false" type="String"
|
||||
*/
|
||||
public void setTemplateCssPath(String templateCssPath) {
|
||||
this.templateCssPath = templateCssPath;
|
||||
@@ -169,7 +169,7 @@ public class DatePicker extends TextField {
|
||||
|
||||
/**
|
||||
* The datepicker text field size.
|
||||
* @a2.tagattribute required="false" type="String"
|
||||
* @s.tagattribute required="false" type="String"
|
||||
*/
|
||||
public void setSize(String size) {
|
||||
this.size = size;
|
||||
|
||||
@@ -17,14 +17,14 @@
|
||||
*/
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.struts2.views.util.UrlHelper;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
@@ -44,11 +44,11 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
*
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example -->
|
||||
* <a:div ... />
|
||||
* <s:div ... />
|
||||
* <!-- END SNIPPET: example -->
|
||||
* </pre>
|
||||
*
|
||||
* @a2.tag name="div" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.DivTag"
|
||||
* @s.tag name="div" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.DivTag"
|
||||
* description="Render HTML div providing content from remote call via AJAX"
|
||||
*/
|
||||
public class Div extends RemoteCallUIBean {
|
||||
@@ -126,7 +126,7 @@ public class Div extends RemoteCallUIBean {
|
||||
|
||||
/**
|
||||
* How often to re-fetch the content (in milliseconds)
|
||||
* @a2.tagattribute required="false" type="Integer" default="0"
|
||||
* @s.tagattribute required="false" type="Integer" default="0"
|
||||
*/
|
||||
public void setUpdateFreq(String updateFreq) {
|
||||
this.updateFreq = updateFreq;
|
||||
@@ -134,7 +134,7 @@ public class Div extends RemoteCallUIBean {
|
||||
|
||||
/**
|
||||
* How long to wait before fetching the content (in milliseconds)
|
||||
* @a2.tagattribute required="false" type="Integer" default="0"
|
||||
* @s.tagattribute required="false" type="Integer" default="0"
|
||||
*/
|
||||
public void setDelay(String delay) {
|
||||
this.delay = delay;
|
||||
@@ -142,7 +142,7 @@ public class Div extends RemoteCallUIBean {
|
||||
|
||||
/**
|
||||
* The text to display to the user while the new content is being fetched (especially good if the content will take awhile)
|
||||
* @a2.tagattribute required="false" rtexprvalue="true"
|
||||
* @s.tagattribute required="false" rtexprvalue="true"
|
||||
*/
|
||||
public void setLoadingText(String loadingText) {
|
||||
this.loadingText = loadingText;
|
||||
@@ -150,7 +150,7 @@ public class Div extends RemoteCallUIBean {
|
||||
|
||||
/**
|
||||
* Topic name to listen to (comma delimited), that will cause the DIV's content to be re-fetched
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setListenTopics(String listenTopics) {
|
||||
this.listenTopics = listenTopics;
|
||||
|
||||
@@ -19,11 +19,11 @@ package org.apache.struts2.components;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
/**
|
||||
* DoubleListUIBean is the standard superclass of all Struts double list handling components.
|
||||
*
|
||||
@@ -257,7 +257,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
|
||||
/**
|
||||
* The second iterable source to populate from.
|
||||
* @a2.tagattribute required="true"
|
||||
* @s.tagattribute required="true"
|
||||
*/
|
||||
public void setDoubleList(String doubleList) {
|
||||
this.doubleList = doubleList;
|
||||
@@ -265,7 +265,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
|
||||
/**
|
||||
* The key expression to use for second list
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setDoubleListKey(String doubleListKey) {
|
||||
this.doubleListKey = doubleListKey;
|
||||
@@ -273,7 +273,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
|
||||
/**
|
||||
* The value expression to use for second list
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setDoubleListValue(String doubleListValue) {
|
||||
this.doubleListValue = doubleListValue;
|
||||
@@ -281,7 +281,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
|
||||
/**
|
||||
* The name for complete component
|
||||
* @a2.tagattribute required="true"
|
||||
* @s.tagattribute required="true"
|
||||
*/
|
||||
public void setDoubleName(String doubleName) {
|
||||
this.doubleName = doubleName;
|
||||
@@ -289,7 +289,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
|
||||
/**
|
||||
* The value expression for complete component
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setDoubleValue(String doubleValue) {
|
||||
this.doubleValue = doubleValue;
|
||||
@@ -297,7 +297,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
|
||||
/**
|
||||
* The form name this component resides in and populates to
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setFormName(String formName) {
|
||||
this.formName = formName;
|
||||
@@ -309,7 +309,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
|
||||
/**
|
||||
* The css class for the second list
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setDoubleCssClass(String doubleCssClass) {
|
||||
this.doubleCssClass = doubleCssClass;
|
||||
@@ -321,7 +321,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
|
||||
/**
|
||||
* The css style for the second list
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setDoubleCssStyle(String doubleCssStyle) {
|
||||
this.doubleCssStyle = doubleCssStyle;
|
||||
@@ -333,7 +333,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
|
||||
/**
|
||||
* The header key for the second list
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setDoubleHeaderKey(String doubleHeaderKey) {
|
||||
this.doubleHeaderKey = doubleHeaderKey;
|
||||
@@ -345,7 +345,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
|
||||
/**
|
||||
* The header value for the second list
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setDoubleHeaderValue(String doubleHeaderValue) {
|
||||
this.doubleHeaderValue = doubleHeaderValue;
|
||||
@@ -357,7 +357,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
|
||||
/**
|
||||
* Decides if the second list will add an empty option
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setDoubleEmptyOption(String doubleEmptyOption) {
|
||||
this.doubleEmptyOption = doubleEmptyOption;
|
||||
@@ -374,7 +374,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
|
||||
/**
|
||||
* Decides if a disable attribute should be added to the second list
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setDoubleDisabled(String doubleDisabled) {
|
||||
this.doubleDisabled = doubleDisabled;
|
||||
@@ -386,7 +386,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
|
||||
/**
|
||||
* The id of the second list
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setDoubleId(String doubleId) {
|
||||
this.doubleId = doubleId;
|
||||
@@ -398,7 +398,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
|
||||
/**
|
||||
* Decides if multiple attribute should be set on the second list
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setDoubleMultiple(String doubleMultiple) {
|
||||
this.doubleMultiple = doubleMultiple;
|
||||
@@ -410,7 +410,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
|
||||
/**
|
||||
* Set the onblur attribute of the second list
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setDoubleOnblur(String doubleOnblur) {
|
||||
this.doubleOnblur = doubleOnblur;
|
||||
@@ -422,7 +422,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
|
||||
/**
|
||||
* Set the onchange attribute of the second list
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setDoubleOnchange(String doubleOnchange) {
|
||||
this.doubleOnchange = doubleOnchange;
|
||||
@@ -434,7 +434,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
|
||||
/**
|
||||
* Set the onclick attribute of the second list
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setDoubleOnclick(String doubleOnclick) {
|
||||
this.doubleOnclick = doubleOnclick;
|
||||
@@ -446,7 +446,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
|
||||
/**
|
||||
* Set the ondbclick attribute of the second list
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setDoubleOndblclick(String doubleOndblclick) {
|
||||
this.doubleOndblclick = doubleOndblclick;
|
||||
@@ -458,7 +458,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
|
||||
/**
|
||||
* Set the onfocus attribute of the second list
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setDoubleOnfocus(String doubleOnfocus) {
|
||||
this.doubleOnfocus = doubleOnfocus;
|
||||
@@ -470,7 +470,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
|
||||
/**
|
||||
* Set the onkeydown attribute of the second list
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setDoubleOnkeydown(String doubleOnkeydown) {
|
||||
this.doubleOnkeydown = doubleOnkeydown;
|
||||
@@ -482,7 +482,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
|
||||
/**
|
||||
* Set the onkeypress attribute of the second list
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setDoubleOnkeypress(String doubleOnkeypress) {
|
||||
this.doubleOnkeypress = doubleOnkeypress;
|
||||
@@ -494,7 +494,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
|
||||
/**
|
||||
* Set the onkeyup attribute of the second list
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setDoubleOnkeyup(String doubleOnkeyup) {
|
||||
this.doubleOnkeyup = doubleOnkeyup;
|
||||
@@ -506,7 +506,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
|
||||
/**
|
||||
* Set the onmousedown attribute of the second list
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setDoubleOnmousedown(String doubleOnmousedown) {
|
||||
this.doubleOnmousedown = doubleOnmousedown;
|
||||
@@ -518,7 +518,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
|
||||
/**
|
||||
* Set the onmousemove attribute of the second list
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setDoubleOnmousemove(String doubleOnmousemove) {
|
||||
this.doubleOnmousemove = doubleOnmousemove;
|
||||
@@ -530,7 +530,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
|
||||
/**
|
||||
* Set the onmouseout attribute of the second list
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setDoubleOnmouseout(String doubleOnmouseout) {
|
||||
this.doubleOnmouseout = doubleOnmouseout;
|
||||
@@ -542,7 +542,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
|
||||
/**
|
||||
* Set the onmouseover attribute of the second list
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setDoubleOnmouseover(String doubleOnmouseover) {
|
||||
this.doubleOnmouseover = doubleOnmouseover;
|
||||
@@ -554,7 +554,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
|
||||
/**
|
||||
* Set the onmouseup attribute of the second list
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setDoubleOnmouseup(String doubleOnmouseup) {
|
||||
this.doubleOnmouseup = doubleOnmouseup;
|
||||
@@ -566,7 +566,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
|
||||
/**
|
||||
* Set the onselect attribute of the second list
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setDoubleOnselect(String doubleOnselect) {
|
||||
this.doubleOnselect = doubleOnselect;
|
||||
@@ -578,7 +578,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
|
||||
/**
|
||||
* Set the size attribute of the second list
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setDoubleSize(String doubleSize) {
|
||||
this.doubleSize = doubleSize;
|
||||
@@ -590,7 +590,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
|
||||
/**
|
||||
* Set the list key of the second attribute
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public String getDoubleListKey() {
|
||||
return doubleListKey;
|
||||
@@ -610,7 +610,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
|
||||
/**
|
||||
* Decides of an empty option is to be inserted in the second list
|
||||
* @a2.tagattribute required="false" default="false" type="Boolean"
|
||||
* @s.tagattribute required="false" default="false" type="Boolean"
|
||||
*/
|
||||
public void setEmptyOption(String emptyOption) {
|
||||
this.emptyOption = emptyOption;
|
||||
@@ -618,7 +618,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
|
||||
/**
|
||||
* Set the header key of the second list. Must not be empty! "'-1'" and "''" is correct, "" is bad.
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setHeaderKey(String headerKey) {
|
||||
this.headerKey = headerKey;
|
||||
@@ -626,7 +626,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
|
||||
/**
|
||||
* Set the header value of the second list
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setHeaderValue(String headerValue) {
|
||||
this.headerValue = headerValue;
|
||||
@@ -634,7 +634,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
|
||||
/**
|
||||
* Creates a multiple select. The tag will pre-select multiple values if the values are passed as an Array (of appropriate types) via the value attribute.
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setMultiple(String multiple) {
|
||||
// TODO: Passing a Collection may work too?
|
||||
@@ -643,7 +643,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
|
||||
/**
|
||||
* Size of the element box (# of elements to show)
|
||||
* @a2.tagattribute required="false" type="Integer"
|
||||
* @s.tagattribute required="false" type="Integer"
|
||||
*/
|
||||
public void setSize(String size) {
|
||||
this.size = size;
|
||||
@@ -651,7 +651,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
|
||||
/**
|
||||
* Set the html accesskey attribute.
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setDoubleAccesskey(String doubleAccesskey) {
|
||||
this.doubleAccesskey = doubleAccesskey;
|
||||
|
||||
@@ -17,11 +17,11 @@
|
||||
*/
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
* Renders two HTML select elements with second one changing displayed values depending on selected entry of first one.
|
||||
@@ -31,12 +31,12 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
*
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example -->
|
||||
* <a:doubleselect label="doubleselect test1" name="menu" list="{'fruit','other'}" doubleName="dishes" doubleList="top == 'fruit' ? {'apple', 'orange'} : {'monkey', 'chicken'}" />
|
||||
* <a:doubleselect label="doubleselect test2" name="menu" list="#{'fruit':'Nice Fruits', 'other':'Other Dishes'}" doubleName="dishes" doubleList="top == 'fruit' ? {'apple', 'orange'} : {'monkey', 'chicken'}" />
|
||||
* <s:doubleselect label="doubleselect test1" name="menu" list="{'fruit','other'}" doubleName="dishes" doubleList="top == 'fruit' ? {'apple', 'orange'} : {'monkey', 'chicken'}" />
|
||||
* <s:doubleselect label="doubleselect test2" name="menu" list="#{'fruit':'Nice Fruits', 'other':'Other Dishes'}" doubleName="dishes" doubleList="top == 'fruit' ? {'apple', 'orange'} : {'monkey', 'chicken'}" />
|
||||
* <!-- END SNIPPET: example -->
|
||||
* </pre>
|
||||
*
|
||||
* @a2.tag name="doubleselect" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.DoubleSelectTag"
|
||||
* @s.tag name="doubleselect" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.DoubleSelectTag"
|
||||
* description="Renders two HTML select elements with second one changing displayed values depending on selected entry of first one."
|
||||
*/
|
||||
public class DoubleSelect extends DoubleListUIBean {
|
||||
|
||||
@@ -17,11 +17,11 @@
|
||||
*/
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
import java.io.Writer;
|
||||
import java.util.Map;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
*
|
||||
@@ -39,19 +39,19 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
*
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example -->
|
||||
* <a:if test="%{false}">
|
||||
* <s:if test="%{false}">
|
||||
* <div>Will Not Be Executed</div>
|
||||
* </a:if>
|
||||
* <a:elseif test="%{true}">
|
||||
* </s:if>
|
||||
* <s:elseif test="%{true}">
|
||||
* <div>Will Be Executed</div>
|
||||
* </a:elseif>
|
||||
* <a:else>
|
||||
* </s:elseif>
|
||||
* <s:else>
|
||||
* <div>Will Not Be Executed</div>
|
||||
* </a:else>
|
||||
* </s:else>
|
||||
* <!-- END SNIPPET: example -->
|
||||
* </pre>
|
||||
*
|
||||
* @a2.tag name="else" bodycontent="JSP" description="Else tag" tld-tag-class="org.apache.struts2.views.jsp.ElseTag"
|
||||
* @s.tag name="else" bodycontent="JSP" description="Else tag" tld-tag-class="org.apache.struts2.views.jsp.ElseTag"
|
||||
*/
|
||||
public class Else extends Component {
|
||||
public Else(OgnlValueStack stack) {
|
||||
@@ -65,6 +65,5 @@ public class Else extends Component {
|
||||
context.remove(If.ANSWER);
|
||||
|
||||
return !((ifResult == null) || (ifResult.booleanValue()));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,10 +17,10 @@
|
||||
*/
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import java.io.Writer;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
import java.io.Writer;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
*
|
||||
@@ -43,19 +43,19 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
*
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example -->
|
||||
* <a:if test="%{false}">
|
||||
* <s:if test="%{false}">
|
||||
* <div>Will Not Be Executed</div>
|
||||
* </a:if>
|
||||
* <a:elseif test="%{true}">
|
||||
* </s:if>
|
||||
* <s:elseif test="%{true}">
|
||||
* <div>Will Be Executed</div>
|
||||
* </a:elseif>
|
||||
* <a:else>
|
||||
* </s:elseif>
|
||||
* <s:else>
|
||||
* <div>Will Not Be Executed</div>
|
||||
* </a:else>
|
||||
* </s:else>
|
||||
* <!-- END SNIPPET: example -->
|
||||
* </pre>
|
||||
*
|
||||
* @a2.tag name="elseif" tld-body-content="JSP" description="Elseif tag" tld-tag-class="org.apache.struts2.views.jsp.ElseIfTag"
|
||||
* @s.tag name="elseif" tld-body-content="JSP" description="Elseif tag" tld-tag-class="org.apache.struts2.views.jsp.ElseIfTag"
|
||||
*/
|
||||
public class ElseIf extends Component {
|
||||
public ElseIf(OgnlValueStack stack) {
|
||||
@@ -67,7 +67,7 @@ public class ElseIf extends Component {
|
||||
|
||||
public boolean start(Writer writer) {
|
||||
Boolean ifResult = (Boolean) stack.getContext().get(If.ANSWER);
|
||||
|
||||
|
||||
if ((ifResult == null) || (ifResult.booleanValue())) {
|
||||
return false;
|
||||
}
|
||||
@@ -85,13 +85,18 @@ public class ElseIf extends Component {
|
||||
}
|
||||
|
||||
public boolean end(Writer writer, String body) {
|
||||
|
||||
if (answer == null) {
|
||||
answer = Boolean.FALSE;
|
||||
}
|
||||
if (answer.booleanValue()) {
|
||||
stack.getContext().put(If.ANSWER, answer);
|
||||
}
|
||||
return super.end(writer, "");
|
||||
}
|
||||
|
||||
/**
|
||||
* Expression to determine if body of tag is to be displayed
|
||||
* @a2.tagattribute required="true" type="Boolean"
|
||||
* @s.tagattribute required="true" type="Boolean"
|
||||
*/
|
||||
public void setTest(String test) {
|
||||
this.test = test;
|
||||
|
||||
@@ -17,15 +17,13 @@
|
||||
*/
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.apache.struts2.components.Param.UnnamedParametric;
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.components.Param.UnnamedParametric;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
@@ -40,26 +38,26 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* <!-- START SNIPPET: example -->
|
||||
*
|
||||
* <!-- example 1 -->
|
||||
* <a:fielderror />
|
||||
* <s:fielderror />
|
||||
*
|
||||
* <!-- example 2 -->
|
||||
* <a:fielderror>
|
||||
* <a:param>field1</a:param>
|
||||
* <a:param>field2</a:param>
|
||||
* </a:fielderror>
|
||||
* <a:form .... >>
|
||||
* <s:fielderror>
|
||||
* <s:param>field1</s:param>
|
||||
* <s:param>field2</s:param>
|
||||
* </s:fielderror>
|
||||
* <s:form .... >>
|
||||
* ....
|
||||
* </a:form>
|
||||
* </s:form>
|
||||
*
|
||||
* OR
|
||||
*
|
||||
* <a:fielderror>
|
||||
* <a:param value="%{'field1'}" />
|
||||
* <a:param value="%{'field2'}" />
|
||||
* </a:fielderror>
|
||||
* <a:form .... >>
|
||||
* <s:fielderror>
|
||||
* <s:param value="%{'field1'}" />
|
||||
* <s:param value="%{'field2'}" />
|
||||
* </s:fielderror>
|
||||
* <s:form .... >>
|
||||
* ....
|
||||
* </a:form>
|
||||
* </s:form>
|
||||
*
|
||||
* <!-- END SNIPPET: example -->
|
||||
* </pre>
|
||||
@@ -77,7 +75,7 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* <!-- END SNIPPET: description -->
|
||||
* </pre>
|
||||
*
|
||||
* @a2.tag name="fielderror" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.FieldErrorTag"
|
||||
* @s.tag name="fielderror" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.FieldErrorTag"
|
||||
* description="Render field error (all or partial depending on param tag nested)if they exists"
|
||||
*/
|
||||
public class FieldError extends UIBean implements UnnamedParametric {
|
||||
|
||||
@@ -17,14 +17,14 @@
|
||||
*/
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
* Renders an HTML file input element.
|
||||
@@ -34,12 +34,12 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
*
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example -->
|
||||
* <a:file name="anUploadFile" accept="text/*" />
|
||||
* <a:file name="anohterUploadFIle" accept="text/html,text/plain" />
|
||||
* <s:file name="anUploadFile" accept="text/*" />
|
||||
* <s:file name="anohterUploadFIle" accept="text/html,text/plain" />
|
||||
* <!-- END SNIPPET: example -->
|
||||
* </pre>
|
||||
*
|
||||
* @a2.tag name="file" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.FileTag"
|
||||
* @s.tag name="file" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.FileTag"
|
||||
* description="Render a file input field"
|
||||
*/
|
||||
public class File extends UIBean {
|
||||
@@ -66,13 +66,13 @@ public class File extends UIBean {
|
||||
String encType = (String) form.getParameters().get("enctype");
|
||||
if (!"multipart/form-data".equals(encType)) {
|
||||
// uh oh, this isn't good! Let's warn the developer
|
||||
log.warn("Struts has detected a file upload UI tag (a:file) being used without a form set to enctype 'multipart/form-data'. This is probably an error!");
|
||||
log.warn("Struts has detected a file upload UI tag (s:file) being used without a form set to enctype 'multipart/form-data'. This is probably an error!");
|
||||
}
|
||||
|
||||
String method = (String) form.getParameters().get("method");
|
||||
if (!"post".equalsIgnoreCase(method)) {
|
||||
// uh oh, this isn't good! Let's warn the developer
|
||||
log.warn("Struts has detected a file upload UI tag (a:file) being used without a form set to method 'POST'. This is probably an error!");
|
||||
log.warn("Struts has detected a file upload UI tag (s:file) being used without a form set to method 'POST'. This is probably an error!");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ public class File extends UIBean {
|
||||
|
||||
/**
|
||||
* HTML accept attribute to indicate accepted file mimetypes
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setAccept(String accept) {
|
||||
this.accept = accept;
|
||||
@@ -95,7 +95,7 @@ public class File extends UIBean {
|
||||
|
||||
/**
|
||||
* HTML size attribute
|
||||
* @a2.tagattribute required="false" type="Integer"
|
||||
* @s.tagattribute required="false" type="Integer"
|
||||
*/
|
||||
public void setSize(String size) {
|
||||
this.size = size;
|
||||
|
||||
@@ -17,24 +17,6 @@
|
||||
*/
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.struts2.StrutsConstants;
|
||||
import org.apache.struts2.dispatcher.Dispatcher;
|
||||
import org.apache.struts2.dispatcher.mapper.ActionMapperFactory;
|
||||
import org.apache.struts2.dispatcher.mapper.ActionMapping;
|
||||
import org.apache.struts2.portlet.context.PortletActionContext;
|
||||
import org.apache.struts2.portlet.util.PortletUrlHelper;
|
||||
import org.apache.struts2.views.util.UrlHelper;
|
||||
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.ActionInvocation;
|
||||
import com.opensymphony.xwork2.ObjectFactory;
|
||||
@@ -48,6 +30,20 @@ import com.opensymphony.xwork2.validator.ActionValidatorManagerFactory;
|
||||
import com.opensymphony.xwork2.validator.FieldValidator;
|
||||
import com.opensymphony.xwork2.validator.ValidationInterceptor;
|
||||
import com.opensymphony.xwork2.validator.Validator;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.struts2.StrutsConstants;
|
||||
import org.apache.struts2.config.Settings;
|
||||
import org.apache.struts2.dispatcher.Dispatcher;
|
||||
import org.apache.struts2.dispatcher.mapper.ActionMapperFactory;
|
||||
import org.apache.struts2.dispatcher.mapper.ActionMapping;
|
||||
import org.apache.struts2.portlet.context.PortletActionContext;
|
||||
import org.apache.struts2.portlet.util.PortletUrlHelper;
|
||||
import org.apache.struts2.views.util.UrlHelper;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.*;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
@@ -82,18 +78,20 @@ import com.opensymphony.xwork2.validator.Validator;
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example -->
|
||||
* <p/>
|
||||
* <a:form ... />
|
||||
* <s:form ... />
|
||||
* <p/>
|
||||
* <!-- END SNIPPET: example -->
|
||||
* </pre>
|
||||
*
|
||||
* @a2.tag name="form" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.FormTag"
|
||||
* @s.tag name="form" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.FormTag"
|
||||
* description="Renders an input form"
|
||||
*/
|
||||
public class Form extends ClosingUIBean {
|
||||
public static final String OPEN_TEMPLATE = "form";
|
||||
public static final String TEMPLATE = "form-close";
|
||||
|
||||
private int sequence = 0;
|
||||
|
||||
protected String onsubmit;
|
||||
protected String action;
|
||||
protected String target;
|
||||
@@ -104,13 +102,6 @@ public class Form extends ClosingUIBean {
|
||||
protected String portletMode;
|
||||
protected String windowState;
|
||||
protected String acceptcharset;
|
||||
protected static boolean compatibilityMode = false;
|
||||
|
||||
static {
|
||||
if (org.apache.struts2.config.Settings.isSet(StrutsConstants.STRUTS_COMPATIBILITY_MODE)) {
|
||||
compatibilityMode = "true".equals(org.apache.struts2.config.Settings.get(StrutsConstants.STRUTS_COMPATIBILITY_MODE));
|
||||
}
|
||||
}
|
||||
|
||||
public Form(OgnlValueStack stack, HttpServletRequest request, HttpServletResponse response) {
|
||||
super(stack, request, response);
|
||||
@@ -136,14 +127,14 @@ public class Form extends ClosingUIBean {
|
||||
protected void evaluateExtraParams() {
|
||||
super.evaluateExtraParams();
|
||||
|
||||
boolean isAjax = "ajax".equalsIgnoreCase(this.theme);
|
||||
//boolean isAjax = "ajax".equalsIgnoreCase(this.theme);
|
||||
|
||||
if (validate != null) {
|
||||
addParameter("validate", findValue(validate, Boolean.class));
|
||||
}
|
||||
|
||||
// calculate the action and namespace
|
||||
String action = null;
|
||||
/*String action = null;
|
||||
if (this.action != null) {
|
||||
// if it isn't specified, we'll make somethig up
|
||||
action = findString(this.action);
|
||||
@@ -155,7 +146,7 @@ public class Form extends ClosingUIBean {
|
||||
String namespace = determineNamespace(this.namespace, getStack(),
|
||||
request);
|
||||
evaluateExtraParamsServletRequest(action, namespace, isAjax);
|
||||
}
|
||||
}*/
|
||||
|
||||
if (onsubmit != null) {
|
||||
addParameter("onsubmit", findString(onsubmit));
|
||||
@@ -184,6 +175,34 @@ public class Form extends ClosingUIBean {
|
||||
addParameter("tagNames", new ArrayList());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Form component determine the its HTML element id as follows:-
|
||||
* <ol>
|
||||
* <li>if an 'id' attribute is specified.</li>
|
||||
* <li>if an 'action' attribute is specified, it will be used as the id.</li>
|
||||
* </ol>
|
||||
*/
|
||||
protected void populateComponentHtmlId(Form form) {
|
||||
boolean isAjax = "ajax".equalsIgnoreCase(this.theme);
|
||||
|
||||
String action = null;
|
||||
if (this.action != null) {
|
||||
// if it isn't specified, we'll make somethig up
|
||||
action = findString(this.action);
|
||||
}
|
||||
|
||||
if (id != null) {
|
||||
addParameter("id", escape(id));
|
||||
}
|
||||
if (Dispatcher.getInstance().isPortletSupportActive() && PortletActionContext.isPortletRequest()) {
|
||||
evaluateExtraParamsPortletRequest(namespace, action);
|
||||
} else {
|
||||
String namespace = determineNamespace(this.namespace, getStack(),
|
||||
request);
|
||||
evaluateExtraParamsServletRequest(action, namespace, isAjax);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param isAjax
|
||||
@@ -205,10 +224,16 @@ public class Form extends ClosingUIBean {
|
||||
}
|
||||
|
||||
String actionMethod = "";
|
||||
if (compatibilityMode && action.indexOf("!") != -1) {
|
||||
int endIdx = action.lastIndexOf("!");
|
||||
actionMethod = action.substring(endIdx + 1, action.length());
|
||||
action = action.substring(0, endIdx);
|
||||
// FIXME: our implementation is flawed - the only concept of ! should be in DefaultActionMapper
|
||||
boolean allowDynamicMethodCalls = "true".equals(Settings.get(StrutsConstants.STRUTS_ENABLE_DYNAMIC_METHOD_INVOCATION));
|
||||
|
||||
// handle "name!method" convention.
|
||||
if (allowDynamicMethodCalls) {
|
||||
if (action.indexOf("!") != -1) {
|
||||
int endIdx = action.lastIndexOf("!");
|
||||
actionMethod = action.substring(endIdx + 1, action.length());
|
||||
action = action.substring(0, endIdx);
|
||||
}
|
||||
}
|
||||
|
||||
Configuration config = Dispatcher.getInstance().getConfigurationManager().getConfiguration();
|
||||
@@ -374,12 +399,23 @@ public class Form extends ClosingUIBean {
|
||||
|
||||
return validators;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a incrementing sequence unique to this <code>Form</code> component.
|
||||
* It is used by <code>Form</code> component's child that might need a
|
||||
* sequence to make them unique.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
protected int getSequence() {
|
||||
return sequence++;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* HTML onsubmit attribute
|
||||
*
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setOnsubmit(String onsubmit) {
|
||||
this.onsubmit = onsubmit;
|
||||
@@ -388,7 +424,7 @@ public class Form extends ClosingUIBean {
|
||||
/**
|
||||
* Set action nane to submit to, without .action suffix
|
||||
*
|
||||
* @a2.tagattribute required="false" default="current action"
|
||||
* @s.tagattribute required="false" default="current action"
|
||||
*/
|
||||
public void setAction(String action) {
|
||||
this.action = action;
|
||||
@@ -397,7 +433,7 @@ public class Form extends ClosingUIBean {
|
||||
/**
|
||||
* HTML form target attribute
|
||||
*
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setTarget(String target) {
|
||||
this.target = target;
|
||||
@@ -406,7 +442,7 @@ public class Form extends ClosingUIBean {
|
||||
/**
|
||||
* HTML form enctype attribute
|
||||
*
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setEnctype(String enctype) {
|
||||
this.enctype = enctype;
|
||||
@@ -415,7 +451,7 @@ public class Form extends ClosingUIBean {
|
||||
/**
|
||||
* HTML form method attribute
|
||||
*
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setMethod(String method) {
|
||||
this.method = method;
|
||||
@@ -424,7 +460,7 @@ public class Form extends ClosingUIBean {
|
||||
/**
|
||||
* namespace for action to submit to
|
||||
*
|
||||
* @a2.tagattribute required="false" default="current namespace"
|
||||
* @s.tagattribute required="false" default="current namespace"
|
||||
*/
|
||||
public void setNamespace(String namespace) {
|
||||
this.namespace = namespace;
|
||||
@@ -433,7 +469,7 @@ public class Form extends ClosingUIBean {
|
||||
/**
|
||||
* Whether client side/remote validation should be performed. Only useful with theme xhtml/ajax
|
||||
*
|
||||
* @a2.tagattribute required="false" type="Boolean" default="false"
|
||||
* @s.tagattribute required="false" type="Boolean" default="false"
|
||||
*/
|
||||
public void setValidate(String validate) {
|
||||
this.validate = validate;
|
||||
@@ -442,7 +478,7 @@ public class Form extends ClosingUIBean {
|
||||
/**
|
||||
* The portlet mode to display after the form submit
|
||||
*
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setPortletMode(String portletMode) {
|
||||
this.portletMode = portletMode;
|
||||
@@ -451,7 +487,7 @@ public class Form extends ClosingUIBean {
|
||||
/**
|
||||
* The window state to display after the form submit
|
||||
*
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setWindowState(String windowState) {
|
||||
this.windowState = windowState;
|
||||
@@ -460,7 +496,7 @@ public class Form extends ClosingUIBean {
|
||||
/**
|
||||
* The accepted charsets for this form. The values may be comma or blank delimited.
|
||||
*
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setAcceptcharset(String acceptcharset) {
|
||||
this.acceptcharset = acceptcharset;
|
||||
|
||||
@@ -17,11 +17,11 @@
|
||||
*/
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
/**
|
||||
* FormButton.
|
||||
*/
|
||||
@@ -40,7 +40,9 @@ public abstract class FormButton extends UIBean {
|
||||
super(stack, request, response);
|
||||
}
|
||||
|
||||
public void evaluateParams() {
|
||||
//public void evaluateParams() {
|
||||
public void evaluateExtraParams() {
|
||||
super.evaluateExtraParams();
|
||||
if (align == null) {
|
||||
align = "right";
|
||||
}
|
||||
@@ -51,7 +53,7 @@ public abstract class FormButton extends UIBean {
|
||||
submitType = type;
|
||||
}
|
||||
|
||||
super.evaluateParams();
|
||||
//super.evaluateParams();
|
||||
|
||||
addParameter("type", submitType);
|
||||
|
||||
@@ -78,18 +80,66 @@ public abstract class FormButton extends UIBean {
|
||||
addParameter("align", findString(align));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Override UIBean's implementation, such that component Html id is determined
|
||||
* in the following order :-
|
||||
* <ol>
|
||||
* <li>This component id attribute</li>
|
||||
* <li>[containing_form_id]_[this_component_name]</li>
|
||||
* <li>[containing_form_id]_[this_component_action]_[this_component_method]</li>
|
||||
* <li>[containing_form_id]_[this_component_method]</li>
|
||||
* <li>[this_component_name]</li>
|
||||
* <li>[this_component_action]_[this_component_method]</li>
|
||||
* <li>[this_component_method]</li>
|
||||
* <li>[an increasing sequential number unique to the form starting with 0]</li>
|
||||
* </ol>
|
||||
*/
|
||||
protected void populateComponentHtmlId(Form form) {
|
||||
String _tmp_id = "";
|
||||
if (id != null) {
|
||||
// this check is needed for backwards compatibility with 2.1.x
|
||||
if (altSyntax()) {
|
||||
_tmp_id = findString(id);
|
||||
} else {
|
||||
_tmp_id = id;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (form != null && form.getParameters().get("id") != null) {
|
||||
_tmp_id = _tmp_id + form.getParameters().get("id").toString() + "_";
|
||||
}
|
||||
if (name != null) {
|
||||
_tmp_id = _tmp_id + escape(name);
|
||||
} else if (action != null || method != null){
|
||||
if (action != null) {
|
||||
_tmp_id = _tmp_id + escape(action);
|
||||
}
|
||||
if (method != null) {
|
||||
_tmp_id = _tmp_id + "_" + escape(method);
|
||||
}
|
||||
} else {
|
||||
// if form is null, this component is used, without a form, i guess
|
||||
// there's not much we could do then.
|
||||
if (form != null) {
|
||||
_tmp_id = _tmp_id + form.getSequence();
|
||||
}
|
||||
}
|
||||
}
|
||||
addParameter("id", _tmp_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicate whether the concrete button supports the type "image".
|
||||
*
|
||||
* @return <tt>true</tt> if type image is supported.
|
||||
*/
|
||||
* Indicate whether the concrete button supports the type "image".
|
||||
*
|
||||
* @return <tt>true</tt> if type image is supported.
|
||||
*/
|
||||
protected abstract boolean supportsImageType();
|
||||
|
||||
/**
|
||||
* Set action attribute.
|
||||
*
|
||||
* @a2.tagattribute required="false" type="String"
|
||||
* @s.tagattribute required="false" type="String"
|
||||
*/
|
||||
public void setAction(String action) {
|
||||
this.action = action;
|
||||
@@ -98,7 +148,7 @@ public abstract class FormButton extends UIBean {
|
||||
/**
|
||||
* Set method attribute.
|
||||
*
|
||||
* @a2.tagattribute required="false" type="String"
|
||||
* @s.tagattribute required="false" type="String"
|
||||
*/
|
||||
public void setMethod(String method) {
|
||||
this.method = method;
|
||||
@@ -107,7 +157,7 @@ public abstract class FormButton extends UIBean {
|
||||
/**
|
||||
* HTML align attribute.
|
||||
*
|
||||
* @a2.tagattribute required="false" type="String"
|
||||
* @s.tagattribute required="false" type="String"
|
||||
*/
|
||||
public void setAlign(String align) {
|
||||
this.align = align;
|
||||
@@ -116,7 +166,7 @@ public abstract class FormButton extends UIBean {
|
||||
/**
|
||||
* The type of submit to use. Valid values are <i>input</i>, <i>button</i> and <i>image</i>.
|
||||
*
|
||||
* @a2.tagattribute required="false" type="String" default="input"
|
||||
* @s.tagattribute required="false" type="String" default="input"
|
||||
*/
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
|
||||
@@ -17,12 +17,11 @@
|
||||
*/
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
import org.apache.struts2.util.ContainUtil;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
@@ -34,7 +33,7 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* Objects provided can be retrieve from within the template via $parameters._paramname_.<p/>
|
||||
*
|
||||
* <b>Jsp:</b><p/>
|
||||
* Objects provided can be retrieve from within the template via <saf:property value="%{parameters._paramname_}" /><p/>
|
||||
* Objects provided can be retrieve from within the template via <s:property value="%{parameters._paramname_}" /><p/>
|
||||
*
|
||||
*
|
||||
* In the bottom JSP and Velocity samples, two parameters are being passed in to the component. From within the
|
||||
@@ -44,8 +43,8 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* $parameters.get('key1') and $parameters.get('key2') or $parameters.key1 and $parameters.key2<p/>
|
||||
*
|
||||
* <b>Jsp:</b><p/>
|
||||
* <saf:property value="%{parameters.key1}" /> and <saf:property value="%{'parameters.key2'}" /> or
|
||||
* <saf:property value="%{parameters.get('key1')}" /> and <saf:property value="%{parameters.get('key2')}" /><p/>
|
||||
* <s:property value="%{parameters.key1}" /> and <s:property value="%{'parameters.key2'}" /> or
|
||||
* <s:property value="%{parameters.get('key1')}" /> and <s:property value="%{parameters.get('key2')}" /><p/>
|
||||
*
|
||||
* Currently, your custom UI components can be written in Velocity, JSP, or Freemarker, and the correct rendering
|
||||
* engine will be found based on file extension.<p/>
|
||||
@@ -62,34 +61,34 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example -->
|
||||
* JSP
|
||||
* <a:component template="/my/custom/component.vm"/>
|
||||
* <s:component template="/my/custom/component.vm"/>
|
||||
*
|
||||
* or
|
||||
*
|
||||
* <a:component template="/my/custom/component.vm">
|
||||
* <a:param name="key1" value="value1"/>
|
||||
* <a:param name="key2" value="value2"/>
|
||||
* </a:component>
|
||||
* <s:component template="/my/custom/component.vm">
|
||||
* <s:param name="key1" value="value1"/>
|
||||
* <s:param name="key2" value="value2"/>
|
||||
* </s:component>
|
||||
*
|
||||
* Velocity
|
||||
* #safcomponent( "template=/my/custom/component.vm" )
|
||||
* #s-component( "template=/my/custom/component.vm" )
|
||||
*
|
||||
* or
|
||||
*
|
||||
* #safcomponent( "template=/my/custom/component.vm" )
|
||||
* #safparam( "name=key1" "value=value1" )
|
||||
* #safparam( "name=key2" "value=value2" )
|
||||
* #s-component( "template=/my/custom/component.vm" )
|
||||
* #s-param( "name=key1" "value=value1" )
|
||||
* #s-param( "name=key2" "value=value2" )
|
||||
* #end
|
||||
*
|
||||
* Freemarker
|
||||
* <@saf.component template="/my/custom/component.ftl" />
|
||||
* <@s..component template="/my/custom/component.ftl" />
|
||||
*
|
||||
* or
|
||||
*
|
||||
* <@saf.component template="/my/custom/component.ftl">
|
||||
* <@saf.param name="key1" value="%{'value1'}" />
|
||||
* <@saf.param name="key2" value="%{'value2'}" />
|
||||
* </@saf.component>
|
||||
* <@s..component template="/my/custom/component.ftl">
|
||||
* <@s..param name="key1" value="%{'value1'}" />
|
||||
* <@s..param name="key2" value="%{'value2'}" />
|
||||
* </@s..component>
|
||||
*
|
||||
* <!-- END SNIPPET: example -->
|
||||
* </pre>
|
||||
@@ -105,7 +104,7 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
*
|
||||
* <!-- END SNIPPET: note -->
|
||||
*
|
||||
* @a2.tag name="component" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.ComponentTag"
|
||||
* @s.tag name="component" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.ComponentTag"
|
||||
* description="Render a custom ui widget"
|
||||
*/
|
||||
public class GenericUIBean extends UIBean {
|
||||
|
||||
@@ -17,14 +17,13 @@
|
||||
*/
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
import org.apache.struts2.config.Settings;
|
||||
import org.apache.struts2.StrutsConstants;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.StrutsConstants;
|
||||
import org.apache.struts2.config.Settings;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
*
|
||||
@@ -48,7 +47,7 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* <!-- START SNIPPET: example1 -->
|
||||
* <head>
|
||||
* <title>My page</title>
|
||||
* <a:head/>
|
||||
* <s:head/>
|
||||
* </head>
|
||||
* <!-- END SNIPPET: example1 -->
|
||||
* </pre>
|
||||
@@ -57,7 +56,7 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* <!-- START SNIPPET: example2 -->
|
||||
* <head>
|
||||
* <title>My page</title>
|
||||
* <a:head theme="ajax" calendarcss="calendar-green"/>
|
||||
* <s:head theme="ajax" calendarcss="calendar-green"/>
|
||||
* </head>
|
||||
* <!-- END SNIPPET: example2 -->
|
||||
* </pre>
|
||||
@@ -66,12 +65,12 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* <!-- START SNIPPET: example3 -->
|
||||
* <head>
|
||||
* <title>My page</title>
|
||||
* <a:head theme="ajax" debug="true"/>
|
||||
* <s:head theme="ajax" debug="true"/>
|
||||
* </head>
|
||||
* <!-- END SNIPPET: example3 -->
|
||||
* </pre>
|
||||
*
|
||||
* @a2.tag name="head" tld-body-content="empty" tld-tag-class="org.apache.struts2.views.jsp.ui.HeadTag"
|
||||
* @s.tag name="head" tld-body-content="empty" tld-tag-class="org.apache.struts2.views.jsp.ui.HeadTag"
|
||||
* description="Render a chunk of HEAD for your HTML file"
|
||||
*/
|
||||
public class Head extends UIBean {
|
||||
@@ -112,7 +111,7 @@ public class Head extends UIBean {
|
||||
|
||||
/**
|
||||
* The jscalendar css theme to use" default="calendar-blue.css
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setCalendarcss(String calendarcss) {
|
||||
this.calendarcss = calendarcss;
|
||||
@@ -124,7 +123,7 @@ public class Head extends UIBean {
|
||||
|
||||
/**
|
||||
* Set to true to enable debugging mode for AJAX themes
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setDebug(boolean debug) {
|
||||
this.debug = debug;
|
||||
|
||||
@@ -17,11 +17,11 @@
|
||||
*/
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
* Renders an HTML input element of type hidden, populated by the specified property from the OgnlValueStack.
|
||||
@@ -32,9 +32,9 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example -->
|
||||
* <-- example one -->
|
||||
* <a:hidden name="foo" />
|
||||
* <s:hidden name="foo" />
|
||||
* <-- example two -->
|
||||
* <a:hidden name="foo" value="bar" />
|
||||
* <s:hidden name="foo" value="bar" />
|
||||
*
|
||||
* Example One Resulting HTML (if foo evaluates to bar):
|
||||
* <input type="hidden" name="foo" value="bar" />
|
||||
@@ -43,7 +43,7 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* <!-- END SNIPPET: example -->
|
||||
* </pre>
|
||||
*
|
||||
* @a2.tag name="hidden" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.HiddenTag"
|
||||
* @s.tag name="hidden" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.HiddenTag"
|
||||
* description="Render a hidden input field"
|
||||
*/
|
||||
public class Hidden extends UIBean {
|
||||
|
||||
@@ -17,17 +17,18 @@
|
||||
*/
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import java.io.Writer;
|
||||
import java.util.Locale;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import org.apache.struts2.StrutsException;
|
||||
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.LocaleProvider;
|
||||
import com.opensymphony.xwork2.TextProviderSupport;
|
||||
import com.opensymphony.xwork2.util.LocalizedTextUtil;
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.struts2.StrutsException;
|
||||
|
||||
import java.io.Writer;
|
||||
import java.util.Locale;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
@@ -55,9 +56,9 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example -->
|
||||
*
|
||||
* <a:i18n name="myCustomBundle">
|
||||
* The i18n value for key aaa.bbb.ccc in myCustomBundle is <a:property value="text('aaa.bbb.ccc')" />
|
||||
* </a:i18n>
|
||||
* <s:i18n name="myCustomBundle">
|
||||
* The i18n value for key aaa.bbb.ccc in myCustomBundle is <s:property value="text('aaa.bbb.ccc')" />
|
||||
* </s:i18n>
|
||||
*
|
||||
* <!-- END SNIPPET: example -->
|
||||
* </pre>
|
||||
@@ -66,17 +67,19 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: i18nExample -->
|
||||
*
|
||||
* <a:i18n name="some.package.bundle" >
|
||||
* <a:text name="some.key" />
|
||||
* </a:i18n>
|
||||
* <s:i18n name="some.package.bundle" >
|
||||
* <s:text name="some.key" />
|
||||
* </s:i18n>
|
||||
*
|
||||
* <!-- END SNIPPET: i18nExample -->
|
||||
* </pre>
|
||||
*
|
||||
* @a2.tag name="i18n" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.I18nTag"
|
||||
* @s.tag name="i18n" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.I18nTag"
|
||||
* description="Get a resource bundle and place it on the value stack"
|
||||
*/
|
||||
public class I18n extends Component {
|
||||
private static final Log LOG = LogFactory.getLog(I18n.class);
|
||||
|
||||
protected boolean pushed;
|
||||
protected String name;
|
||||
|
||||
@@ -122,7 +125,7 @@ public class I18n extends Component {
|
||||
|
||||
/**
|
||||
* Name of ressource bundle to use (eg foo/bar/customBundle)
|
||||
* @a2.tagattribute required="true" default="String"
|
||||
* @s.tagattribute required="true" default="String"
|
||||
*/
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
|
||||
@@ -17,10 +17,10 @@
|
||||
*/
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import java.io.Writer;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
import java.io.Writer;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
*
|
||||
@@ -43,22 +43,22 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
*
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example -->
|
||||
* <a:if test="%{false}">
|
||||
* <s:if test="%{false}">
|
||||
* <div>Will Not Be Executed</div>
|
||||
* </a:if>
|
||||
* <a:elseif test="%{true}">
|
||||
* </s:if>
|
||||
* <s:elseif test="%{true}">
|
||||
* <div>Will Be Executed</div>
|
||||
* </a:elseif>
|
||||
* <a:else>
|
||||
* <s:else>
|
||||
* </s:elseif>
|
||||
* <div>Will Not Be Executed</div>
|
||||
* </a:else>
|
||||
* </s:else>
|
||||
* <!-- END SNIPPET: example -->
|
||||
* </pre>
|
||||
*
|
||||
* @see Else
|
||||
* @see ElseIf
|
||||
*
|
||||
* @a2.tag name="if" tld-body-content="JSP" description="If tag" tld-tag-class="org.apache.struts2.views.jsp.IfTag"
|
||||
* @s.tag name="if" tld-body-content="JSP" description="If tag" tld-tag-class="org.apache.struts2.views.jsp.IfTag"
|
||||
*/
|
||||
public class If extends Component {
|
||||
public static final String ANSWER = "struts.if.answer";
|
||||
@@ -68,7 +68,7 @@ public class If extends Component {
|
||||
|
||||
/**
|
||||
* Expression to determine if body of tag is to be displayed
|
||||
* @a2.tagattribute required="true" type="Boolean"
|
||||
* @s.tagattribute required="true" type="Boolean"
|
||||
*/
|
||||
public void setTest(String test) {
|
||||
this.test = test;
|
||||
@@ -84,13 +84,12 @@ public class If extends Component {
|
||||
if (answer == null) {
|
||||
answer = Boolean.FALSE;
|
||||
}
|
||||
|
||||
stack.getContext().put(ANSWER, answer);
|
||||
return answer.booleanValue();
|
||||
}
|
||||
|
||||
public boolean end(Writer writer, String body) {
|
||||
|
||||
stack.getContext().put(ANSWER, answer);
|
||||
return super.end(writer, body);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,17 +17,14 @@
|
||||
*/
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.Writer;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Stack;
|
||||
import java.util.StringTokenizer;
|
||||
import org.apache.struts2.config.Settings;
|
||||
import org.apache.struts2.util.FastByteArrayOutputStream;
|
||||
import org.apache.struts2.RequestUtils;
|
||||
import org.apache.struts2.StrutsConstants;
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import javax.servlet.RequestDispatcher;
|
||||
import javax.servlet.ServletException;
|
||||
@@ -36,15 +33,12 @@ import javax.servlet.ServletRequest;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpServletResponseWrapper;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.struts2.RequestUtils;
|
||||
import org.apache.struts2.StrutsConstants;
|
||||
import org.apache.struts2.config.Settings;
|
||||
import org.apache.struts2.util.FastByteArrayOutputStream;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.Writer;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
@@ -63,19 +57,19 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example -->
|
||||
* <-- One: -->
|
||||
* <a:include value="myJsp.jsp" />
|
||||
* <s:include value="myJsp.jsp" />
|
||||
*
|
||||
* <-- Two: -->
|
||||
* <a:include value="myJsp.jsp">
|
||||
* <a:param name="param1" value="value2" />
|
||||
* <a:param name="param2" value="value2" />
|
||||
* </a:include>
|
||||
* <s:include value="myJsp.jsp">
|
||||
* <s:param name="param1" value="value2" />
|
||||
* <s:param name="param2" value="value2" />
|
||||
* </s:include>
|
||||
*
|
||||
* <-- Three: -->
|
||||
* <a:include value="myJsp.jsp">
|
||||
* <a:param name="param1">value1</a:param>
|
||||
* <a:param name="param2">value2<a:param>
|
||||
* </a:include>
|
||||
* <s:include value="myJsp.jsp">
|
||||
* <s:param name="param1">value1</s:param>
|
||||
* <s:param name="param2">value2<s:param>
|
||||
* </s:include>
|
||||
* <!-- END SNIPPET: example -->
|
||||
*
|
||||
* <!-- START SNIPPET: exampledescription -->
|
||||
@@ -85,7 +79,7 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* <!-- END SNIPPET: exampledescription -->
|
||||
* </pre>
|
||||
*
|
||||
* @a2.tag name="include" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.IncludeTag"
|
||||
* @s.tag name="include" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.IncludeTag"
|
||||
* description="Include a servlet's output (result of servlet or a JSP page)"
|
||||
*/
|
||||
public class Include extends Component {
|
||||
@@ -156,7 +150,7 @@ public class Include extends Component {
|
||||
|
||||
/**
|
||||
* The jsp/servlet output to include
|
||||
* @a2.tagattribute required="true" type="String"
|
||||
* @s.tagattribute required="true" type="String"
|
||||
*/
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
|
||||
@@ -17,14 +17,13 @@
|
||||
*/
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import java.io.Writer;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.apache.struts2.util.MakeIterator;
|
||||
import org.apache.struts2.views.jsp.IteratorStatus;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
import java.io.Writer;
|
||||
import java.util.Iterator;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
*
|
||||
@@ -50,15 +49,15 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* <!-- START SNIPPET: example1description -->
|
||||
*
|
||||
* <p>The following example retrieves the value of the getDays() method of the current object on the value stack and
|
||||
* uses it to iterate over. The <a:property/> tag prints out the current value of the iterator.</p>
|
||||
* uses it to iterate over. The <s:property/> tag prints out the current value of the iterator.</p>
|
||||
*
|
||||
* <!-- END SNIPPET: example1description -->
|
||||
*
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example1code -->
|
||||
* <a:iterator value="days">
|
||||
* <p>day is: <a:property/></p>
|
||||
* </a:iterator>
|
||||
* <s:iterator value="days">
|
||||
* <p>day is: <s:property/></p>
|
||||
* </s:iterator>
|
||||
* <!-- END SNIPPET: example1code -->
|
||||
* </pre>
|
||||
*
|
||||
@@ -76,26 +75,26 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example2code -->
|
||||
*
|
||||
* <a:bean name="org.apache.struts2.example.IteratorExample" id="it">
|
||||
* <a:param name="day" value="'foo'"/>
|
||||
* <a:param name="day" value="'bar'"/>
|
||||
* </a:bean>
|
||||
* <s:bean name="org.apache.struts2.example.IteratorExample" id="it">
|
||||
* <s:param name="day" value="'foo'"/>
|
||||
* <s:param name="day" value="'bar'"/>
|
||||
* </s:bean>
|
||||
* <p/>
|
||||
* <table border="0" cellspacing="0" cellpadding="1">
|
||||
* <tr>
|
||||
* <th>Days of the week</th>
|
||||
* </tr>
|
||||
* <p/>
|
||||
* <a:iterator value="#it.days" status="rowstatus">
|
||||
* <s:iterator value="#it.days" status="rowstatus">
|
||||
* <tr>
|
||||
* <a:if test="#rowstatus.odd == true">
|
||||
* <td style="background: grey"><a:property/></td>
|
||||
* </a:if>
|
||||
* <a:else>
|
||||
* <td><a:property/></td>
|
||||
* </a:else>
|
||||
* <s:if test="#rowstatus.odd == true">
|
||||
* <td style="background: grey"><s:property/></td>
|
||||
* </s:if>
|
||||
* <s:else>
|
||||
* <td><s:property/></td>
|
||||
* </s:else>
|
||||
* </tr>
|
||||
* </a:iterator>
|
||||
* </s:iterator>
|
||||
* </table>
|
||||
*
|
||||
* <!-- END SNIPPET: example2code -->
|
||||
@@ -112,17 +111,17 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example3code -->
|
||||
*
|
||||
* <saf:iterator value="groupDao.groups" status="groupStatus">
|
||||
* <tr class="<saf:if test="#groupStatus.odd == true ">odd</saf:if><saf:else>even</saf:else>">
|
||||
* <td><saf:property value="name" /></td>
|
||||
* <td><saf:property value="description" /></td>
|
||||
* <s:iterator value="groupDao.groups" status="groupStatus">
|
||||
* <tr class="<s:if test="#groupStatus.odd == true ">odd</s:if><s:else>even</s:else>">
|
||||
* <td><s:property value="name" /></td>
|
||||
* <td><s:property value="description" /></td>
|
||||
* <td>
|
||||
* <saf:iterator value="users" status="userStatus">
|
||||
* <saf:property value="fullName" /><saf:if test="!#userStatus.last">,</saf:if>
|
||||
* </saf:iterator>
|
||||
* <s:iterator value="users" status="userStatus">
|
||||
* <s:property value="fullName" /><s:if test="!#userStatus.last">,</s:if>
|
||||
* </s:iterator>
|
||||
* </td>
|
||||
* </tr>
|
||||
* </saf:iterator>
|
||||
* </s:iterator>
|
||||
*
|
||||
* <!-- END SNIPPET: example3code -->
|
||||
* </pre>
|
||||
@@ -132,7 +131,7 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
*
|
||||
* </p> The next example iterates over a an action collection and passes every iterator value to another action. The
|
||||
* trick here lies in the use of the '[0]' operator. It takes the current iterator value and passes it on to the edit
|
||||
* action. Using the '[0]' operator has the same effect as using >a:property />. (The latter, however, does not
|
||||
* action. Using the '[0]' operator has the same effect as using >s:property />. (The latter, however, does not
|
||||
* work from inside the param tag). </p>
|
||||
*
|
||||
* <!-- END SNIPPET: example4description -->
|
||||
@@ -140,16 +139,16 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example4code -->
|
||||
*
|
||||
* <a:action name="entries" id="entries"/>
|
||||
* <a:iterator value="#entries.entries" >
|
||||
* <a:property value="name" />
|
||||
* <a:property />
|
||||
* <a:push value="...">
|
||||
* <a:action name="edit" id="edit" >
|
||||
* <a:param name="entry" value="[0]" />
|
||||
* </a:action>
|
||||
* <s:action name="entries" id="entries"/>
|
||||
* <s:iterator value="#entries.entries" >
|
||||
* <s:property value="name" />
|
||||
* <s:property />
|
||||
* <s:push value="...">
|
||||
* <s:action name="edit" id="edit" >
|
||||
* <s:param name="entry" value="[0]" />
|
||||
* </s:action>
|
||||
* </push>
|
||||
* </a:iterator>
|
||||
* </s:iterator>
|
||||
*
|
||||
* <!-- END SNIPPET: example4code -->
|
||||
* </pre>
|
||||
@@ -164,19 +163,19 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example5code -->
|
||||
*
|
||||
* <a:iterator status="stat" value="{1,2,3,4,5}" >
|
||||
* <s:iterator status="stat" value="{1,2,3,4,5}" >
|
||||
* <!-- grab the index (start with 0 ... ) -->
|
||||
* <a:property value="#stat.index" />
|
||||
* <s:property value="#stat.index" />
|
||||
*
|
||||
* <!-- grab the top of the stack which should be the -->
|
||||
* <!-- current iteration value (0, 1, ... 5) -->
|
||||
* <a:property value="top" />
|
||||
* </a:iterator>
|
||||
* <s:property value="top" />
|
||||
* </s:iterator>
|
||||
*
|
||||
* <!-- END SNIPPET: example5code -->
|
||||
* </pre>
|
||||
*
|
||||
* @a2.tag name="iterator" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.IteratorTag"
|
||||
* @s.tag name="iterator" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.IteratorTag"
|
||||
* description="Iterate over a iterable value"
|
||||
*/
|
||||
public class IteratorComponent extends Component {
|
||||
@@ -273,7 +272,7 @@ public class IteratorComponent extends Component {
|
||||
|
||||
/**
|
||||
* if specified, an instanceof IteratorStatus will be pushed into stack upon each iteration
|
||||
* @a2.tagattribute required="false" type="Boolean" default="false"
|
||||
* @s.tagattribute required="false" type="Boolean" default="false"
|
||||
*/
|
||||
public void setStatus(String status) {
|
||||
this.statusAttr = status;
|
||||
@@ -281,7 +280,7 @@ public class IteratorComponent extends Component {
|
||||
|
||||
/**
|
||||
* the iteratable source to iterate over, else an the object itself will be put into a newly created List
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
|
||||
@@ -17,11 +17,11 @@
|
||||
*/
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
* Renders an HTML LABEL that will allow you to output label:name combination that has the same format treatment as
|
||||
@@ -37,11 +37,11 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* <!-- END SNIPPET: exdescription -->
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example -->
|
||||
* <a:label label="%{text('user_name')}" name="userName" />
|
||||
* <s:label label="%{text('user_name')}" name="userName" />
|
||||
* <!-- END SNIPPET: example -->
|
||||
* </pre>
|
||||
*
|
||||
* @a2.tag name="label" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.LabelTag"
|
||||
* @s.tag name="label" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.LabelTag"
|
||||
* description="Render a label that displays read-only information"
|
||||
*/
|
||||
public class Label extends UIBean {
|
||||
@@ -79,7 +79,7 @@ public class Label extends UIBean {
|
||||
|
||||
/**
|
||||
* HTML for attribute
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setFor(String forAttr) {
|
||||
this.forAttr = forAttr;
|
||||
|
||||
@@ -17,17 +17,15 @@
|
||||
*/
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import java.lang.reflect.Array;
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
import org.apache.struts2.util.ContainUtil;
|
||||
import org.apache.struts2.util.MakeIterator;
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.util.ContainUtil;
|
||||
import org.apache.struts2.util.MakeIterator;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
import java.lang.reflect.Array;
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* DoubleListUIBean is the standard superclass of all Struts list handling components.
|
||||
@@ -120,7 +118,7 @@ public abstract class ListUIBean extends UIBean {
|
||||
|
||||
/**
|
||||
* Iterable source to populate from. If the list is a Map (key, value), the Map key will become the option "value" parameter and the Map value will become the option body.
|
||||
* @a2.tagattribute required="true"
|
||||
* @s.tagattribute required="true"
|
||||
*/
|
||||
public void setList(Object list) {
|
||||
this.list = list;
|
||||
@@ -128,7 +126,7 @@ public abstract class ListUIBean extends UIBean {
|
||||
|
||||
/**
|
||||
* Property of list objects to get field value from
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setListKey(String listKey) {
|
||||
this.listKey = listKey;
|
||||
@@ -136,7 +134,7 @@ public abstract class ListUIBean extends UIBean {
|
||||
|
||||
/**
|
||||
* Property of list objects to get field content from
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setListValue(String listValue) {
|
||||
this.listValue = listValue;
|
||||
|
||||
@@ -24,10 +24,10 @@ import java.util.List;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import org.apache.struts2.components.Param.UnnamedParametric;
|
||||
import org.apache.struts2.util.MakeIterator;
|
||||
import org.apache.struts2.util.MergeIteratorFilter;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
/**
|
||||
@@ -105,14 +105,14 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* <!-- END SNIPPET: javacode -->
|
||||
*
|
||||
* <!-- START SNIPPET: example -->
|
||||
* <a:merge id="myMergedIterator1">
|
||||
* <a:param value="%{myList1}" />
|
||||
* <a:param value="%{myList2}" />
|
||||
* <a:param value="%{myList3}" />
|
||||
* </a:merge>
|
||||
* <a:iterator value="%{#myMergedIterator1}">
|
||||
* <a:property />
|
||||
* </a:iterator>
|
||||
* <s:merge id="myMergedIterator1">
|
||||
* <s:param value="%{myList1}" />
|
||||
* <s:param value="%{myList2}" />
|
||||
* <s:param value="%{myList3}" />
|
||||
* </s:merge>
|
||||
* <s:iterator value="%{#myMergedIterator1}">
|
||||
* <s:property />
|
||||
* </s:iterator>
|
||||
* <!-- END SNIPPET: example -->
|
||||
*
|
||||
* <!-- START SNIPPET: description -->
|
||||
@@ -122,7 +122,7 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* @see org.apache.struts2.util.MergeIteratorFilter
|
||||
* @see org.apache.struts2.views.jsp.iterator.MergeIteratorTag
|
||||
*
|
||||
* @a2.tag name="merge" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.iterator.MergeIteratorTag"
|
||||
* @s.tag name="merge" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.iterator.MergeIteratorTag"
|
||||
* description="Merge the values of a list of iterators into one iterator"
|
||||
*/
|
||||
public class MergeIterator extends Component implements UnnamedParametric {
|
||||
@@ -169,7 +169,7 @@ public class MergeIterator extends Component implements UnnamedParametric {
|
||||
|
||||
/**
|
||||
* the id where the resultant merged iterator will be stored in the stack's context
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setId(String id) {
|
||||
super.setId(id);
|
||||
|
||||
@@ -49,20 +49,20 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example -->
|
||||
*
|
||||
* <ww:select label="My Selection"
|
||||
* <s:select label="My Selection"
|
||||
* name="mySelection"
|
||||
* value="%{'POPEYE'}"
|
||||
* list="%{#{'SUPERMAN':'Superman', 'SPIDERMAN':'spiderman'}}">
|
||||
* <ww:optgroup label="Adult"
|
||||
* <s:optgroup label="Adult"
|
||||
* list="%{#{'SOUTH_PARK':'South Park'}}" />
|
||||
* <ww:optgroup label="Japanese"
|
||||
* <s:optgroup label="Japanese"
|
||||
* list="%{#{'POKEMON':'pokemon','DIGIMON':'digimon','SAILORMOON':'Sailormoon'}}" />
|
||||
* </ww:select>
|
||||
* </s:select>
|
||||
*
|
||||
* <!-- END SNIPPET: example -->
|
||||
* </pre>
|
||||
*
|
||||
* @a2.tag name="optgroup" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.OptGroupTag"
|
||||
* @s.tag name="optgroup" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.OptGroupTag"
|
||||
* description="Renders a Select Tag's OptGroup Tag"
|
||||
*/
|
||||
public class OptGroup extends Component {
|
||||
@@ -109,7 +109,7 @@ public class OptGroup extends Component {
|
||||
|
||||
/**
|
||||
* Set the label attribute.
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setLabel(String label) {
|
||||
internalUiBean.setLabel(label);
|
||||
@@ -117,7 +117,7 @@ public class OptGroup extends Component {
|
||||
|
||||
/**
|
||||
* Set the disable attribute.
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setDisabled(String disabled) {
|
||||
internalUiBean.setDisabled(disabled);
|
||||
@@ -125,7 +125,7 @@ public class OptGroup extends Component {
|
||||
|
||||
/**
|
||||
* Set the list attribute.
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setList(String list) {
|
||||
internalUiBean.setList(list);
|
||||
@@ -133,7 +133,7 @@ public class OptGroup extends Component {
|
||||
|
||||
/**
|
||||
* Set the listKey attribute.
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setListKey(String listKey) {
|
||||
internalUiBean.setListKey(listKey);
|
||||
@@ -141,7 +141,7 @@ public class OptGroup extends Component {
|
||||
|
||||
/**
|
||||
* Set the listValue attribute.
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setListValue(String listValue) {
|
||||
internalUiBean.setListValue(listValue);
|
||||
|
||||
@@ -56,7 +56,7 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* <!-- START SNIPPET: example -->
|
||||
*
|
||||
* <-- minimum configuration -->
|
||||
* <a:optiontransferselect
|
||||
* <s:optiontransferselect
|
||||
* label="Favourite Cartoons Characters"
|
||||
* name="leftSideCartoonCharacters"
|
||||
* list="{'Popeye', 'He-Man', 'Spiderman'}"
|
||||
@@ -65,7 +65,7 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* />
|
||||
*
|
||||
* <-- possible configuration -->
|
||||
* <a:optiontransferselect
|
||||
* <s:optiontransferselect
|
||||
* label="Favourite Cartoons Characters"
|
||||
* name="leftSideCartoonCharacters"
|
||||
* leftTitle="Left Title"
|
||||
@@ -86,7 +86,7 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* <!-- END SNIPPET: example -->
|
||||
* </pre>
|
||||
*
|
||||
* @a2.tag name="optiontransferselect" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.OptionTransferSelectTag"
|
||||
* @s.tag name="optiontransferselect" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.OptionTransferSelectTag"
|
||||
* description="Renders an input form"
|
||||
*/
|
||||
public class OptionTransferSelect extends DoubleListUIBean {
|
||||
@@ -302,7 +302,7 @@ public class OptionTransferSelect extends DoubleListUIBean {
|
||||
|
||||
/**
|
||||
* set Add To Left button label
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setAddAllToLeftLabel(String addAllToLeftLabel) {
|
||||
this.addAllToLeftLabel = addAllToLeftLabel;
|
||||
@@ -314,7 +314,7 @@ public class OptionTransferSelect extends DoubleListUIBean {
|
||||
|
||||
/**
|
||||
* set Add All To Right button label
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setAddAllToRightLabel(String addAllToRightLabel) {
|
||||
this.addAllToRightLabel = addAllToRightLabel;
|
||||
@@ -326,7 +326,7 @@ public class OptionTransferSelect extends DoubleListUIBean {
|
||||
|
||||
/**
|
||||
* set Add To Left button label
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setAddToLeftLabel(String addToLeftLabel) {
|
||||
this.addToLeftLabel = addToLeftLabel;
|
||||
@@ -338,7 +338,7 @@ public class OptionTransferSelect extends DoubleListUIBean {
|
||||
|
||||
/**
|
||||
* set Add To Right button label
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setAddToRightLabel(String addToRightLabel) {
|
||||
this.addToRightLabel = addToRightLabel;
|
||||
@@ -350,7 +350,7 @@ public class OptionTransferSelect extends DoubleListUIBean {
|
||||
|
||||
/**
|
||||
* enable Add All To Left button
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setAllowAddAllToLeft(String allowAddAllToLeft) {
|
||||
this.allowAddAllToLeft = allowAddAllToLeft;
|
||||
@@ -362,7 +362,7 @@ public class OptionTransferSelect extends DoubleListUIBean {
|
||||
|
||||
/**
|
||||
* enable Add All To Right button
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setAllowAddAllToRight(String allowAddAllToRight) {
|
||||
this.allowAddAllToRight = allowAddAllToRight;
|
||||
@@ -374,7 +374,7 @@ public class OptionTransferSelect extends DoubleListUIBean {
|
||||
|
||||
/**
|
||||
* enable Add To Left button
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setAllowAddToLeft(String allowAddToLeft) {
|
||||
this.allowAddToLeft = allowAddToLeft;
|
||||
@@ -386,7 +386,7 @@ public class OptionTransferSelect extends DoubleListUIBean {
|
||||
|
||||
/**
|
||||
* enable Add To Right button
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setAllowAddToRight(String allowAddToRight) {
|
||||
this.allowAddToRight = allowAddToRight;
|
||||
@@ -425,7 +425,7 @@ public class OptionTransferSelect extends DoubleListUIBean {
|
||||
|
||||
/**
|
||||
* set Left title
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setLeftTitle(String leftTitle) {
|
||||
this.leftTitle = leftTitle;
|
||||
@@ -437,7 +437,7 @@ public class OptionTransferSelect extends DoubleListUIBean {
|
||||
|
||||
/**
|
||||
* set Right title
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setRightTitle(String rightTitle) {
|
||||
this.rightTitle = rightTitle;
|
||||
@@ -446,7 +446,7 @@ public class OptionTransferSelect extends DoubleListUIBean {
|
||||
|
||||
/**
|
||||
* enable Select All button
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setAllowSelectAll(String allowSelectAll) {
|
||||
this.allowSelectAll = allowSelectAll;
|
||||
@@ -459,7 +459,7 @@ public class OptionTransferSelect extends DoubleListUIBean {
|
||||
|
||||
/**
|
||||
* set Select All button label
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setSelectAllLabel(String selectAllLabel) {
|
||||
this.selectAllLabel = selectAllLabel;
|
||||
@@ -472,7 +472,7 @@ public class OptionTransferSelect extends DoubleListUIBean {
|
||||
|
||||
/**
|
||||
* set buttons css class
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setButtonCssClass(String buttonCssClass) {
|
||||
this.buttonCssClass = buttonCssClass;
|
||||
@@ -485,7 +485,7 @@ public class OptionTransferSelect extends DoubleListUIBean {
|
||||
|
||||
/**
|
||||
* set button css style
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setButtonCssStyle(String buttonCssStyle) {
|
||||
this.buttonCssStyle = buttonCssStyle;
|
||||
|
||||
@@ -17,12 +17,11 @@
|
||||
*/
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import java.io.Writer;
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
import java.io.Writer;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
@@ -35,7 +34,7 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
*
|
||||
* @see TabbedPanel
|
||||
*
|
||||
* @a2.tag name="panel" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.PanelTag"
|
||||
* @s.tag name="panel" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.PanelTag"
|
||||
* description="Render a panel for tabbedPanel"
|
||||
*/
|
||||
public class Panel extends Div {
|
||||
@@ -96,7 +95,7 @@ public class Panel extends Div {
|
||||
|
||||
/**
|
||||
* The text of the tab to display in the header tab list
|
||||
* @a2.tagattribute required="true"
|
||||
* @s.tagattribute required="true"
|
||||
*/
|
||||
public void setTabName(String tabName) {
|
||||
this.tabName = tabName;
|
||||
@@ -104,7 +103,7 @@ public class Panel extends Div {
|
||||
|
||||
/**
|
||||
* Set subscribeTopicName attribute
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setSubscribeTopicName(String subscribeTopicName) {
|
||||
this.subscribeTopicName = subscribeTopicName;
|
||||
@@ -112,7 +111,7 @@ public class Panel extends Div {
|
||||
|
||||
/**
|
||||
* determines whether this is a remote panel (ajax) or a local panel (content loaded into visible/hidden containers)
|
||||
* @a2.tagattribute required="false" type="Boolean" default="false"
|
||||
* @s.tagattribute required="false" type="Boolean" default="false"
|
||||
*/
|
||||
public void setRemote(String remote) {
|
||||
this.remote = remote;
|
||||
|
||||
@@ -17,12 +17,12 @@
|
||||
*/
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
import java.io.Writer;
|
||||
|
||||
import org.apache.struts2.StrutsException;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
* <p>This tag can be used to parameterize other tags.</p>
|
||||
@@ -72,9 +72,9 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* This second example demonstrates how the text tag can use parameters from this param tag.
|
||||
* <!-- START SNIPPET: example2 -->
|
||||
* <pre>
|
||||
* <a:text name="cart.total.cost">
|
||||
* <a:param value="#session.cartTotal"/>
|
||||
* </a:text>
|
||||
* <s:text name="cart.total.cost">
|
||||
* <s:param value="#session.cartTotal"/>
|
||||
* </s:text>
|
||||
* </pre>
|
||||
* <!-- END SNIPPET: example2 -->
|
||||
* <p/>
|
||||
@@ -83,7 +83,7 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* @see Bean
|
||||
* @see Text
|
||||
*
|
||||
* @a2.tag name="param" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ParamTag"
|
||||
* @s.tag name="param" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ParamTag"
|
||||
* description="Parametrize other tags"
|
||||
*/
|
||||
public class Param extends Component {
|
||||
@@ -126,7 +126,7 @@ public class Param extends Component {
|
||||
|
||||
/**
|
||||
* Name of Parameter to set
|
||||
* @a2.tagattribute required="false" type="String"
|
||||
* @s.tagattribute required="false" type="String"
|
||||
*/
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
@@ -134,7 +134,7 @@ public class Param extends Component {
|
||||
|
||||
/**
|
||||
* Value expression for Parameter to set
|
||||
* @a2.tagattribute required="false" default="The value of evaluating provided name against stack"
|
||||
* @s.tagattribute required="false" default="The value of evaluating provided name against stack"
|
||||
*/
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
|
||||
@@ -17,11 +17,11 @@
|
||||
*/
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
* Render an HTML input tag of type password.</p>
|
||||
@@ -35,11 +35,11 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* <!-- END SNIPPET: exdescription -->
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example -->
|
||||
* <a:password label="%{text('password')}" name="password" size="10" maxlength="15" />
|
||||
* <s:password label="%{text('password')}" name="password" size="10" maxlength="15" />
|
||||
* <!-- END SNIPPET: example -->
|
||||
* </pre>
|
||||
*
|
||||
* @a2.tag name="password" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.PasswordTag"
|
||||
* @s.tag name="password" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.PasswordTag"
|
||||
* description="Render an HTML input tag of type password"
|
||||
*/
|
||||
public class Password extends TextField {
|
||||
@@ -65,7 +65,7 @@ public class Password extends TextField {
|
||||
|
||||
/**
|
||||
* Whether to show input
|
||||
* @a2.tagattribute required="false" type="Boolean" default="false"
|
||||
* @s.tagattribute required="false" type="Boolean" default="false"
|
||||
*/
|
||||
public void setShowPassword(String showPassword) {
|
||||
this.showPassword = showPassword;
|
||||
@@ -73,7 +73,7 @@ public class Password extends TextField {
|
||||
|
||||
/**
|
||||
* Deprecated. Use showPassword instead.
|
||||
* @a2.tagattribute required="false" rtexprvalue="true"
|
||||
* @s.tagattribute required="false" rtexprvalue="true"
|
||||
* @deprecated use {@link #setShowPassword(String)}
|
||||
*/
|
||||
public void setShow(String showPassword) {
|
||||
|
||||
@@ -17,15 +17,15 @@
|
||||
*/
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import java.io.IOException;
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
import com.opensymphony.util.TextUtils;
|
||||
|
||||
import java.io.Writer;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import com.opensymphony.util.TextUtils;
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
*
|
||||
@@ -51,13 +51,13 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example -->
|
||||
*
|
||||
* <a:push value="myBean">
|
||||
* <s:push value="myBean">
|
||||
* <!-- Example 1: -->
|
||||
* <a:property value="myBeanProperty" />
|
||||
* <s:property value="myBeanProperty" />
|
||||
*
|
||||
* <!-- Example 2: -->
|
||||
* <a:property value="myBeanProperty" default="a default value" />
|
||||
* </a:push>
|
||||
* <s:property value="myBeanProperty" default="a default value" />
|
||||
* </s:push>
|
||||
*
|
||||
* <!-- END SNIPPET: example -->
|
||||
* </pre>
|
||||
@@ -75,12 +75,12 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: i18nExample -->
|
||||
*
|
||||
* <a:property value="getText('some.key')" />
|
||||
* <s:property value="getText('some.key')" />
|
||||
*
|
||||
* <!-- END SNIPPET: i18nExample -->
|
||||
* </pre>
|
||||
*
|
||||
* @a2.tag name="property" tld-body-content="empty" tld-tag-class="org.apache.struts2.views.jsp.PropertyTag"
|
||||
* @s.tag name="property" tld-body-content="empty" tld-tag-class="org.apache.struts2.views.jsp.PropertyTag"
|
||||
* description="Print out expression which evaluates against the stack"
|
||||
*/
|
||||
public class Property extends Component {
|
||||
@@ -96,7 +96,7 @@ public class Property extends Component {
|
||||
|
||||
/**
|
||||
* The default value to be used if <u>value</u> attribute is null
|
||||
* @a2.tagattribute required="false" type="String"
|
||||
* @s.tagattribute required="false" type="String"
|
||||
*/
|
||||
public void setDefault(String defaultValue) {
|
||||
this.defaultValue = defaultValue;
|
||||
@@ -104,7 +104,7 @@ public class Property extends Component {
|
||||
|
||||
/**
|
||||
* Whether to escape HTML
|
||||
* @a2.tagattribute required="false" type="Boolean" default="true"
|
||||
* @s.tagattribute required="false" type="Boolean" default="true"
|
||||
*/
|
||||
public void setEscape(boolean escape) {
|
||||
this.escape = escape;
|
||||
@@ -112,7 +112,7 @@ public class Property extends Component {
|
||||
|
||||
/**
|
||||
* value to be displayed
|
||||
* @a2.tagattribute required="false" type="Object" default="<top of stack>"
|
||||
* @s.tagattribute required="false" type="Object" default="<top of stack>"
|
||||
*/
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
|
||||
@@ -17,10 +17,10 @@
|
||||
*/
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import java.io.Writer;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
import java.io.Writer;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
* <p>Push value on stack for simplified usage.</p>
|
||||
@@ -36,10 +36,10 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* <p/> <b>Examples</b>
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example1 -->
|
||||
* <a:push value="user">
|
||||
* <a:propery value="firstName" />
|
||||
* <a:propery value="lastName" />
|
||||
* </a:push>
|
||||
* <s:push value="user">
|
||||
* <s:propery value="firstName" />
|
||||
* <s:propery value="lastName" />
|
||||
* </s:push>
|
||||
* <!-- END SNIPPET: example1 -->
|
||||
* </pre>
|
||||
*
|
||||
@@ -50,11 +50,11 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
*
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example2 -->
|
||||
* <a:push value="myObject"> ----- (1)
|
||||
* <a:bean name="jp.SomeBean" id="myBean"/> ----- (2)
|
||||
* <a:param name="myParam" value="top"/> ----- (3)
|
||||
* </a:bean>
|
||||
* </a:push>
|
||||
* <s:push value="myObject"> ----- (1)
|
||||
* <s:bean name="jp.SomeBean" id="myBean"/> ----- (2)
|
||||
* <s:param name="myParam" value="top"/> ----- (3)
|
||||
* </s:bean>
|
||||
* </s:push>
|
||||
* <!-- END SNIPPET: example2 -->
|
||||
* </pre>
|
||||
*
|
||||
@@ -68,11 +68,11 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
*
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example3 -->
|
||||
* <a:push value="myObject"> ---(A)
|
||||
* <a:bean name="jp.SomeBean" id="myBean"/> ---(B)
|
||||
* <a:param name="myParam" value="top.mySomeOtherValue"/> ---(C)
|
||||
* </a:bean>
|
||||
* </a:push>
|
||||
* <s:push value="myObject"> ---(A)
|
||||
* <s:bean name="jp.SomeBean" id="myBean"/> ---(B)
|
||||
* <s:param name="myParam" value="top.mySomeOtherValue"/> ---(C)
|
||||
* </s:bean>
|
||||
* </s:push>
|
||||
* <!-- END SNIPPET: example3 -->
|
||||
* </pre>
|
||||
*
|
||||
@@ -86,11 +86,11 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
*
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example4 -->
|
||||
* <a:push value="myObject"> ---- (i)
|
||||
* <a:bean name="jp.SomeBean" id="myBean"/> ---- (ii)
|
||||
* <a:param name="myParam" value="[1].top"/> -----(iii)
|
||||
* </a:bean>
|
||||
* </a:push>
|
||||
* <s:push value="myObject"> ---- (i)
|
||||
* <s:bean name="jp.SomeBean" id="myBean"/> ---- (ii)
|
||||
* <s:param name="myParam" value="[1].top"/> -----(iii)
|
||||
* </s:bean>
|
||||
* </s:push>
|
||||
* <!-- END SNIPPET: example4 -->
|
||||
* </pre>
|
||||
*
|
||||
@@ -102,7 +102,7 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* <!-- END SNIPPET: example4description -->
|
||||
* </pre>
|
||||
*
|
||||
* @a2.tag name="push" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.PushTag"
|
||||
* @s.tag name="push" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.PushTag"
|
||||
* description="Push value on stack for simplified usage."
|
||||
*/
|
||||
public class Push extends Component {
|
||||
@@ -140,7 +140,7 @@ public class Push extends Component {
|
||||
|
||||
/**
|
||||
* Value to push on stack
|
||||
* @a2.tagattribute required="true"
|
||||
* @s.tagattribute required="true"
|
||||
*/
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
|
||||
@@ -17,11 +17,11 @@
|
||||
*/
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
* Render a radio button input field.</p>
|
||||
@@ -31,19 +31,19 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* <p/>
|
||||
* <!-- START SNIPPET: exdescription -->
|
||||
* In this example, a radio control is displayed with a list of genders. The gender list is built from attribute
|
||||
* id=genders. WW calls getGenders() which will return a Map. For examples using listKey and listValue attributes,
|
||||
* id=genders. The framework calls getGenders() which will return a Map. For examples using listKey and listValue attributes,
|
||||
* see the section select tag. The default selected one will be determined (in this case) by the getMale() method
|
||||
* in the action class which should retun a value similar to the key of the getGenters() map if that particular
|
||||
* gender is to be selected.<p/>
|
||||
* <!-- END SNIPPET: exdescription -->
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example -->
|
||||
* <a:action name="GenderMap" id="genders"/>
|
||||
* <a:radio label="Gender" name="male" list="#genders.genders"/>
|
||||
* <s:action name="GenderMap" id="genders"/>
|
||||
* <s:radio label="Gender" name="male" list="#genders.genders"/>
|
||||
* <!-- END SNIPPET: example -->
|
||||
* </pre>
|
||||
*
|
||||
* @a2.tag name="radio" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.RadioTag"
|
||||
* @s.tag name="radio" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.RadioTag"
|
||||
* description="Renders a radio button input field"
|
||||
*/
|
||||
public class Radio extends ListUIBean {
|
||||
|
||||
@@ -17,11 +17,11 @@
|
||||
*/
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
/**
|
||||
* RemoteCallUIBean is superclass for all components dealing with remote calls.
|
||||
*
|
||||
@@ -59,7 +59,7 @@ public abstract class RemoteCallUIBean extends ClosingUIBean {
|
||||
|
||||
/**
|
||||
* The theme to use for the element. <b>This tag will usually use the ajax theme.</b>
|
||||
* @a2.tagattribute required="false" type="String"
|
||||
* @s.tagattribute required="false" type="String"
|
||||
*/
|
||||
public void setTheme(String theme) {
|
||||
super.setTheme(theme);
|
||||
@@ -67,7 +67,7 @@ public abstract class RemoteCallUIBean extends ClosingUIBean {
|
||||
|
||||
/**
|
||||
* The URL to call to obtain the content
|
||||
* @a2.tagattribute required="false" type="String"
|
||||
* @s.tagattribute required="false" type="String"
|
||||
*/
|
||||
public void setHref(String href) {
|
||||
this.href = href;
|
||||
@@ -75,7 +75,7 @@ public abstract class RemoteCallUIBean extends ClosingUIBean {
|
||||
|
||||
/**
|
||||
* The text to display to the user if the is an error fetching the content
|
||||
* @a2.tagattribute required="false" type="String"
|
||||
* @s.tagattribute required="false" type="String"
|
||||
*/
|
||||
public void setErrorText(String errorText) {
|
||||
this.errorText = errorText;
|
||||
@@ -83,7 +83,7 @@ public abstract class RemoteCallUIBean extends ClosingUIBean {
|
||||
|
||||
/**
|
||||
* when to show the error message as content when the URL had problems
|
||||
* @a2.tagattribute required="false" type="Boolean" default="false"
|
||||
* @s.tagattribute required="false" type="Boolean" default="false"
|
||||
*/
|
||||
public void setShowErrorTransportText(String showErrorTransportText) {
|
||||
this.showErrorTransportText = showErrorTransportText;
|
||||
@@ -91,7 +91,7 @@ public abstract class RemoteCallUIBean extends ClosingUIBean {
|
||||
|
||||
/**
|
||||
* Javascript code that will be executed after the content has been fetched
|
||||
* @a2.tagattribute required="false" type="String"
|
||||
* @s.tagattribute required="false" type="String"
|
||||
*/
|
||||
public void setAfterLoading(String afterLoading) {
|
||||
this.afterLoading = afterLoading;
|
||||
|
||||
@@ -17,11 +17,11 @@
|
||||
*/
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
* Render a reset button. The reset tag is used together with the form tag to provide form resetting.
|
||||
@@ -38,18 +38,18 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
*
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example -->
|
||||
* <a:reset value="%{'Reset'}" />
|
||||
* <s:reset value="%{'Reset'}" />
|
||||
* <!-- END SNIPPET: example -->
|
||||
* </pre>
|
||||
*
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example2 -->
|
||||
* Render an button reset:
|
||||
* <a:reset type="button" value="%{'Reset'}" label="Reset the form"/>
|
||||
* <s:reset type="button" value="%{'Reset'}" label="Reset the form"/>
|
||||
* <!-- END SNIPPET: example2 -->
|
||||
* </pre>
|
||||
*
|
||||
* @a2.tag name="reset" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.ResetTag"
|
||||
* @s.tag name="reset" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.ResetTag"
|
||||
* description="Render a reset button"
|
||||
*/
|
||||
public class Reset extends FormButton {
|
||||
@@ -90,7 +90,7 @@ public class Reset extends FormButton {
|
||||
* Supply a reset button text apart from reset value. Will have no effect for <i>input</i> type reset, since button
|
||||
* text will always be the value parameter.
|
||||
*
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setLabel(String label) {
|
||||
super.setLabel(label);
|
||||
|
||||
@@ -17,11 +17,11 @@
|
||||
*/
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
*
|
||||
@@ -33,7 +33,7 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example -->
|
||||
*
|
||||
* <a:select label="Pets"
|
||||
* <s:select label="Pets"
|
||||
* name="petIds"
|
||||
* list="petDao.pets"
|
||||
* listKey="id"
|
||||
@@ -43,7 +43,7 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* required="true"
|
||||
* />
|
||||
*
|
||||
* <a:select label="Months"
|
||||
* <s:select label="Months"
|
||||
* name="months"
|
||||
* headerKey="-1" headerValue="Select Month"
|
||||
* list="#{'01':'Jan', '02':'Feb', [...]}"
|
||||
@@ -70,7 +70,7 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
*
|
||||
* <!-- END SNIPPET: exnote -->
|
||||
*
|
||||
* @a2.tag name="select" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.SelectTag"
|
||||
* @s.tag name="select" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.SelectTag"
|
||||
* description="Render a select element"
|
||||
*/
|
||||
public class Select extends ListUIBean {
|
||||
@@ -113,7 +113,7 @@ public class Select extends ListUIBean {
|
||||
|
||||
/**
|
||||
* Whether or not to add an empty (--) option after the header option
|
||||
* @a2.tagattribute required="false" type="Boolean" default="false"
|
||||
* @s.tagattribute required="false" type="Boolean" default="false"
|
||||
*/
|
||||
public void setEmptyOption(String emptyOption) {
|
||||
this.emptyOption = emptyOption;
|
||||
@@ -121,7 +121,7 @@ public class Select extends ListUIBean {
|
||||
|
||||
/**
|
||||
* Key for first item in list. Must not be empty! "'-1'" and "''" is correct, "" is bad.
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setHeaderKey(String headerKey) {
|
||||
this.headerKey = headerKey;
|
||||
@@ -129,7 +129,7 @@ public class Select extends ListUIBean {
|
||||
|
||||
/**
|
||||
* Value expression for first item in list
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setHeaderValue(String headerValue) {
|
||||
this.headerValue = headerValue;
|
||||
@@ -137,7 +137,7 @@ public class Select extends ListUIBean {
|
||||
|
||||
/**
|
||||
* Creates a multiple select. The tag will pre-select multiple values if the values are passed as an Array (of appropriate types) via the value attribute. Passing a Collection may work too? Haven't tested this.
|
||||
* @a2.tagattribute required="false" type="Boolean" default="false"
|
||||
* @s.tagattribute required="false" type="Boolean" default="false"
|
||||
*/
|
||||
public void setMultiple(String multiple) {
|
||||
this.multiple = multiple;
|
||||
@@ -145,7 +145,7 @@ public class Select extends ListUIBean {
|
||||
|
||||
/**
|
||||
* Size of the element box (# of elements to show)
|
||||
* @a2.tagattribute required="false" type="Integer"
|
||||
* @s.tagattribute required="false" type="Integer"
|
||||
*/
|
||||
public void setSize(String size) {
|
||||
this.size = size;
|
||||
|
||||
@@ -17,10 +17,10 @@
|
||||
*/
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import java.io.Writer;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
import java.io.Writer;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
* <p>The set tag assigns a value to a variable in a specified scope. It is useful when you wish to assign a variable to a
|
||||
@@ -63,12 +63,12 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
*
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example -->
|
||||
* <a:set name="personName" value="person.name"/>
|
||||
* Hello, <a:property value="#personName"/>. How are you?
|
||||
* <s:set name="personName" value="person.name"/>
|
||||
* Hello, <s:property value="#personName"/>. How are you?
|
||||
* <!-- END SNIPPET: example -->
|
||||
* </pre>
|
||||
*
|
||||
* @a2.tag name="set" tld-body-content="empty" tld-tag-class="org.apache.struts2.views.jsp.SetTag"
|
||||
* @s.tag name="set" tld-body-content="empty" tld-tag-class="org.apache.struts2.views.jsp.SetTag"
|
||||
* description="Assigns a value to a variable in a specified scope"
|
||||
*/
|
||||
public class Set extends Component {
|
||||
@@ -118,7 +118,7 @@ public class Set extends Component {
|
||||
|
||||
/**
|
||||
* The name of the new variable that is assigned the value of <i>value</i>
|
||||
* @a2.tagattribute required="true" type="String"
|
||||
* @s.tagattribute required="true" type="String"
|
||||
*/
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
@@ -126,7 +126,7 @@ public class Set extends Component {
|
||||
|
||||
/**
|
||||
* The scope in which to assign the variable. Can be <b>application</b>, <b>session</b>, <b>request</b>, <b>page</b>, or <b>action</b>.
|
||||
* @a2.tagattribute required="false" type="String" default="action"
|
||||
* @s.tagattribute required="false" type="String" default="action"
|
||||
*/
|
||||
public void setScope(String scope) {
|
||||
this.scope = scope;
|
||||
@@ -134,7 +134,7 @@ public class Set extends Component {
|
||||
|
||||
/**
|
||||
* The value that is assigned to the variable named <i>name</i>
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
|
||||
@@ -17,11 +17,11 @@
|
||||
*/
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
* Render a submit button. The submit tag is used together with the form tag to provide asynchronous form submissions.
|
||||
@@ -39,21 +39,21 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
*
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example -->
|
||||
* <a:submit value="%{'Submit'}" />
|
||||
* <s:submit value="%{'Submit'}" />
|
||||
* <!-- END SNIPPET: example -->
|
||||
* </pre>
|
||||
*
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example2 -->
|
||||
* Render an image submit:
|
||||
* <a:submit type="image" value="%{'Submit'}" label="Submit the form" src="submit.gif"/>
|
||||
* <s:submit type="image" value="%{'Submit'}" label="Submit the form" src="submit.gif"/>
|
||||
* <!-- END SNIPPET: example2 -->
|
||||
* </pre>
|
||||
*
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example3 -->
|
||||
* Render an button submit:
|
||||
* <a:submit type="button" value="%{'Submit'}" label="Submit the form"/>
|
||||
* <s:submit type="button" value="%{'Submit'}" label="Submit the form"/>
|
||||
* <!-- END SNIPPET: example3 -->
|
||||
* </pre>
|
||||
*
|
||||
@@ -82,7 +82,7 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* <!-- START SNIPPET: ajxExample1 -->
|
||||
* Remote form replacing another div:
|
||||
* <div id='two' style="border: 1px solid yellow;">Initial content</div>
|
||||
* <a:form
|
||||
* <s:form
|
||||
* id='theForm2'
|
||||
* cssStyle="border: 1px solid green;"
|
||||
* action='/AjaxRemoteForm.action'
|
||||
@@ -90,9 +90,9 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* theme="ajax">
|
||||
*
|
||||
* <input type='text' name='data' value='Struts User' />
|
||||
* <a:submit value="GO2" theme="ajax" resultDivId="two" />
|
||||
* <s:submit value="GO2" theme="ajax" resultDivId="two" />
|
||||
*
|
||||
* </a:form >
|
||||
* </s:form >
|
||||
* <!-- END SNIPPET: ajxExample1 -->
|
||||
* </pre>
|
||||
*
|
||||
@@ -108,15 +108,15 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
*
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: ajxExample2 -->
|
||||
* <a:form id="frm1" action="newPersonWithXMLResult" theme="ajax" >
|
||||
* <a:textfield label="Name" name="person.name" value="person.name" size="20" required="true" />
|
||||
* <a:submit id="submitBtn" value="Save" theme="ajax" cssClass="primary" notifyTopics="personUpdated, systemWorking" />
|
||||
* </a:form >
|
||||
* <s:form id="frm1" action="newPersonWithXMLResult" theme="ajax" >
|
||||
* <s:textfield label="Name" name="person.name" value="person.name" size="20" required="true" />
|
||||
* <s:submit id="submitBtn" value="Save" theme="ajax" cssClass="primary" notifyTopics="personUpdated, systemWorking" />
|
||||
* </s:form >
|
||||
*
|
||||
* <a:div href="/listPeople.action" theme="ajax" errorText="error opps"
|
||||
* <s:div href="/listPeople.action" theme="ajax" errorText="error opps"
|
||||
* loadingText="loading..." id="cart-body" >
|
||||
* <a:action namespace="" name="listPeople" executeResult="true" />
|
||||
* </a:div>
|
||||
* <s:action namespace="" name="listPeople" executeResult="true" />
|
||||
* </s:div>
|
||||
* <!-- END SNIPPET: ajxExample2 -->
|
||||
* </pre>
|
||||
*
|
||||
@@ -150,14 +150,14 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* }
|
||||
* </script>
|
||||
*
|
||||
* <a:form id="frm1" action="newPersonWithXMLResult" theme="ajax" >
|
||||
* <a:textfield label="Name" name="person.name" value="person.name" size="20" required="true" />
|
||||
* <a:submit id="submitBtn" value="Save" theme="ajax" cssClass="primary" onLoadJS="doGreatThings(data, type)" />
|
||||
* </a:form>
|
||||
* <s:form id="frm1" action="newPersonWithXMLResult" theme="ajax" >
|
||||
* <s:textfield label="Name" name="person.name" value="person.name" size="20" required="true" />
|
||||
* <s:submit id="submitBtn" value="Save" theme="ajax" cssClass="primary" onLoadJS="doGreatThings(data, type)" />
|
||||
* </s:form>
|
||||
* <!-- END SNIPPET: ajxExample3 -->
|
||||
* </pre>
|
||||
*
|
||||
* @a2.tag name="submit" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.SubmitTag"
|
||||
* @s.tag name="submit" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.SubmitTag"
|
||||
* description="Render a submit button"
|
||||
*/
|
||||
public class Submit extends FormButton {
|
||||
@@ -179,12 +179,20 @@ public class Submit extends FormButton {
|
||||
}
|
||||
|
||||
public void evaluateParams() {
|
||||
|
||||
if (value == null) {
|
||||
if (value == null) {
|
||||
value = "Submit";
|
||||
}
|
||||
super.evaluateParams();
|
||||
}
|
||||
|
||||
public void evaluateExtraParams() {
|
||||
super.evaluateExtraParams();
|
||||
|
||||
super.evaluateParams();
|
||||
/* if (value == null) {
|
||||
value = "Submit";
|
||||
}*/
|
||||
|
||||
//super.evaluateParams();
|
||||
|
||||
if (null != src) {
|
||||
addParameter("src", findString(src));
|
||||
@@ -223,7 +231,7 @@ public class Submit extends FormButton {
|
||||
|
||||
/**
|
||||
* The id of the HTML element to place the result (this can the the form's id or any id on the page.
|
||||
* @a2.tagattribute required="false" type="String"
|
||||
* @s.tagattribute required="false" type="String"
|
||||
*/
|
||||
public void setResultDivId(String resultDivId) {
|
||||
this.resultDivId = resultDivId;
|
||||
@@ -231,7 +239,7 @@ public class Submit extends FormButton {
|
||||
|
||||
/**
|
||||
* Javascript code that will be executed after the form has been submitted. The format is onLoadJS='yourMethodName(data,type)'. NOTE: the words data and type must be left like that if you want the event type and the returned data.
|
||||
* @a2.tagattribute required="false" type="String"
|
||||
* @s.tagattribute required="false" type="String"
|
||||
*/
|
||||
public void setOnLoadJS(String onLoadJS) {
|
||||
this.onLoadJS = onLoadJS;
|
||||
@@ -239,7 +247,7 @@ public class Submit extends FormButton {
|
||||
|
||||
/**
|
||||
* Topic names to post an event to after the form has been submitted.
|
||||
* @a2.tagattribute required="false" type="String"
|
||||
* @s.tagattribute required="false" type="String"
|
||||
*/
|
||||
public void setNotifyTopics(String notifyTopics) {
|
||||
this.notifyTopics = notifyTopics;
|
||||
@@ -247,7 +255,7 @@ public class Submit extends FormButton {
|
||||
|
||||
/**
|
||||
* Set listenTopics attribute.
|
||||
* @a2.tagattribute required="false" type="String"
|
||||
* @s.tagattribute required="false" type="String"
|
||||
*/
|
||||
public void setListenTopics(String listenTopics) {
|
||||
this.listenTopics = listenTopics;
|
||||
@@ -255,7 +263,7 @@ public class Submit extends FormButton {
|
||||
|
||||
/**
|
||||
* Javascript code that will be executed before invokation. The format is preInvokeJS='yourMethodName(data,type)'.
|
||||
* @a2.tagattribute required="false" type="String"
|
||||
* @s.tagattribute required="false" type="String"
|
||||
*/
|
||||
public void setPreInvokeJS(String preInvokeJS) {
|
||||
this.preInvokeJS = preInvokeJS;
|
||||
@@ -263,7 +271,7 @@ public class Submit extends FormButton {
|
||||
|
||||
/**
|
||||
* Supply a submit button text apart from submit value. Will have no effect for <i>input</i> type submit, since button text will always be the value parameter. For the type <i>image</i>, alt parameter will be set to this value.
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setLabel(String label) {
|
||||
super.setLabel(label);
|
||||
@@ -271,7 +279,7 @@ public class Submit extends FormButton {
|
||||
|
||||
/**
|
||||
* Supply an image src for <i>image</i> type submit button. Will have no effect for types <i>input</i> and <i>button</i>.
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setSrc(String src) {
|
||||
this.src = src;
|
||||
|
||||
@@ -17,13 +17,12 @@
|
||||
*/
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
@@ -38,24 +37,24 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* <!-- END SNIPPET: exdesc -->
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example -->
|
||||
* <a:tabbedPanel id="test2" theme="simple" >
|
||||
* <a:panel id="left" tabName="left" theme="ajax">
|
||||
* <s:tabbedPanel id="test2" theme="simple" >
|
||||
* <s:panel id="left" tabName="left" theme="ajax">
|
||||
* This is the left pane<br/>
|
||||
* <a:form >
|
||||
* <a:textfield name="tt" label="Test Text" /> <br/>
|
||||
* <a:textfield name="tt2" label="Test Text2" />
|
||||
* </a:form>
|
||||
* </a:panel>
|
||||
* <a:panel remote="true" href="/AjaxTest.action" id="ryh1" theme="ajax" tabName="remote one" />
|
||||
* <a:panel id="middle" tabName="middle" theme="ajax">
|
||||
* <s:form >
|
||||
* <s:textfield name="tt" label="Test Text" /> <br/>
|
||||
* <s:textfield name="tt2" label="Test Text2" />
|
||||
* </s:form>
|
||||
* </s:panel>
|
||||
* <s:panel remote="true" href="/AjaxTest.action" id="ryh1" theme="ajax" tabName="remote one" />
|
||||
* <s:panel id="middle" tabName="middle" theme="ajax">
|
||||
* middle tab<br/>
|
||||
* <a:form >
|
||||
* <a:textfield name="tt" label="Test Text44" /> <br/>
|
||||
* <a:textfield name="tt2" label="Test Text442" />
|
||||
* </a:form>
|
||||
* </a:panel>
|
||||
* <a:panel remote="true" href="/AjaxTest.action" id="ryh21" theme="ajax" tabName="remote right" />
|
||||
* </a:tabbedPanel>
|
||||
* <s:form >
|
||||
* <s:textfield name="tt" label="Test Text44" /> <br/>
|
||||
* <s:textfield name="tt2" label="Test Text442" />
|
||||
* </s:form>
|
||||
* </s:panel>
|
||||
* <s:panel remote="true" href="/AjaxTest.action" id="ryh21" theme="ajax" tabName="remote right" />
|
||||
* </s:tabbedPanel>
|
||||
* <!-- END SNIPPET: example -->
|
||||
* </pre>
|
||||
*
|
||||
@@ -69,10 +68,10 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
*
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example2 -->
|
||||
* <link rel="stylesheet" type="text/css" href="<a:url value="/struts/tabs.css"/>">
|
||||
* <link rel="stylesheet" type="text/css" href="<a:url value="/struts/niftycorners/niftyCorners.css"/>">
|
||||
* <link rel="stylesheet" type="text/css" href="<a:url value="/struts/niftycorners/niftyPrint.css"/>" media="print">
|
||||
* <script type="text/javascript" src="<a:url value="/struts/niftycorners/nifty.js"/>"></script>
|
||||
* <link rel="stylesheet" type="text/css" href="<s:url value="/struts/tabs.css"/>">
|
||||
* <link rel="stylesheet" type="text/css" href="<s:url value="/struts/niftycorners/niftyCorners.css"/>">
|
||||
* <link rel="stylesheet" type="text/css" href="<s:url value="/struts/niftycorners/niftyPrint.css"/>" media="print">
|
||||
* <script type="text/javascript" src="<s:url value="/struts/niftycorners/nifty.js"/>"></script>
|
||||
* <script type="text/javascript">
|
||||
* dojo.event.connect(window, "onload", function() {
|
||||
* if (!NiftyCheck())
|
||||
@@ -89,7 +88,7 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
*
|
||||
* @see Panel
|
||||
*
|
||||
* @a2.tag name="tabbedPanel" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.TabbedPanelTag"
|
||||
* @s.tag name="tabbedPanel" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.TabbedPanelTag"
|
||||
* description="Render a tabbedPanel widget."
|
||||
*/
|
||||
public class TabbedPanel extends ClosingUIBean {
|
||||
@@ -147,7 +146,7 @@ public class TabbedPanel extends ClosingUIBean {
|
||||
|
||||
/**
|
||||
* The id to assign to the component.
|
||||
* @a2.tagattribute required="true" type="String"
|
||||
* @s.tagattribute required="true" type="String"
|
||||
*/
|
||||
public void setId(String id) {
|
||||
// This is required to override tld generation attributes to required=true
|
||||
|
||||
@@ -66,7 +66,7 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: exdescription -->
|
||||
*
|
||||
* Accessing messages from a given bundle (the i18n Shop example bundle in the first example) and using bundle defined through ww in the second example.</p>
|
||||
* Accessing messages from a given bundle (the i18n Shop example bundle in the first example) and using bundle defined through the framework in the second example.</p>
|
||||
*
|
||||
* <!-- END SNIPPET: exdescription -->
|
||||
* </pre>
|
||||
@@ -75,12 +75,17 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* <!-- START SNIPPET: example -->
|
||||
*
|
||||
* <!-- First Example -->
|
||||
* <a:i18n name="struts.action.test.i18n.Shop">
|
||||
* <a:text name="main.title"/>
|
||||
* </a:i18n>
|
||||
* <s:i18n name="struts.action.test.i18n.Shop">
|
||||
* <s:text name="main.title"/>
|
||||
* </s:i18n>
|
||||
*
|
||||
* <!-- Second Example -->
|
||||
* <a:text name="main.title" />
|
||||
* <s:text name="main.title" />
|
||||
*
|
||||
* <!-- Third Examlpe -->
|
||||
* <s:text name="i18n.label.greetings">
|
||||
* <s:param >Mr Smith</s:param>
|
||||
* </s:text>
|
||||
*
|
||||
* <!-- END SNIPPET: example -->
|
||||
* </pre>
|
||||
@@ -89,20 +94,20 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: i18nExample -->
|
||||
*
|
||||
* <-- Third Example -->
|
||||
* <a:text name="some.key" />
|
||||
*
|
||||
* <-- Fourth Example -->
|
||||
* <a:text name="some.invalid.key" >
|
||||
* <s:text name="some.key" />
|
||||
*
|
||||
* <-- Fifth Example -->
|
||||
* <s:text name="some.invalid.key" >
|
||||
* The Default Message That Will Be Displayed
|
||||
* </a:text>
|
||||
* </s:text>
|
||||
*
|
||||
* <!-- END SNIPPET: i18nExample -->
|
||||
* </pre>
|
||||
*
|
||||
* @see Param
|
||||
*
|
||||
* @a2.tag name="text" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.TextTag"
|
||||
* @s.tag name="text" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.TextTag"
|
||||
* description="Render a I18n text message."
|
||||
*/
|
||||
public class Text extends Component implements Param.UnnamedParametric {
|
||||
@@ -118,7 +123,7 @@ public class Text extends Component implements Param.UnnamedParametric {
|
||||
|
||||
/**
|
||||
* Name of resource property to fetch
|
||||
* @a2.tagattribute required="true"
|
||||
* @s.tagattribute required="true"
|
||||
*/
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
|
||||
@@ -17,11 +17,11 @@
|
||||
*/
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
* Render HTML textarea tag.</p>
|
||||
@@ -31,13 +31,13 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
*
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example -->
|
||||
* <a:textarea label="Comments" name="comments" cols="30" rows="8"/>
|
||||
* <s:textarea label="Comments" name="comments" cols="30" rows="8"/>
|
||||
* <!-- END SNIPPET: example -->
|
||||
* </pre>
|
||||
*
|
||||
* @see TabbedPanel
|
||||
*
|
||||
* @a2.tag name="textarea" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.TextareaTag"
|
||||
* @s.tag name="textarea" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.TextareaTag"
|
||||
* description="Render HTML textarea tag."
|
||||
*/
|
||||
public class TextArea extends UIBean {
|
||||
@@ -78,7 +78,7 @@ public class TextArea extends UIBean {
|
||||
|
||||
/**
|
||||
* HTML cols attribute
|
||||
* @a2.tagattribute required="false" type="Integer"
|
||||
* @s.tagattribute required="false" type="Integer"
|
||||
*/
|
||||
public void setCols(String cols) {
|
||||
this.cols = cols;
|
||||
@@ -86,7 +86,7 @@ public class TextArea extends UIBean {
|
||||
|
||||
/**
|
||||
* Whether the textarea is readonly
|
||||
* @a2.tagattribute required="false" type="Boolean" default="false"
|
||||
* @s.tagattribute required="false" type="Boolean" default="false"
|
||||
*/
|
||||
public void setReadonly(String readonly) {
|
||||
this.readonly = readonly;
|
||||
@@ -94,7 +94,7 @@ public class TextArea extends UIBean {
|
||||
|
||||
/**
|
||||
* HTML rows attribute
|
||||
* @a2.tagattribute required="false" type="Integer"
|
||||
* @s.tagattribute required="false" type="Integer"
|
||||
*/
|
||||
public void setRows(String rows) {
|
||||
this.rows = rows;
|
||||
@@ -102,7 +102,7 @@ public class TextArea extends UIBean {
|
||||
|
||||
/**
|
||||
* HTML wrap attribute
|
||||
* @a2.tagattribute required="false" type="String"
|
||||
* @s.tagattribute required="false" type="String"
|
||||
*/
|
||||
public void setWrap(String wrap) {
|
||||
this.wrap = wrap;
|
||||
|
||||
@@ -17,11 +17,11 @@
|
||||
*/
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
* Render an HTML input field of type text</p>
|
||||
@@ -35,11 +35,11 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* <!-- END SNIPPET: exdescription -->
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example -->
|
||||
* <a:textfield label="%{text('user_name')}" name="user" />
|
||||
* <s:textfield label="%{text('user_name')}" name="user" />
|
||||
* <!-- END SNIPPET: example -->
|
||||
* </pre>
|
||||
*
|
||||
* @a2.tag name="textfield" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.TextFieldTag"
|
||||
* @s.tag name="textfield" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.TextFieldTag"
|
||||
* description="Render an HTML input field of type text"
|
||||
*/
|
||||
public class TextField extends UIBean {
|
||||
@@ -79,7 +79,7 @@ public class TextField extends UIBean {
|
||||
|
||||
/**
|
||||
* HTML maxlength attribute
|
||||
* @a2.tagattribute required="false" type="Integer"
|
||||
* @s.tagattribute required="false" type="Integer"
|
||||
*/
|
||||
public void setMaxlength(String maxlength) {
|
||||
this.maxlength = maxlength;
|
||||
@@ -87,7 +87,7 @@ public class TextField extends UIBean {
|
||||
|
||||
/**
|
||||
* Deprecated. Use maxlength instead.
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setMaxLength(String maxlength) {
|
||||
this.maxlength = maxlength;
|
||||
@@ -95,7 +95,7 @@ public class TextField extends UIBean {
|
||||
|
||||
/**
|
||||
* Whether the input is readonly
|
||||
* @a2.tagattribute required="false" type="Boolean" default="false"
|
||||
* @s.tagattribute required="false" type="Boolean" default="false"
|
||||
*/
|
||||
public void setReadonly(String readonly) {
|
||||
this.readonly = readonly;
|
||||
@@ -103,7 +103,7 @@ public class TextField extends UIBean {
|
||||
|
||||
/**
|
||||
* HTML size attribute
|
||||
* @a2.tagattribute required="false" type="Integer"
|
||||
* @s.tagattribute required="false" type="Integer"
|
||||
*/
|
||||
public void setSize(String size) {
|
||||
this.size = size;
|
||||
|
||||
@@ -112,7 +112,7 @@ public class TimePicker extends TextField {
|
||||
|
||||
/**
|
||||
* The format to use for time field.
|
||||
* @a2.tagattribute required="false" type="String" default="Dateformat specified by language preset (%Y/%m/%d for en)"
|
||||
* @s.tagattribute required="false" type="String" default="Dateformat specified by language preset (%Y/%m/%d for en)"
|
||||
*/
|
||||
public void setFormat(String format) {
|
||||
this.format = format;
|
||||
@@ -120,7 +120,7 @@ public class TimePicker extends TextField {
|
||||
|
||||
/**
|
||||
* The time picker icon path
|
||||
* @a2.tagattribute required="false" type="String" default="/struts/dojo/struts/widgets/dateIcon.gif"
|
||||
* @s.tagattribute required="false" type="String" default="/struts/dojo/struts/widgets/dateIcon.gif"
|
||||
*/
|
||||
public void setTimeIconPath(String timeIconPath) {
|
||||
this.timeIconPath = timeIconPath;
|
||||
@@ -128,7 +128,7 @@ public class TimePicker extends TextField {
|
||||
|
||||
/**
|
||||
* The time picker template path.
|
||||
* @a2.tagattribute required="false" type="String"
|
||||
* @s.tagattribute required="false" type="String"
|
||||
*/
|
||||
public void setTemplatePath(String templatePath) {
|
||||
this.templatePath = templatePath;
|
||||
@@ -136,7 +136,7 @@ public class TimePicker extends TextField {
|
||||
|
||||
/**
|
||||
* The time picker template css path.
|
||||
* @a2.tagattribute required="false" type="String"
|
||||
* @s.tagattribute required="false" type="String"
|
||||
*/
|
||||
public void setTemplateCssPath(String templateCssPath) {
|
||||
this.templateCssPath = templateCssPath;
|
||||
@@ -144,7 +144,7 @@ public class TimePicker extends TextField {
|
||||
|
||||
/**
|
||||
* The time picker text field size.
|
||||
* @a2.tagattribute required="false" type="String"
|
||||
* @s.tagattribute required="false" type="String"
|
||||
*/
|
||||
public void setSize(String size) {
|
||||
this.size = size;
|
||||
|
||||
@@ -17,21 +17,19 @@
|
||||
*/
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import java.util.Map;
|
||||
import org.apache.struts2.util.TokenHelper;
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.util.TokenHelper;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
* Stop double-submission of forms.</p>
|
||||
*
|
||||
* The token tag is used to help with the "double click" submission problem. It is needed if you are using the
|
||||
* TokenInterceptor or the TokenSessionInterceptor. The a:token tag merely places a hidden element that contains
|
||||
* TokenInterceptor or the TokenSessionInterceptor. The s:token tag merely places a hidden element that contains
|
||||
* the unique token.</p>
|
||||
* <!-- END SNIPPET: javadoc -->
|
||||
*
|
||||
@@ -39,14 +37,14 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
*
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example -->
|
||||
* <a:token />
|
||||
* <s:token />
|
||||
* <!-- END SNIPPET: example -->
|
||||
* </pre>
|
||||
*
|
||||
* @see org.apache.struts2.interceptor.TokenInterceptor
|
||||
* @see org.apache.struts2.interceptor.TokenSessionStoreInterceptor
|
||||
*
|
||||
* @a2.tag name="token" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.TokenTag"
|
||||
* @s.tag name="token" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.TokenTag"
|
||||
* description="Stop double-submission of forms"
|
||||
*/
|
||||
public class Token extends UIBean {
|
||||
|
||||
@@ -17,12 +17,11 @@
|
||||
*/
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import java.io.Writer;
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
import java.io.Writer;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
@@ -40,17 +39,17 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* <!-- START SNIPPET: example -->
|
||||
*
|
||||
* <-- statically -->
|
||||
* <saf:tree id="..." label="...">
|
||||
* <saf:treenode id="..." label="..." />
|
||||
* <saf:treenode id="..." label="...">
|
||||
* <saf:treenode id="..." label="..." />
|
||||
* <saf:treenode id="..." label="..." />
|
||||
* &;lt;/saf:treenode>
|
||||
* <saf:treenode id="..." label="..." />
|
||||
* </saf:tree>
|
||||
* <s:tree id="..." label="...">
|
||||
* <s:treenode id="..." label="..." />
|
||||
* <s:treenode id="..." label="...">
|
||||
* <s:treenode id="..." label="..." />
|
||||
* <s:treenode id="..." label="..." />
|
||||
* &;lt;/s:treenode>
|
||||
* <s:treenode id="..." label="..." />
|
||||
* </s:tree>
|
||||
*
|
||||
* <-- dynamically -->
|
||||
* <saf:tree
|
||||
* <s:tree
|
||||
* id="..."
|
||||
* rootNode="..."
|
||||
* nodeIdProperty="..."
|
||||
@@ -61,7 +60,7 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* @a2.tag name="tree" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.TreeTag"
|
||||
* @s.tag name="tree" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.TreeTag"
|
||||
* description="Render a tree widget."
|
||||
*/
|
||||
public class Tree extends ClosingUIBean {
|
||||
@@ -221,7 +220,7 @@ public class Tree extends ClosingUIBean {
|
||||
|
||||
/**
|
||||
* The toggle property (either 'explode' or 'fade'). Default is 'fade'.
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setToggle(String toggle) {
|
||||
this.toggle = toggle;
|
||||
@@ -233,7 +232,7 @@ public class Tree extends ClosingUIBean {
|
||||
|
||||
/**
|
||||
* The treeSelectedTopic property.
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setTreeSelectedTopic(String treeSelectedTopic) {
|
||||
this.treeSelectedTopic = treeSelectedTopic;
|
||||
@@ -245,7 +244,7 @@ public class Tree extends ClosingUIBean {
|
||||
|
||||
/**
|
||||
* The treeExpandedTopic property.
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setTreeExpandedTopic(String treeExpandedTopic) {
|
||||
this.treeExpandedTopic = treeExpandedTopic;
|
||||
@@ -257,7 +256,7 @@ public class Tree extends ClosingUIBean {
|
||||
|
||||
/**
|
||||
* The treeCollapsedTopic property.
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setTreeCollapsedTopic(String treeCollapsedTopic) {
|
||||
this.treeCollapsedTopic = treeCollapsedTopic;
|
||||
@@ -269,7 +268,7 @@ public class Tree extends ClosingUIBean {
|
||||
|
||||
/**
|
||||
* The rootNode property.
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setRootNode(String rootNode) {
|
||||
this.rootNodeAttr = rootNode;
|
||||
@@ -281,7 +280,7 @@ public class Tree extends ClosingUIBean {
|
||||
|
||||
/**
|
||||
* The childCollectionProperty property.
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setChildCollectionProperty(String childCollectionProperty) {
|
||||
this.childCollectionProperty = childCollectionProperty;
|
||||
@@ -293,7 +292,7 @@ public class Tree extends ClosingUIBean {
|
||||
|
||||
/**
|
||||
* The nodeTitleProperty property.
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setNodeTitleProperty(String nodeTitleProperty) {
|
||||
this.nodeTitleProperty = nodeTitleProperty;
|
||||
@@ -305,7 +304,7 @@ public class Tree extends ClosingUIBean {
|
||||
|
||||
/**
|
||||
* The nodeIdProperty property.
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setNodeIdProperty(String nodeIdProperty) {
|
||||
this.nodeIdProperty = nodeIdProperty;
|
||||
@@ -313,7 +312,7 @@ public class Tree extends ClosingUIBean {
|
||||
|
||||
/**
|
||||
* The showRootGrid property (default true).
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setShowRootGrid(String showRootGrid) {
|
||||
this.showRootGrid = showRootGrid;
|
||||
@@ -329,7 +328,7 @@ public class Tree extends ClosingUIBean {
|
||||
|
||||
/**
|
||||
* Blank icon image source.
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setBlankIconSrc(String blankIconSrc) {
|
||||
this.blankIconSrc = blankIconSrc;
|
||||
@@ -341,7 +340,7 @@ public class Tree extends ClosingUIBean {
|
||||
|
||||
/**
|
||||
* Expand icon (-) image source.
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setExpandIconSrcMinus(String expandIconSrcMinus) {
|
||||
this.expandIconSrcMinus = expandIconSrcMinus;
|
||||
@@ -353,7 +352,7 @@ public class Tree extends ClosingUIBean {
|
||||
|
||||
/**
|
||||
* Expand Icon (+) image source.
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setExpandIconSrcPlus(String expandIconSrcPlus) {
|
||||
this.expandIconSrcPlus = expandIconSrcPlus;
|
||||
@@ -365,7 +364,7 @@ public class Tree extends ClosingUIBean {
|
||||
|
||||
/**
|
||||
* Image source for under child item child icons.
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setGridIconSrcC(String gridIconSrcC) {
|
||||
this.gridIconSrcC = gridIconSrcC;
|
||||
@@ -378,7 +377,7 @@ public class Tree extends ClosingUIBean {
|
||||
|
||||
/**
|
||||
* Image source for last child grid.
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setGridIconSrcL(String gridIconSrcL) {
|
||||
this.gridIconSrcL = gridIconSrcL;
|
||||
@@ -390,7 +389,7 @@ public class Tree extends ClosingUIBean {
|
||||
|
||||
/**
|
||||
* Image source for under parent item child icons.
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setGridIconSrcP(String gridIconSrcP) {
|
||||
this.gridIconSrcP = gridIconSrcP;
|
||||
@@ -402,7 +401,7 @@ public class Tree extends ClosingUIBean {
|
||||
|
||||
/**
|
||||
* Image source for vertical line.
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setGridIconSrcV(String gridIconSrcV) {
|
||||
this.gridIconSrcV = gridIconSrcV;
|
||||
@@ -414,7 +413,7 @@ public class Tree extends ClosingUIBean {
|
||||
|
||||
/**
|
||||
* Image source for grid for sole root item.
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setGridIconSrcX(String gridIconSrcX) {
|
||||
this.gridIconSrcX = gridIconSrcX;
|
||||
@@ -426,7 +425,7 @@ public class Tree extends ClosingUIBean {
|
||||
|
||||
/**
|
||||
* Image source for grid for last root item.
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setGridIconSrcY(String gridIconSrcY) {
|
||||
this.gridIconSrcY = gridIconSrcY;
|
||||
@@ -439,7 +438,7 @@ public class Tree extends ClosingUIBean {
|
||||
|
||||
/**
|
||||
* Icon height (default 18 pixels).
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setIconHeight(String iconHeight) {
|
||||
this.iconHeight = iconHeight;
|
||||
@@ -451,7 +450,7 @@ public class Tree extends ClosingUIBean {
|
||||
|
||||
/**
|
||||
* Icon width (default 19 pixels).
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setIconWidth(String iconWidth) {
|
||||
this.iconWidth = iconWidth;
|
||||
@@ -465,7 +464,7 @@ public class Tree extends ClosingUIBean {
|
||||
|
||||
/**
|
||||
* Template css path (default {contextPath}/struts/tree.css.
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setTemplateCssPath(String templateCssPath) {
|
||||
this.templateCssPath = templateCssPath;
|
||||
@@ -477,7 +476,7 @@ public class Tree extends ClosingUIBean {
|
||||
|
||||
/**
|
||||
* Toggle duration (default 150 ms)
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setToggleDuration(String toggleDuration) {
|
||||
this.toggleDuration = toggleDuration;
|
||||
@@ -489,7 +488,7 @@ public class Tree extends ClosingUIBean {
|
||||
|
||||
/**
|
||||
* Show grid (default true).
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setShowGrid(String showGrid) {
|
||||
this.showGrid = showGrid;
|
||||
|
||||
@@ -17,11 +17,11 @@
|
||||
*/
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
*
|
||||
@@ -52,17 +52,17 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* <!-- START SNIPPET: example -->
|
||||
*
|
||||
* <-- statically -->
|
||||
* <ww:tree id="..." label="...">
|
||||
* <ww:treenode id="..." label="..." />
|
||||
* <ww:treenode id="..." label="...">
|
||||
* <ww:treenode id="..." label="..." />
|
||||
* <ww:treenode id="..." label="..." />
|
||||
* &;lt;/ww:treenode>
|
||||
* <ww:treenode id="..." label="..." />
|
||||
* </ww:tree>
|
||||
* <s:tree id="..." label="...">
|
||||
* <s:treenode id="..." label="..." />
|
||||
* <s:treenode id="..." label="...">
|
||||
* <s:treenode id="..." label="..." />
|
||||
* <s:treenode id="..." label="..." />
|
||||
* &;lt;/s:treenode>
|
||||
* <s:treenode id="..." label="..." />
|
||||
* </s:tree>
|
||||
*
|
||||
* <-- dynamically -->
|
||||
* <ww:tree
|
||||
* <s:tree
|
||||
* id="..."
|
||||
* rootNode="..."
|
||||
* nodeIdProperty="..."
|
||||
@@ -73,7 +73,7 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* @a2.tag name="treenode" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.TreeNodeTag"
|
||||
* @s.tag name="treenode" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.TreeNodeTag"
|
||||
* description="Render a tree node within a tree widget."
|
||||
*/
|
||||
public class TreeNode extends ClosingUIBean {
|
||||
@@ -94,7 +94,7 @@ public class TreeNode extends ClosingUIBean {
|
||||
|
||||
/**
|
||||
* Label expression used for rendering tree node label.
|
||||
* @a2.tagattribute required="true"
|
||||
* @s.tagattribute required="true"
|
||||
*/
|
||||
public void setLabel(String label) {
|
||||
super.setLabel(label);
|
||||
|
||||
@@ -17,17 +17,6 @@
|
||||
*/
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import java.io.Writer;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.struts2.StrutsConstants;
|
||||
import org.apache.struts2.components.template.Template;
|
||||
import org.apache.struts2.components.template.TemplateEngine;
|
||||
@@ -35,9 +24,18 @@ import org.apache.struts2.components.template.TemplateEngineManager;
|
||||
import org.apache.struts2.components.template.TemplateRenderingContext;
|
||||
import org.apache.struts2.config.Settings;
|
||||
import org.apache.struts2.views.util.ContextUtil;
|
||||
|
||||
import com.opensymphony.xwork2.config.ConfigurationException;
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.Writer;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* UIBean is the standard superclass of all Struts UI componentns.
|
||||
@@ -334,50 +332,50 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* <!-- START SNIPPET: tooltipexample -->
|
||||
*
|
||||
* <!-- Example 1: -->
|
||||
* <a:form
|
||||
* <s:form
|
||||
* tooltipConfig="#{'tooltipDelay':'500',
|
||||
* 'tooltipIcon='/myImages/myIcon.gif'}" .... >
|
||||
* ....
|
||||
* <a:textfield label="Customer Name" tooltip="Enter the customer name" .... />
|
||||
* <s:textfield label="Customer Name" tooltip="Enter the customer name" .... />
|
||||
* ....
|
||||
* </a:form>
|
||||
* </s:form>
|
||||
*
|
||||
* <!-- Example 2: -->
|
||||
* <a:form
|
||||
* <s:form
|
||||
* tooltipConfig="#{'tooltipDelay':'500',
|
||||
* 'tooltipIcon':'/myImages/myIcon.gif'}" ... >
|
||||
* ....
|
||||
* <a:textfield label="Address"
|
||||
* <s:textfield label="Address"
|
||||
* tooltip="Enter your address"
|
||||
* tooltipConfig="#{'tooltipDelay':'5000'}" />
|
||||
* ....
|
||||
* </a:form>
|
||||
* </s:form>
|
||||
*
|
||||
*
|
||||
* <-- Example 3: -->
|
||||
* <a:textfield
|
||||
* <s:textfield
|
||||
* label="Customer Name"
|
||||
* tooltip="One of our customer Details'">
|
||||
* <a:param name="tooltipConfig">
|
||||
* <s:param name="tooltipConfig">
|
||||
* tooltipDelay = 500 |
|
||||
* tooltipIcon = /myImages/myIcon.gif
|
||||
* </a:param>
|
||||
* </a:textfield>
|
||||
* </s:param>
|
||||
* </s:textfield>
|
||||
*
|
||||
*
|
||||
* <-- Example 4: -->
|
||||
* <a:textfield
|
||||
* <s:textfield
|
||||
* label="Customer Address"
|
||||
* tooltip="Enter The Customer Address" >
|
||||
* <a:param
|
||||
* <s:param
|
||||
* name="tooltipConfig"
|
||||
* value="#{'tooltipDelay':'500',
|
||||
* 'tooltipIcon':'/myImages/myIcon.gif'}" />
|
||||
* </a:textfield>
|
||||
* </s:textfield>
|
||||
*
|
||||
*
|
||||
* <-- Example 5: -->
|
||||
* <a:textfield
|
||||
* <s:textfield
|
||||
* label="Customer Telephone Number"
|
||||
* tooltip="Enter customer Telephone Number"
|
||||
* tooltipConfig="#{'tooltipDelay':'500',
|
||||
@@ -691,18 +689,8 @@ public abstract class UIBean extends Component {
|
||||
|
||||
final Form form = (Form) findAncestor(Form.class);
|
||||
|
||||
if (id != null) {
|
||||
// this check is needed for backwards compatibility with 2.1.x
|
||||
if (altSyntax()) {
|
||||
addParameter("id", findString(id));
|
||||
} else {
|
||||
addParameter("id", id);
|
||||
}
|
||||
} else if (form != null) {
|
||||
addParameter("id", form.getParameters().get("id") + "_" + escape(name));
|
||||
} else {
|
||||
addParameter("id", escape(name));
|
||||
}
|
||||
// create HTML id element
|
||||
populateComponentHtmlId(form);
|
||||
|
||||
if (form != null ) {
|
||||
addParameter("form", form.getParameters());
|
||||
@@ -817,10 +805,38 @@ public abstract class UIBean extends Component {
|
||||
return tooltipConfig;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create HTML id element for the component and populate this component parmaeter
|
||||
* map.
|
||||
*
|
||||
* The order is as follows :-
|
||||
* <ol>
|
||||
* <li>This component id attribute</li>
|
||||
* <li>[containing_form_id]_[this_component_name]</li>
|
||||
* <li>[this_component_name]</li>
|
||||
* </ol>
|
||||
*
|
||||
* @param form
|
||||
*/
|
||||
protected void populateComponentHtmlId(Form form) {
|
||||
if (id != null) {
|
||||
// this check is needed for backwards compatibility with 2.1.x
|
||||
if (altSyntax()) {
|
||||
addParameter("id", findString(id));
|
||||
} else {
|
||||
addParameter("id", id);
|
||||
}
|
||||
} else if (form != null) {
|
||||
addParameter("id", form.getParameters().get("id") + "_" + escape(name));
|
||||
} else {
|
||||
addParameter("id", escape(name));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The template directory.
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setTemplateDir(String templateDir) {
|
||||
this.templateDir = templateDir;
|
||||
@@ -828,7 +844,7 @@ public abstract class UIBean extends Component {
|
||||
|
||||
/**
|
||||
* The theme (other than default) to use for rendering the element
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setTheme(String theme) {
|
||||
this.theme = theme;
|
||||
@@ -840,7 +856,7 @@ public abstract class UIBean extends Component {
|
||||
|
||||
/**
|
||||
* The template (other than default) to use for rendering the element
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setTemplate(String template) {
|
||||
this.template = template;
|
||||
@@ -848,7 +864,7 @@ public abstract class UIBean extends Component {
|
||||
|
||||
/**
|
||||
* The css class to use for element
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setCssClass(String cssClass) {
|
||||
this.cssClass = cssClass;
|
||||
@@ -856,7 +872,7 @@ public abstract class UIBean extends Component {
|
||||
|
||||
/**
|
||||
* The css style definitions for element ro use
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setCssStyle(String cssStyle) {
|
||||
this.cssStyle = cssStyle;
|
||||
@@ -864,7 +880,7 @@ public abstract class UIBean extends Component {
|
||||
|
||||
/**
|
||||
* Set the html title attribute on rendered html element
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
@@ -872,7 +888,7 @@ public abstract class UIBean extends Component {
|
||||
|
||||
/**
|
||||
* Set the html disabled attribute on rendered html element
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setDisabled(String disabled) {
|
||||
this.disabled = disabled;
|
||||
@@ -880,7 +896,7 @@ public abstract class UIBean extends Component {
|
||||
|
||||
/**
|
||||
* Label expression used for rendering a element specific label
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setLabel(String label) {
|
||||
this.label = label;
|
||||
@@ -888,7 +904,7 @@ public abstract class UIBean extends Component {
|
||||
|
||||
/**
|
||||
* deprecated.
|
||||
* @a2.tagattribute required="false" default="left"
|
||||
* @s.tagattribute required="false" default="left"
|
||||
* @deprecated please use {@link #setLabelposition(String)} instead
|
||||
*/
|
||||
public void setLabelPosition(String labelPosition) {
|
||||
@@ -897,7 +913,7 @@ public abstract class UIBean extends Component {
|
||||
|
||||
/**
|
||||
* define label position of form element (top/left)
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setLabelposition(String labelPosition) {
|
||||
this.labelPosition = labelPosition;
|
||||
@@ -905,7 +921,7 @@ public abstract class UIBean extends Component {
|
||||
|
||||
/**
|
||||
* define required position of required form element (left|right)
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setRequiredposition(String requiredposition) {
|
||||
this.requiredposition = requiredposition;
|
||||
@@ -913,7 +929,7 @@ public abstract class UIBean extends Component {
|
||||
|
||||
/**
|
||||
* The name to set for element
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
@@ -921,7 +937,7 @@ public abstract class UIBean extends Component {
|
||||
|
||||
/**
|
||||
* If set to true, the rendered element will indicate that input is required
|
||||
* @a2.tagattribute required="false" type="Boolean" default="false"
|
||||
* @s.tagattribute required="false" type="Boolean" default="false"
|
||||
*/
|
||||
public void setRequired(String required) {
|
||||
this.required = required;
|
||||
@@ -929,7 +945,7 @@ public abstract class UIBean extends Component {
|
||||
|
||||
/**
|
||||
* Set the html tabindex attribute on rendered html element
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setTabindex(String tabindex) {
|
||||
this.tabindex = tabindex;
|
||||
@@ -937,7 +953,7 @@ public abstract class UIBean extends Component {
|
||||
|
||||
/**
|
||||
* Preset the value of input element.
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
@@ -945,7 +961,7 @@ public abstract class UIBean extends Component {
|
||||
|
||||
/**
|
||||
* Set the html onclick attribute on rendered html element
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setOnclick(String onclick) {
|
||||
this.onclick = onclick;
|
||||
@@ -953,7 +969,7 @@ public abstract class UIBean extends Component {
|
||||
|
||||
/**
|
||||
* Set the html ondblclick attribute on rendered html element
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setOndblclick(String ondblclick) {
|
||||
this.ondblclick = ondblclick;
|
||||
@@ -961,7 +977,7 @@ public abstract class UIBean extends Component {
|
||||
|
||||
/**
|
||||
* Set the html onmousedown attribute on rendered html element
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setOnmousedown(String onmousedown) {
|
||||
this.onmousedown = onmousedown;
|
||||
@@ -969,7 +985,7 @@ public abstract class UIBean extends Component {
|
||||
|
||||
/**
|
||||
* Set the html onmouseup attribute on rendered html element
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setOnmouseup(String onmouseup) {
|
||||
this.onmouseup = onmouseup;
|
||||
@@ -977,7 +993,7 @@ public abstract class UIBean extends Component {
|
||||
|
||||
/**
|
||||
* Set the html onmouseover attribute on rendered html element
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setOnmouseover(String onmouseover) {
|
||||
this.onmouseover = onmouseover;
|
||||
@@ -985,7 +1001,7 @@ public abstract class UIBean extends Component {
|
||||
|
||||
/**
|
||||
* Set the html onmousemove attribute on rendered html element
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setOnmousemove(String onmousemove) {
|
||||
this.onmousemove = onmousemove;
|
||||
@@ -993,7 +1009,7 @@ public abstract class UIBean extends Component {
|
||||
|
||||
/**
|
||||
* Set the html onmouseout attribute on rendered html element
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setOnmouseout(String onmouseout) {
|
||||
this.onmouseout = onmouseout;
|
||||
@@ -1001,7 +1017,7 @@ public abstract class UIBean extends Component {
|
||||
|
||||
/**
|
||||
* Set the html onfocus attribute on rendered html element
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setOnfocus(String onfocus) {
|
||||
this.onfocus = onfocus;
|
||||
@@ -1009,7 +1025,7 @@ public abstract class UIBean extends Component {
|
||||
|
||||
/**
|
||||
* Set the html onblur attribute on rendered html element
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setOnblur(String onblur) {
|
||||
this.onblur = onblur;
|
||||
@@ -1017,7 +1033,7 @@ public abstract class UIBean extends Component {
|
||||
|
||||
/**
|
||||
* Set the html onkeypress attribute on rendered html element
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setOnkeypress(String onkeypress) {
|
||||
this.onkeypress = onkeypress;
|
||||
@@ -1025,7 +1041,7 @@ public abstract class UIBean extends Component {
|
||||
|
||||
/**
|
||||
* Set the html onkeydown attribute on rendered html element
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setOnkeydown(String onkeydown) {
|
||||
this.onkeydown = onkeydown;
|
||||
@@ -1033,7 +1049,7 @@ public abstract class UIBean extends Component {
|
||||
|
||||
/**
|
||||
* Set the html onkeyup attribute on rendered html element
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setOnkeyup(String onkeyup) {
|
||||
this.onkeyup = onkeyup;
|
||||
@@ -1041,7 +1057,7 @@ public abstract class UIBean extends Component {
|
||||
|
||||
/**
|
||||
* Set the html onselect attribute on rendered html element
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setOnselect(String onselect) {
|
||||
this.onselect = onselect;
|
||||
@@ -1049,7 +1065,7 @@ public abstract class UIBean extends Component {
|
||||
|
||||
/**
|
||||
* Set the html onchange attribute on rendered html element
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setOnchange(String onchange) {
|
||||
this.onchange = onchange;
|
||||
@@ -1057,7 +1073,7 @@ public abstract class UIBean extends Component {
|
||||
|
||||
/**
|
||||
* Set the html accesskey attribute on rendered html element
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setAccesskey(String accesskey) {
|
||||
this.accesskey = accesskey;
|
||||
@@ -1065,7 +1081,7 @@ public abstract class UIBean extends Component {
|
||||
|
||||
/**
|
||||
* Set the tooltip of this particular component
|
||||
* @a2.tagattribute required="false" type="String" default=""
|
||||
* @s.tagattribute required="false" type="String" default=""
|
||||
*/
|
||||
public void setTooltip(String tooltip) {
|
||||
this.tooltip = tooltip;
|
||||
@@ -1073,7 +1089,7 @@ public abstract class UIBean extends Component {
|
||||
|
||||
/**
|
||||
* Set the tooltip configuration
|
||||
* @a2.tagattribute required="false" type="String" default=""
|
||||
* @s.tagattribute required="false" type="String" default=""
|
||||
*/
|
||||
public void setTooltipConfig(String tooltipConfig) {
|
||||
this.tooltipConfig = tooltipConfig;
|
||||
|
||||
@@ -17,25 +17,26 @@
|
||||
*/
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Writer;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.struts2.StrutsException;
|
||||
import org.apache.struts2.dispatcher.Dispatcher;
|
||||
import org.apache.struts2.portlet.context.PortletActionContext;
|
||||
import org.apache.struts2.portlet.util.PortletUrlHelper;
|
||||
import org.apache.struts2.views.util.UrlHelper;
|
||||
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import org.apache.struts2.dispatcher.Dispatcher;
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
import com.opensymphony.xwork2.util.XWorkContinuationConfig;
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpUtils;
|
||||
import java.io.IOException;
|
||||
import java.io.Writer;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
@@ -80,26 +81,26 @@ import com.opensymphony.xwork2.util.XWorkContinuationConfig;
|
||||
* <!-- START SNIPPET: example -->
|
||||
*
|
||||
* <-- Example 1 -->
|
||||
* <a:url value="editGadget.action">
|
||||
* <a:param name="id" value="%{selected}" />
|
||||
* </a:url>
|
||||
* <s:url value="editGadget.action">
|
||||
* <s:param name="id" value="%{selected}" />
|
||||
* </s:url>
|
||||
*
|
||||
* <-- Example 2 -->
|
||||
* <a:url action="editGadget">
|
||||
* <a:param name="id" value="%{selected}" />
|
||||
* </a:url>
|
||||
* <s:url action="editGadget">
|
||||
* <s:param name="id" value="%{selected}" />
|
||||
* </s:url>
|
||||
*
|
||||
* <-- Example 3-->
|
||||
* <a:url includeParams="get" >
|
||||
* <s:url includeParams="get" >
|
||||
* <:param name="id" value="%{'22'}" />
|
||||
* </a:url>
|
||||
* </s:url>
|
||||
*
|
||||
* <!-- END SNIPPET: example -->
|
||||
* </pre>
|
||||
*
|
||||
* @see Param
|
||||
*
|
||||
* @a2.tag name="url" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.URLTag"
|
||||
* @s.tag name="url" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.URLTag"
|
||||
* description="This tag is used to create a URL"
|
||||
*/
|
||||
public class URL extends Component {
|
||||
@@ -158,9 +159,10 @@ public class URL extends Component {
|
||||
}
|
||||
|
||||
if (NONE.equalsIgnoreCase(includeParams)) {
|
||||
mergeRequestParameters(value, parameters, Collections.EMPTY_MAP);
|
||||
ActionContext.getContext().put(XWorkContinuationConfig.CONTINUE_KEY, null);
|
||||
} else if (ALL.equalsIgnoreCase(includeParams)) {
|
||||
mergeRequestParameters(parameters, req.getParameterMap());
|
||||
mergeRequestParameters(value, parameters, req.getParameterMap());
|
||||
|
||||
// for ALL also include GET parameters
|
||||
includeGetParameters();
|
||||
@@ -180,10 +182,7 @@ public class URL extends Component {
|
||||
private void includeGetParameters() {
|
||||
if(!(Dispatcher.getInstance().isPortletSupportActive() && PortletActionContext.isPortletRequest())) {
|
||||
String query = extractQueryString();
|
||||
if (query != null) {
|
||||
//mergeRequestParameters(parameters, HttpUtils.parseQueryString(query));
|
||||
mergeRequestParameters(parameters, UrlHelper.parseQueryString(query));
|
||||
}
|
||||
mergeRequestParameters(value, parameters, UrlHelper.parseQueryString(query));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -222,7 +221,14 @@ public class URL extends Component {
|
||||
result = PortletUrlHelper.buildResourceUrl(value, parameters);
|
||||
}
|
||||
else {
|
||||
result = UrlHelper.buildUrl(value, req, res, parameters, scheme, includeContext, encode);
|
||||
String _value = value;
|
||||
|
||||
// We don't include the request parameters cause they would have been
|
||||
// prioritised before this [in start(Writer) method]
|
||||
if (_value != null && _value.indexOf("?") > 0) {
|
||||
_value = _value.substring(0, _value.indexOf("?"));
|
||||
}
|
||||
result = UrlHelper.buildUrl(_value, req, res, parameters, scheme, includeContext, encode);
|
||||
}
|
||||
}
|
||||
if ( anchor != null && anchor.length() > 0 ) {
|
||||
@@ -248,7 +254,7 @@ public class URL extends Component {
|
||||
|
||||
/**
|
||||
* The includeParams attribute may have the value 'none', 'get' or 'all'.
|
||||
* @a2.tagattribute required="false" default="get"
|
||||
* @s.tagattribute required="false" default="get"
|
||||
*/
|
||||
public void setIncludeParams(String includeParams) {
|
||||
this.includeParams = includeParams;
|
||||
@@ -256,7 +262,7 @@ public class URL extends Component {
|
||||
|
||||
/**
|
||||
* Set scheme attribute
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setScheme(String scheme) {
|
||||
this.scheme = scheme;
|
||||
@@ -264,7 +270,7 @@ public class URL extends Component {
|
||||
|
||||
/**
|
||||
* The target value to use, if not using action
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
@@ -272,7 +278,7 @@ public class URL extends Component {
|
||||
|
||||
/**
|
||||
* The action generate url for, if not using value
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setAction(String action) {
|
||||
this.action = action;
|
||||
@@ -280,7 +286,7 @@ public class URL extends Component {
|
||||
|
||||
/**
|
||||
* The namespace to use
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setNamespace(String namespace) {
|
||||
this.namespace = namespace;
|
||||
@@ -288,7 +294,8 @@ public class URL extends Component {
|
||||
|
||||
/**
|
||||
* The method of action to use
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
* @deprecated Since Struts 2.0.0
|
||||
*/
|
||||
public void setMethod(String method) {
|
||||
this.method = method;
|
||||
@@ -296,7 +303,7 @@ public class URL extends Component {
|
||||
|
||||
/**
|
||||
* whether to encode parameters
|
||||
* @a2.tagattribute required="false" type="Boolean" default="true"
|
||||
* @s.tagattribute required="false" type="Boolean" default="true"
|
||||
*/
|
||||
public void setEncode(boolean encode) {
|
||||
this.encode = encode;
|
||||
@@ -304,7 +311,7 @@ public class URL extends Component {
|
||||
|
||||
/**
|
||||
* whether actual context should be included in url
|
||||
* @a2.tagattribute required="false" type="Boolean" default="true"
|
||||
* @s.tagattribute required="false" type="Boolean" default="true"
|
||||
*/
|
||||
public void setIncludeContext(boolean includeContext) {
|
||||
this.includeContext = includeContext;
|
||||
@@ -312,7 +319,7 @@ public class URL extends Component {
|
||||
|
||||
/**
|
||||
* The resulting portlet mode
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setPortletMode(String portletMode) {
|
||||
this.portletMode = portletMode;
|
||||
@@ -320,7 +327,7 @@ public class URL extends Component {
|
||||
|
||||
/**
|
||||
* The resulting portlet window state
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setWindowState(String windowState) {
|
||||
this.windowState = windowState;
|
||||
@@ -328,7 +335,7 @@ public class URL extends Component {
|
||||
|
||||
/**
|
||||
* Specifies if this should be a portlet render or action url
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setPortletUrlType(String portletUrlType) {
|
||||
this.portletUrlType = portletUrlType;
|
||||
@@ -336,7 +343,7 @@ public class URL extends Component {
|
||||
|
||||
/**
|
||||
* The anchor for this URL
|
||||
* @a2.tagattribute required="false"
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
public void setAnchor(String anchor) {
|
||||
this.anchor = anchor;
|
||||
@@ -345,13 +352,52 @@ public class URL extends Component {
|
||||
|
||||
/**
|
||||
* Merge request parameters into current parameters. If a parameter is
|
||||
* already present, than the request parameter will not override its value.
|
||||
* already present, than the request parameter in the current request and value atrribute
|
||||
* will not override its value.
|
||||
*
|
||||
* The priority is as follows:-
|
||||
* <ul>
|
||||
* <li>parameter from the current request (least priority)</li>
|
||||
* <li>parameter form the value attribute (more priority)</li>
|
||||
* <li>parameter from the param tag (most priority)</li>
|
||||
* </ul>
|
||||
*
|
||||
* @param value the value attribute (url to be generated by this component)
|
||||
* @param parameters component parameters
|
||||
* @param contextParameters request parameters
|
||||
*/
|
||||
protected void mergeRequestParameters(Map parameters, Map contextParameters){
|
||||
for (Iterator iterator = contextParameters.entrySet().iterator(); iterator.hasNext();) {
|
||||
protected void mergeRequestParameters(String value, Map parameters, Map contextParameters){
|
||||
|
||||
Map mergedParams = new LinkedHashMap(contextParameters);
|
||||
|
||||
// Merge contextParameters (from current request) with parameters specified in value attribute
|
||||
// eg. value="someAction.action?id=someId&venue=someVenue"
|
||||
// where the parameters specified in value attribute takes priority.
|
||||
|
||||
if (value != null && value.trim().length() > 0 && value.indexOf("?") > 0) {
|
||||
mergedParams = new LinkedHashMap();
|
||||
|
||||
String queryString = value.substring(value.indexOf("?")+1);
|
||||
|
||||
mergedParams = UrlHelper.parseQueryString(queryString);
|
||||
for (Iterator iterator = contextParameters.entrySet().iterator(); iterator.hasNext();) {
|
||||
Map.Entry entry = (Map.Entry) iterator.next();
|
||||
Object key = entry.getKey();
|
||||
|
||||
if (!mergedParams.containsKey(key)) {
|
||||
mergedParams.put(key, entry.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Merge parameters specified in value attribute
|
||||
// eg. value="someAction.action?id=someId&venue=someVenue"
|
||||
// with parameters specified though param tag
|
||||
// eg. <param name="id" value="%{'someId'}" />
|
||||
// where parameters specified through param tag takes priority.
|
||||
|
||||
for (Iterator iterator = mergedParams.entrySet().iterator(); iterator.hasNext();) {
|
||||
Map.Entry entry = (Map.Entry) iterator.next();
|
||||
Object key = entry.getKey();
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* <!-- START SNIPPET: example -->
|
||||
*
|
||||
* <!-- Example 1: simple example -->
|
||||
* <a:updownselect
|
||||
* <s:updownselect
|
||||
* list="#{'england':'England', 'america':'America', 'germany':'Germany'}"
|
||||
* name="prioritisedFavouriteCountries"
|
||||
* headerKey="-1"
|
||||
@@ -51,7 +51,7 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
* emptyOption="true" />
|
||||
*
|
||||
* <!-- Example 2: more complex example -->
|
||||
* <a:updownselect
|
||||
* <s:updownselect
|
||||
* list="defaultFavouriteCartoonCharacters"
|
||||
* name="prioritisedFavouriteCartoonCharacters"
|
||||
* headerKey="-1"
|
||||
@@ -69,7 +69,7 @@ import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
*
|
||||
* @version $Date$ $Id$
|
||||
*
|
||||
* @a2.tag name="updownselect" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.UpDownSelectTag"
|
||||
* @s.tag name="updownselect" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.UpDownSelectTag"
|
||||
* description="Render a up down select element"
|
||||
*/
|
||||
public class UpDownSelect extends Select {
|
||||
@@ -148,7 +148,7 @@ public class UpDownSelect extends Select {
|
||||
ancestorForm.getParameters().put("updownselectIds", m);
|
||||
}
|
||||
else {
|
||||
_log.warn("no ancestor form found for updownselect "+this+", therefore autoselect of all elements unpon form submission will not work ");
|
||||
_log.warn("no ancestor form found for updownselect "+this+", therefore autoselect of all elements upon form submission will not work ");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,7 +158,7 @@ public class UpDownSelect extends Select {
|
||||
}
|
||||
/**
|
||||
* Whether move up button should be displayed
|
||||
* @a2.tagattribute required="false" type="Boolean" default="true"
|
||||
* @s.tagattribute required="false" type="Boolean" default="true"
|
||||
*/
|
||||
public void setAllowMoveUp(String allowMoveUp) {
|
||||
this.allowMoveUp = allowMoveUp;
|
||||
@@ -171,7 +171,7 @@ public class UpDownSelect extends Select {
|
||||
}
|
||||
/**
|
||||
* Whether move down button should be displayed
|
||||
* @a2.tagattribute required="false" type="Boolean" default="true"
|
||||
* @s.tagattribute required="false" type="Boolean" default="true"
|
||||
*/
|
||||
public void setAllowMoveDown(String allowMoveDown) {
|
||||
this.allowMoveDown = allowMoveDown;
|
||||
@@ -184,7 +184,7 @@ public class UpDownSelect extends Select {
|
||||
}
|
||||
/**
|
||||
* Whether or not select all button should be displayed
|
||||
* @a2.tagattribute required="false" type="Boolean" default="true"
|
||||
* @s.tagattribute required="false" type="Boolean" default="true"
|
||||
*/
|
||||
public void setAllowSelectAll(String allowSelectAll) {
|
||||
this.allowSelectAll = allowSelectAll;
|
||||
@@ -196,7 +196,7 @@ public class UpDownSelect extends Select {
|
||||
}
|
||||
/**
|
||||
* Text to display on the move up button
|
||||
* @a2.tagattribute required="false" type="String" default="^"
|
||||
* @s.tagattribute required="false" type="String" default="^"
|
||||
*/
|
||||
public void setMoveUpLabel(String moveUpLabel) {
|
||||
this.moveUpLabel = moveUpLabel;
|
||||
@@ -209,7 +209,7 @@ public class UpDownSelect extends Select {
|
||||
}
|
||||
/**
|
||||
* Text to display on the move down button
|
||||
* @a2.tagattribute required="false" type="String" default="v"
|
||||
* @s.tagattribute required="false" type="String" default="v"
|
||||
*/
|
||||
public void setMoveDownLabel(String moveDownLabel) {
|
||||
this.moveDownLabel = moveDownLabel;
|
||||
@@ -222,7 +222,7 @@ public class UpDownSelect extends Select {
|
||||
}
|
||||
/**
|
||||
* Text to display on the select all button
|
||||
* @a2.tagattribute required="false" type="String" default="*"
|
||||
* @s.tagattribute required="false" type="String" default="*"
|
||||
*/
|
||||
public void setSelectAllLabel(String selectAllLabel) {
|
||||
this.selectAllLabel = selectAllLabel;
|
||||
|
||||
@@ -17,11 +17,10 @@
|
||||
*/
|
||||
package org.apache.struts2.components.table;
|
||||
|
||||
import java.util.Vector;
|
||||
|
||||
import javax.swing.table.AbstractTableModel;
|
||||
import javax.swing.table.DefaultTableModel;
|
||||
import javax.swing.table.TableModel;
|
||||
import java.util.Vector;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -17,16 +17,15 @@
|
||||
*/
|
||||
package org.apache.struts2.components.table;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.event.TableModelEvent;
|
||||
import javax.swing.event.TableModelListener;
|
||||
import javax.swing.table.TableModel;
|
||||
import java.awt.event.MouseAdapter;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
|
||||
import javax.swing.JTable;
|
||||
import javax.swing.event.TableModelEvent;
|
||||
import javax.swing.event.TableModelListener;
|
||||
import javax.swing.table.TableModel;
|
||||
|
||||
|
||||
/**
|
||||
*/
|
||||
|
||||
@@ -17,25 +17,23 @@
|
||||
*/
|
||||
package org.apache.struts2.components.table;
|
||||
|
||||
import org.apache.struts2.StrutsException;
|
||||
import org.apache.struts2.components.GenericUIBean;
|
||||
import org.apache.struts2.components.table.renderer.CellRenderer;
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.swing.table.TableModel;
|
||||
import java.io.Writer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.NoSuchElementException;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.swing.table.TableModel;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.struts2.StrutsException;
|
||||
import org.apache.struts2.components.GenericUIBean;
|
||||
import org.apache.struts2.components.table.renderer.CellRenderer;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
/**
|
||||
* @a2.tag name="table" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.table.WebTableTag"
|
||||
* @s.tag name="table" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.table.WebTableTag"
|
||||
* description="Instantiate a JavaBean and place it in the context."
|
||||
*/
|
||||
public class WebTable extends GenericUIBean {
|
||||
@@ -206,7 +204,7 @@ public class WebTable extends GenericUIBean {
|
||||
|
||||
/**
|
||||
* The name of model to use
|
||||
* @a2.tagattribute required="true" type="String"
|
||||
* @s.tagattribute required="true" type="String"
|
||||
*/
|
||||
public void setModelName(String modelName) {
|
||||
this.modelName = modelName;
|
||||
@@ -246,7 +244,7 @@ public class WebTable extends GenericUIBean {
|
||||
|
||||
/**
|
||||
* Index of column to sort data by
|
||||
* @a2.tagattribute required="false" type="Integer"
|
||||
* @s.tagattribute required="false" type="Integer"
|
||||
*/
|
||||
public void setSortColumn(int sortColumn) {
|
||||
this.sortColumn = sortColumn;
|
||||
@@ -266,7 +264,7 @@ public class WebTable extends GenericUIBean {
|
||||
|
||||
/**
|
||||
* Set sort order. Allowed values are NONE, ASC and DESC
|
||||
* @a2.tagattribute required="false" type="String" default="NONE"
|
||||
* @s.tagattribute required="false" type="String" default="NONE"
|
||||
*/
|
||||
public void setSortOrder(String sortOrder) {
|
||||
if (sortOrder.equals(SortableTableModel.NONE)) {
|
||||
@@ -294,7 +292,7 @@ public class WebTable extends GenericUIBean {
|
||||
|
||||
/**
|
||||
* Whether the table should be sortable. Requires that model implements org.apache.struts2.components.table.SortableTableModel if set to true.
|
||||
* @a2.tagattribute required="false" type="Boolean" default="false"
|
||||
* @s.tagattribute required="false" type="Boolean" default="false"
|
||||
*/
|
||||
public void setSortable(boolean sortable) {
|
||||
sortableAttr = sortable;
|
||||
|
||||
+2
-2
@@ -17,10 +17,10 @@
|
||||
*/
|
||||
package org.apache.struts2.components.table.renderer;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
|
||||
import org.apache.struts2.components.table.WebTable;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
|
||||
|
||||
/**
|
||||
*/
|
||||
|
||||
+2
-2
@@ -17,10 +17,10 @@
|
||||
*/
|
||||
package org.apache.struts2.components.table.renderer;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
import org.apache.struts2.components.table.WebTable;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
|
||||
/**
|
||||
*/
|
||||
|
||||
@@ -17,6 +17,10 @@
|
||||
*/
|
||||
package org.apache.struts2.components.template;
|
||||
|
||||
import com.opensymphony.util.ClassLoaderUtil;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
@@ -26,11 +30,6 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import com.opensymphony.util.ClassLoaderUtil;
|
||||
|
||||
/**
|
||||
* Base class for template engines.
|
||||
*/
|
||||
|
||||
+14
-17
@@ -17,29 +17,26 @@
|
||||
*/
|
||||
package org.apache.struts2.components.template;
|
||||
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
import org.apache.struts2.views.freemarker.FreemarkerManager;
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.ActionInvocation;
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
import com.opensymphony.util.ClassLoaderUtil;
|
||||
import freemarker.template.Configuration;
|
||||
import freemarker.template.SimpleHash;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.io.Writer;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
import org.apache.struts2.views.freemarker.FreemarkerManager;
|
||||
|
||||
import com.opensymphony.util.ClassLoaderUtil;
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.ActionInvocation;
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
import freemarker.template.Configuration;
|
||||
import freemarker.template.SimpleHash;
|
||||
|
||||
/**
|
||||
* Freemarker based template engine.
|
||||
*/
|
||||
|
||||
@@ -17,19 +17,17 @@
|
||||
*/
|
||||
package org.apache.struts2.components.template;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.jsp.PageContext;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
import org.apache.struts2.components.Include;
|
||||
import org.apache.struts2.components.UIBean;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.jsp.PageContext;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* JSP based template engine.
|
||||
|
||||
+2
-2
@@ -17,11 +17,11 @@
|
||||
*/
|
||||
package org.apache.struts2.components.template;
|
||||
|
||||
import org.apache.struts2.config.Settings;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.struts2.config.Settings;
|
||||
|
||||
/**
|
||||
* The TemplateEngineManager will return a template engine for the template
|
||||
*/
|
||||
|
||||
+3
-4
@@ -17,13 +17,12 @@
|
||||
*/
|
||||
package org.apache.struts2.components.template;
|
||||
|
||||
import org.apache.struts2.components.UIBean;
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
import java.io.Writer;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.struts2.components.UIBean;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
/**
|
||||
* Context used when rendering templates.
|
||||
*/
|
||||
|
||||
+10
-11
@@ -17,23 +17,22 @@
|
||||
*/
|
||||
package org.apache.struts2.components.template;
|
||||
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
import org.apache.struts2.views.velocity.VelocityManager;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.velocity.app.VelocityEngine;
|
||||
import org.apache.velocity.context.Context;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.io.Writer;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
import org.apache.struts2.views.velocity.VelocityManager;
|
||||
import org.apache.velocity.app.VelocityEngine;
|
||||
import org.apache.velocity.context.Context;
|
||||
|
||||
/**
|
||||
* Velocity based template engine.
|
||||
*/
|
||||
|
||||
@@ -17,16 +17,15 @@
|
||||
*/
|
||||
package org.apache.struts2.config;
|
||||
|
||||
import com.opensymphony.xwork2.util.LocalizedTextUtil;
|
||||
import org.apache.struts2.StrutsConstants;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.struts2.StrutsConstants;
|
||||
|
||||
import com.opensymphony.xwork2.util.LocalizedTextUtil;
|
||||
|
||||
|
||||
/**
|
||||
* Default implementation of Settings - creates and delegates to other settingss by using an internal
|
||||
|
||||
@@ -17,16 +17,15 @@
|
||||
*/
|
||||
package org.apache.struts2.config;
|
||||
|
||||
import com.opensymphony.xwork2.ObjectFactory;
|
||||
import org.apache.struts2.StrutsConstants;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.Locale;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.struts2.StrutsConstants;
|
||||
|
||||
import com.opensymphony.xwork2.ObjectFactory;
|
||||
|
||||
|
||||
/**
|
||||
* Handles all Struts config properties. Implementation of this class is pluggable (the
|
||||
|
||||
@@ -17,14 +17,13 @@
|
||||
*/
|
||||
package org.apache.struts2.config_browser;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
|
||||
import org.apache.struts2.StrutsConstants;
|
||||
import org.apache.struts2.config.Settings;
|
||||
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import com.opensymphony.xwork2.config.entities.ActionConfig;
|
||||
import org.apache.struts2.config.Settings;
|
||||
import org.apache.struts2.StrutsConstants;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
|
||||
/**
|
||||
* ActionNamesAction
|
||||
|
||||
@@ -17,14 +17,14 @@
|
||||
*/
|
||||
package org.apache.struts2.config_browser;
|
||||
|
||||
import com.opensymphony.xwork2.config.entities.ActionConfig;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.struts2.dispatcher.Dispatcher;
|
||||
|
||||
import com.opensymphony.xwork2.config.entities.ActionConfig;
|
||||
|
||||
/**
|
||||
* ConfigurationHelper
|
||||
*/
|
||||
|
||||
@@ -17,14 +17,13 @@
|
||||
*/
|
||||
package org.apache.struts2.config_browser;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.validator.ActionValidatorManagerFactory;
|
||||
import org.apache.struts2.util.ClassLoaderUtils;
|
||||
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import com.opensymphony.xwork2.validator.ActionValidatorManagerFactory;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* ListValidatorsAction loads the validations for a given class and context
|
||||
|
||||
@@ -17,17 +17,15 @@
|
||||
*/
|
||||
package org.apache.struts2.config_browser;
|
||||
|
||||
import java.beans.PropertyDescriptor;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
|
||||
import com.opensymphony.xwork2.ObjectFactory;
|
||||
import com.opensymphony.xwork2.config.entities.ActionConfig;
|
||||
import ognl.OgnlRuntime;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import com.opensymphony.xwork2.ObjectFactory;
|
||||
import com.opensymphony.xwork2.config.entities.ActionConfig;
|
||||
import java.beans.PropertyDescriptor;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
|
||||
/**
|
||||
* ShowConfigAction
|
||||
|
||||
@@ -17,6 +17,13 @@
|
||||
*/
|
||||
package org.apache.struts2.config_browser;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlUtil;
|
||||
import com.opensymphony.xwork2.validator.Validator;
|
||||
import ognl.Ognl;
|
||||
import ognl.OgnlException;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import java.beans.BeanInfo;
|
||||
import java.beans.IntrospectionException;
|
||||
import java.beans.Introspector;
|
||||
@@ -26,22 +33,11 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
|
||||
import ognl.Ognl;
|
||||
import ognl.OgnlException;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlUtil;
|
||||
import com.opensymphony.xwork2.validator.Validator;
|
||||
|
||||
/**
|
||||
* ShowValidatorAction
|
||||
*
|
||||
*/
|
||||
public class ShowValidatorAction extends ListValidatorsAction {
|
||||
private static final long serialVersionUID = 4061534149317835177L;
|
||||
|
||||
private static Log log = LogFactory.getLog(ShowValidatorAction.class);
|
||||
|
||||
Set properties = Collections.EMPTY_SET;
|
||||
|
||||
@@ -17,22 +17,14 @@
|
||||
*/
|
||||
package org.apache.struts2.dispatcher;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.servlet.Filter;
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.FilterConfig;
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.ServletResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import javax.servlet.*;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* <!-- SNIPPET START: description -->
|
||||
|
||||
@@ -17,14 +17,9 @@
|
||||
*/
|
||||
package org.apache.struts2.dispatcher;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.AbstractMap;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
import java.io.Serializable;
|
||||
import java.util.*;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -21,7 +21,6 @@ package org.apache.struts2.dispatcher;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
|
||||
/**
|
||||
|
||||
@@ -17,55 +17,40 @@
|
||||
*/
|
||||
package org.apache.struts2.dispatcher;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.opensymphony.util.ClassLoaderUtil;
|
||||
import com.opensymphony.util.FileManager;
|
||||
import com.opensymphony.xwork2.*;
|
||||
import com.opensymphony.xwork2.config.ConfigurationException;
|
||||
import com.opensymphony.xwork2.config.ConfigurationManager;
|
||||
import com.opensymphony.xwork2.config.providers.XmlConfigurationProvider;
|
||||
import com.opensymphony.xwork2.util.*;
|
||||
import com.opensymphony.xwork2.util.location.Location;
|
||||
import com.opensymphony.xwork2.util.location.LocationUtils;
|
||||
import freemarker.template.Template;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
import org.apache.struts2.StrutsConstants;
|
||||
import org.apache.struts2.StrutsStatics;
|
||||
import org.apache.struts2.impl.StrutsObjectFactory;
|
||||
import org.apache.struts2.impl.StrutsActionProxyFactory;
|
||||
import org.apache.struts2.config.Settings;
|
||||
import org.apache.struts2.config.StrutsXMLConfigurationProvider;
|
||||
import org.apache.struts2.dispatcher.mapper.ActionMapping;
|
||||
import org.apache.struts2.dispatcher.multipart.MultiPartRequest;
|
||||
import org.apache.struts2.dispatcher.multipart.MultiPartRequestWrapper;
|
||||
import org.apache.struts2.impl.StrutsActionProxyFactory;
|
||||
import org.apache.struts2.impl.StrutsObjectFactory;
|
||||
import org.apache.struts2.util.AttributeMap;
|
||||
import org.apache.struts2.util.ObjectFactoryDestroyable;
|
||||
import org.apache.struts2.util.ObjectFactoryInitializable;
|
||||
import org.apache.struts2.views.freemarker.FreemarkerManager;
|
||||
|
||||
import com.opensymphony.util.ClassLoaderUtil;
|
||||
import com.opensymphony.util.FileManager;
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.ActionProxy;
|
||||
import com.opensymphony.xwork2.ActionProxyFactory;
|
||||
import com.opensymphony.xwork2.ObjectFactory;
|
||||
import com.opensymphony.xwork2.Result;
|
||||
import com.opensymphony.xwork2.config.ConfigurationException;
|
||||
import com.opensymphony.xwork2.config.ConfigurationManager;
|
||||
import com.opensymphony.xwork2.config.providers.XmlConfigurationProvider;
|
||||
import com.opensymphony.xwork2.util.LocalizedTextUtil;
|
||||
import com.opensymphony.xwork2.util.ObjectTypeDeterminer;
|
||||
import com.opensymphony.xwork2.util.ObjectTypeDeterminerFactory;
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
import com.opensymphony.xwork2.util.XWorkContinuationConfig;
|
||||
import com.opensymphony.xwork2.util.location.Location;
|
||||
import com.opensymphony.xwork2.util.location.LocationUtils;
|
||||
|
||||
import freemarker.template.Template;
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* A utility class the actual dispatcher delegates most of its tasks to. Each instance
|
||||
@@ -92,6 +77,7 @@ public class Dispatcher {
|
||||
private ConfigurationManager configurationManager;
|
||||
private boolean portletSupportActive;
|
||||
private boolean devMode = false;
|
||||
private boolean compatibilityMode = true;
|
||||
|
||||
// used to get WebLogic to play nice
|
||||
private boolean paramsWorkaroundEnabled = false;
|
||||
|
||||
@@ -107,6 +107,9 @@ import com.opensymphony.xwork2.ActionContext;
|
||||
* database access credentials.
|
||||
*
|
||||
* <p/>
|
||||
*
|
||||
* To use a custom {@link Dispatcher}, the <code>createDispatcher()</code> method could be overriden by
|
||||
* the subclass.
|
||||
*
|
||||
* @see org.apache.struts2.lifecycle.LifecycleListener
|
||||
* @see ActionMapper
|
||||
@@ -154,9 +157,9 @@ public class FilterDispatcher implements Filter, StrutsStatics {
|
||||
packages = param + " " + packages;
|
||||
}
|
||||
this.pathPrefixes = parse(packages);
|
||||
dispatcher = new Dispatcher(filterConfig.getServletContext());
|
||||
dispatcher = createDispatcher();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Parses the list of packages
|
||||
*
|
||||
@@ -230,7 +233,7 @@ public class FilterDispatcher implements Filter, StrutsStatics {
|
||||
// this is a normal request, let it pass through
|
||||
chain.doFilter(request, response);
|
||||
}
|
||||
// WW did its job here
|
||||
// The framework did its job here
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -365,4 +368,14 @@ public class FilterDispatcher implements Filter, StrutsStatics {
|
||||
|
||||
return ClassLoaderUtil.getResourceAsStream(resourcePath, getClass());
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a {@link Dispatcher}, this serves as a hook for subclass to overried
|
||||
* such that a custom {@link Dispatcher} could be created.
|
||||
*
|
||||
* @return Dispatcher
|
||||
*/
|
||||
protected Dispatcher createDispatcher() {
|
||||
return new Dispatcher(filterConfig.getServletContext());
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -17,16 +17,16 @@
|
||||
*/
|
||||
package org.apache.struts2.dispatcher;
|
||||
|
||||
import org.apache.struts2.config.ServletContextSingleton;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import javax.servlet.Filter;
|
||||
import javax.servlet.FilterConfig;
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.struts2.config.ServletContextSingleton;
|
||||
|
||||
|
||||
/**
|
||||
* When running Weblogic Server 6.1, this class should be
|
||||
|
||||
@@ -17,20 +17,18 @@
|
||||
*/
|
||||
package org.apache.struts2.dispatcher;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.ActionInvocation;
|
||||
import com.opensymphony.xwork2.Result;
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
import com.opensymphony.xwork2.util.TextParseUtil;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: description -->
|
||||
|
||||
@@ -17,14 +17,13 @@
|
||||
*/
|
||||
package org.apache.struts2.dispatcher;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.Serializable;
|
||||
import java.util.AbstractMap;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
|
||||
/**
|
||||
* A simple implementation of the {@link java.util.Map} interface to handle a collection of request attributes.
|
||||
|
||||
@@ -28,8 +28,8 @@ import org.apache.struts2.dispatcher.mapper.ActionMapperFactory;
|
||||
import org.apache.struts2.dispatcher.mapper.ActionMapping;
|
||||
import org.apache.struts2.views.util.UrlHelper;
|
||||
|
||||
import com.opensymphony.xwork2.ActionInvocation;
|
||||
import com.opensymphony.xwork2.config.entities.ResultConfig;
|
||||
import com.opensymphony.xwork2.ActionInvocation;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: description -->
|
||||
|
||||
@@ -17,17 +17,16 @@
|
||||
*/
|
||||
package org.apache.struts2.dispatcher;
|
||||
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
import com.opensymphony.xwork2.ActionInvocation;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import javax.servlet.RequestDispatcher;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.jsp.PageContext;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
|
||||
import com.opensymphony.xwork2.ActionInvocation;
|
||||
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: description -->
|
||||
|
||||
@@ -17,16 +17,15 @@
|
||||
*/
|
||||
package org.apache.struts2.dispatcher;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
import org.apache.struts2.dispatcher.mapper.ActionMapperFactory;
|
||||
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.ActionInvocation;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -17,17 +17,10 @@
|
||||
*/
|
||||
package org.apache.struts2.dispatcher;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.AbstractMap;
|
||||
import java.util.Collections;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.io.Serializable;
|
||||
import java.util.*;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -17,16 +17,15 @@
|
||||
*/
|
||||
package org.apache.struts2.dispatcher;
|
||||
|
||||
import com.opensymphony.xwork2.ActionInvocation;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import com.opensymphony.xwork2.ActionInvocation;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: description -->
|
||||
*
|
||||
@@ -80,7 +79,7 @@ public class StreamResult extends StrutsResultSupport {
|
||||
protected static final Log log = LogFactory.getLog(StreamResult.class);
|
||||
|
||||
protected String contentType = "text/plain";
|
||||
protected int contentLength;
|
||||
protected String contentLength;
|
||||
protected String contentDisposition = "inline";
|
||||
protected String inputName = "inputStream";
|
||||
protected int bufferSize = 1024;
|
||||
@@ -116,14 +115,14 @@ public class StreamResult extends StrutsResultSupport {
|
||||
/**
|
||||
* @return Returns the contentLength.
|
||||
*/
|
||||
public int getContentLength() {
|
||||
public String getContentLength() {
|
||||
return contentLength;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param contentLength The contentLength to set.
|
||||
*/
|
||||
public void setContentLength(int contentLength) {
|
||||
public void setContentLength(String contentLength) {
|
||||
this.contentLength = contentLength;
|
||||
}
|
||||
|
||||
@@ -155,7 +154,7 @@ public class StreamResult extends StrutsResultSupport {
|
||||
this.inputName = inputName;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
/**
|
||||
* @see org.apache.struts2.dispatcher.StrutsResultSupport#doExecute(java.lang.String, com.opensymphony.xwork2.ActionInvocation)
|
||||
*/
|
||||
protected void doExecute(String finalLocation, ActionInvocation invocation) throws Exception {
|
||||
@@ -181,8 +180,18 @@ public class StreamResult extends StrutsResultSupport {
|
||||
oResponse.setContentType(conditionalParse(contentType, invocation));
|
||||
|
||||
// Set the content length
|
||||
if (contentLength != 0) {
|
||||
oResponse.setContentLength(contentLength);
|
||||
if (contentLength != null) {
|
||||
String _contentLength = conditionalParse(contentLength, invocation);
|
||||
int _contentLengthAsInt = -1;
|
||||
try {
|
||||
_contentLengthAsInt = Integer.parseInt(_contentLength);
|
||||
if (_contentLengthAsInt >= 0) {
|
||||
oResponse.setContentLength(_contentLengthAsInt);
|
||||
}
|
||||
}
|
||||
catch(NumberFormatException e) {
|
||||
log.warn("failed to recongnize "+_contentLength+" as a number, contentLength header will not be set", e);
|
||||
}
|
||||
}
|
||||
|
||||
// Set the content-disposition
|
||||
|
||||
@@ -17,12 +17,12 @@
|
||||
*/
|
||||
package org.apache.struts2.dispatcher;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletRequestWrapper;
|
||||
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletRequestWrapper;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
*
|
||||
|
||||
@@ -23,7 +23,6 @@ import java.net.URLEncoder;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.struts2.StrutsStatics;
|
||||
|
||||
import com.opensymphony.xwork2.ActionInvocation;
|
||||
import com.opensymphony.xwork2.Result;
|
||||
import com.opensymphony.xwork2.util.TextParseUtil;
|
||||
|
||||
@@ -17,8 +17,19 @@
|
||||
*/
|
||||
package org.apache.struts2.dispatcher;
|
||||
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.io.Writer;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
import org.apache.struts2.StrutsConstants;
|
||||
import org.apache.struts2.config.Settings;
|
||||
import org.apache.struts2.views.JspSupportServlet;
|
||||
import org.apache.struts2.views.velocity.VelocityManager;
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.ActionInvocation;
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.velocity.Template;
|
||||
import org.apache.velocity.app.VelocityEngine;
|
||||
import org.apache.velocity.context.Context;
|
||||
|
||||
import javax.servlet.Servlet;
|
||||
import javax.servlet.ServletContext;
|
||||
@@ -26,21 +37,8 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.jsp.JspFactory;
|
||||
import javax.servlet.jsp.PageContext;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
import org.apache.struts2.StrutsConstants;
|
||||
import org.apache.struts2.config.Settings;
|
||||
import org.apache.struts2.views.JspSupportServlet;
|
||||
import org.apache.struts2.views.velocity.VelocityManager;
|
||||
import org.apache.velocity.Template;
|
||||
import org.apache.velocity.app.VelocityEngine;
|
||||
import org.apache.velocity.context.Context;
|
||||
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.ActionInvocation;
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.io.Writer;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -17,15 +17,15 @@
|
||||
*/
|
||||
package org.apache.struts2.dispatcher.mapper;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.struts2.config.Settings;
|
||||
import org.apache.struts2.StrutsConstants;
|
||||
import org.apache.struts2.StrutsException;
|
||||
import org.apache.struts2.config.Settings;
|
||||
|
||||
import com.opensymphony.xwork2.ObjectFactory;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
|
||||
@@ -17,10 +17,10 @@
|
||||
*/
|
||||
package org.apache.struts2.dispatcher.mapper;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import com.opensymphony.xwork2.Result;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Simple class that holds the action mapping information used to invoke a
|
||||
* Struts action. The name and namespace are required, but the params map
|
||||
|
||||
@@ -17,21 +17,21 @@
|
||||
*/
|
||||
package org.apache.struts2.dispatcher.mapper;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.struts2.RequestUtils;
|
||||
import org.apache.struts2.StrutsConstants;
|
||||
import org.apache.struts2.config.Settings;
|
||||
import org.apache.struts2.dispatcher.ServletRedirectResult;
|
||||
import org.apache.struts2.util.PrefixTrie;
|
||||
|
||||
import com.opensymphony.xwork2.config.Configuration;
|
||||
import com.opensymphony.xwork2.config.entities.PackageConfig;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Arrays;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
*
|
||||
@@ -149,36 +149,33 @@ public class DefaultActionMapper implements ActionMapper {
|
||||
static final String REDIRECT_PREFIX = "redirect:";
|
||||
static final String REDIRECT_ACTION_PREFIX = "redirect-action:";
|
||||
|
||||
private static boolean allowDynamicMethodCalls = "true".equals(Settings.get(StrutsConstants.STRUTS_ENABLE_DYNAMIC_METHOD_INVOCATION));
|
||||
|
||||
private PrefixTrie prefixTrie = null;
|
||||
private boolean compatibilityMode = false;
|
||||
public DefaultActionMapper() {
|
||||
if (org.apache.struts2.config.Settings.isSet(StrutsConstants.STRUTS_COMPATIBILITY_MODE)) {
|
||||
compatibilityMode = "true".equals(org.apache.struts2.config.Settings.get(StrutsConstants.STRUTS_COMPATIBILITY_MODE));
|
||||
}
|
||||
prefixTrie = new PrefixTrie() {
|
||||
{
|
||||
if (compatibilityMode) {
|
||||
put(METHOD_PREFIX, new ParameterAction() {
|
||||
public void execute(String key, ActionMapping mapping) {
|
||||
mapping.setMethod(key.substring(METHOD_PREFIX.length()));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
put(METHOD_PREFIX, new ParameterAction() {
|
||||
public void execute(String key, ActionMapping mapping) {
|
||||
mapping.setMethod(key.substring(METHOD_PREFIX.length()));
|
||||
}
|
||||
});
|
||||
|
||||
put(ACTION_PREFIX, new ParameterAction() {
|
||||
public void execute(String key, ActionMapping mapping) {
|
||||
String name = key.substring(ACTION_PREFIX.length());
|
||||
int bang = name.indexOf('!');
|
||||
if (bang != -1) {
|
||||
String method = name.substring(bang + 1);
|
||||
mapping.setMethod(method);
|
||||
name = name.substring(0, bang);
|
||||
if (allowDynamicMethodCalls) {
|
||||
int bang = name.indexOf('!');
|
||||
if (bang != -1) {
|
||||
String method = name.substring(bang + 1);
|
||||
mapping.setMethod(method);
|
||||
name = name.substring(0, bang);
|
||||
}
|
||||
}
|
||||
|
||||
mapping.setName(name);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
put(REDIRECT_PREFIX, new ParameterAction() {
|
||||
public void execute(String key, ActionMapping mapping) {
|
||||
ServletRedirectResult redirect = new ServletRedirectResult();
|
||||
@@ -218,7 +215,7 @@ public class DefaultActionMapper implements ActionMapper {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (compatibilityMode) {
|
||||
if (allowDynamicMethodCalls) {
|
||||
// handle "name!method" convention.
|
||||
String name = mapping.getName();
|
||||
int exclamation = name.lastIndexOf("!");
|
||||
@@ -227,6 +224,7 @@ public class DefaultActionMapper implements ActionMapper {
|
||||
mapping.setMethod(name.substring(exclamation + 1));
|
||||
}
|
||||
}
|
||||
|
||||
return mapping;
|
||||
}
|
||||
|
||||
@@ -373,18 +371,13 @@ public class DefaultActionMapper implements ActionMapper {
|
||||
}
|
||||
uri.append(name);
|
||||
|
||||
if (compatibilityMode) {
|
||||
if (null != mapping.getMethod() && !"".equals(mapping.getMethod())) {
|
||||
uri.append("!").append(mapping.getMethod());
|
||||
}
|
||||
if (null != mapping.getMethod() && !"".equals(mapping.getMethod())) {
|
||||
uri.append("!").append(mapping.getMethod());
|
||||
}
|
||||
|
||||
String extension = getDefaultExtension();
|
||||
if ( extension != null) {
|
||||
|
||||
// When in compatibility mode, we don't add an extension if it exists already
|
||||
// otherwise, we always add it
|
||||
if (!compatibilityMode || (compatibilityMode && uri.indexOf( '.' + extension) == -1 )) {
|
||||
if (uri.indexOf( '.' + extension) == -1 ) {
|
||||
uri.append(".").append(extension);
|
||||
if ( params.length() > 0) {
|
||||
uri.append(params);
|
||||
|
||||
@@ -17,20 +17,20 @@
|
||||
*/
|
||||
package org.apache.struts2.dispatcher.mapper;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import org.apache.struts2.RequestUtils;
|
||||
|
||||
import com.opensymphony.xwork2.config.Configuration;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.net.URLDecoder;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.struts2.RequestUtils;
|
||||
|
||||
import com.opensymphony.xwork2.config.Configuration;
|
||||
|
||||
/**
|
||||
* A custom action mapper using the following format:
|
||||
* <p/>
|
||||
|
||||
+7
-15
@@ -17,24 +17,16 @@
|
||||
*/
|
||||
package org.apache.struts2.dispatcher.multipart;
|
||||
|
||||
import org.apache.commons.fileupload.*;
|
||||
import org.apache.commons.fileupload.servlet.ServletFileUpload;
|
||||
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
|
||||
import org.apache.commons.fileupload.disk.DiskFileItem;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.commons.fileupload.FileItem;
|
||||
import org.apache.commons.fileupload.FileUploadException;
|
||||
import org.apache.commons.fileupload.RequestContext;
|
||||
import org.apache.commons.fileupload.disk.DiskFileItem;
|
||||
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
|
||||
import org.apache.commons.fileupload.servlet.ServletFileUpload;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* Multipart form data request adapter for Jakarta Commons Fileupload package.
|
||||
|
||||
+9
-16
@@ -17,25 +17,18 @@
|
||||
*/
|
||||
package org.apache.struts2.dispatcher.multipart;
|
||||
|
||||
import org.apache.struts2.config.Settings;
|
||||
import org.apache.struts2.dispatcher.StrutsRequestWrapper;
|
||||
import org.apache.struts2.StrutsConstants;
|
||||
import org.apache.struts2.util.ClassLoaderUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.File;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Vector;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.struts2.StrutsConstants;
|
||||
import org.apache.struts2.config.Settings;
|
||||
import org.apache.struts2.dispatcher.StrutsRequestWrapper;
|
||||
import org.apache.struts2.util.ClassLoaderUtils;
|
||||
import java.util.*;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,14 +2,13 @@
|
||||
|
||||
package org.apache.struts2.impl;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.opensymphony.xwork2.ActionInvocation;
|
||||
import org.apache.struts2.spi.ActionContext;
|
||||
import org.apache.struts2.spi.Result;
|
||||
|
||||
import com.opensymphony.xwork2.ActionInvocation;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class ActionContextImpl implements ActionContext {
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user