mirror of
https://github.com/apache/struts.git
synced 2026-08-11 01:27:14 +00:00
WW-2285 Apply FIXBUG patches supplied by Giovanni Azua Garcia.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@611998 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -137,17 +137,8 @@ public class ComboBox extends TextField {
|
||||
Map tmp = (Map) value;
|
||||
addParameter("list", MakeIterator.convert(tmp));
|
||||
addParameter("listKey", "key");
|
||||
addParameter("listValue", "value");
|
||||
} else if (value.getClass().isArray()) {
|
||||
Iterator i = MakeIterator.convert(value);
|
||||
addParameter("list", i);
|
||||
if (listKey != null) {
|
||||
addParameter("listKey", listKey);
|
||||
}
|
||||
if (listValue != null) {
|
||||
addParameter("listValue", listValue);
|
||||
}
|
||||
} else {
|
||||
addParameter("listValue", "value");
|
||||
} else { // also covers "if (value.getClass().isArray())"
|
||||
Iterator i = MakeIterator.convert(value);
|
||||
addParameter("list", i);
|
||||
if (listKey != null) {
|
||||
|
||||
@@ -44,7 +44,6 @@ public class StrutsObjectFactory extends ObjectFactory {
|
||||
params.putAll(typeParams);
|
||||
if (refParams != null && !refParams.isEmpty())
|
||||
params.putAll(refParams);
|
||||
params.putAll(refParams);
|
||||
|
||||
try {
|
||||
// interceptor instances are long-lived and used across user sessions, so don't try to pass in any extra
|
||||
|
||||
@@ -125,7 +125,7 @@ import com.opensymphony.xwork2.util.logging.LoggerFactory;
|
||||
*
|
||||
* @see org.apache.struts2.util.IteratorGenerator
|
||||
*/
|
||||
@StrutsTag(name="generator", tldTagClass="org.apache.struts2.views.jsp.iterator.IteratorGeneratorTag",
|
||||
@StrutsTag(name="generator", tldTagClass="org.apache.struts2.views.jsp.iterator.IteratorGeneratorTag",
|
||||
description="Generate an iterator for a iterable source.")
|
||||
public class IteratorGeneratorTag extends StrutsBodyTagSupport {
|
||||
|
||||
@@ -175,7 +175,7 @@ public class IteratorGeneratorTag extends StrutsBodyTagSupport {
|
||||
public void setId(String string) {
|
||||
setVar(string);
|
||||
}
|
||||
|
||||
|
||||
@StrutsTagAttribute(description="The name to store the resultant iterator into page context, if such name is supplied")
|
||||
public void setVar(String var) {
|
||||
this.var = var;
|
||||
@@ -197,17 +197,8 @@ public class IteratorGeneratorTag extends StrutsBodyTagSupport {
|
||||
int count = 0;
|
||||
if (countAttr != null && countAttr.length() > 0) {
|
||||
Object countObj = findValue(countAttr);
|
||||
if (countObj instanceof Integer) {
|
||||
count = ((Integer)countObj).intValue();
|
||||
}
|
||||
else if (countObj instanceof Float) {
|
||||
count = ((Float)countObj).intValue();
|
||||
}
|
||||
else if (countObj instanceof Long) {
|
||||
count = ((Long)countObj).intValue();
|
||||
}
|
||||
else if (countObj instanceof Double) {
|
||||
count = ((Double) countObj).intValue();
|
||||
if (countObj instanceof Number) {
|
||||
count = ((Number)countObj).intValue();
|
||||
}
|
||||
else if (countObj instanceof String) {
|
||||
try {
|
||||
|
||||
@@ -178,13 +178,13 @@ public class SubsetIteratorTag extends StrutsBodyTagSupport {
|
||||
* @s.tagattribute required="false" type="Integer"
|
||||
* description="Indicate the starting index (eg. first entry is 0) of entries in the source to be available as the first entry in the resulting subset iterator"
|
||||
*/
|
||||
@StrutsTagAttribute(type="Integer",
|
||||
@StrutsTagAttribute(type="Integer",
|
||||
description="Indicate the starting index (eg. first entry is 0) of entries in the source to be available as the first entry in the resulting subset iterator")
|
||||
public void setStart(String start) {
|
||||
startAttr = start;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(type="org.apache.struts2.util.SubsetIteratorFilter.Decider",
|
||||
@StrutsTagAttribute(type="org.apache.struts2.util.SubsetIteratorFilter.Decider",
|
||||
description="Extension to plug-in a decider to determine if that particular entry is to be included in the resulting subset iterator")
|
||||
public void setDecider(String decider) {
|
||||
deciderAttr = decider;
|
||||
@@ -194,7 +194,7 @@ public class SubsetIteratorTag extends StrutsBodyTagSupport {
|
||||
public void setId(String string) {
|
||||
setVar(string);
|
||||
}
|
||||
|
||||
|
||||
@StrutsTagAttribute(description="The name to store the resultant iterator into page context, if such name is supplied")
|
||||
public void setVar(String var) {
|
||||
this.var = var;
|
||||
@@ -214,17 +214,8 @@ public class SubsetIteratorTag extends StrutsBodyTagSupport {
|
||||
int count = -1;
|
||||
if (countAttr != null && countAttr.length() > 0) {
|
||||
Object countObj = findValue(countAttr);
|
||||
if (countObj instanceof Integer) {
|
||||
count = ((Integer)countObj).intValue();
|
||||
}
|
||||
else if (countObj instanceof Float) {
|
||||
count = ((Float)countObj).intValue();
|
||||
}
|
||||
else if (countObj instanceof Long) {
|
||||
count = ((Long)countObj).intValue();
|
||||
}
|
||||
else if (countObj instanceof Double) {
|
||||
count = ((Double)countObj).intValue();
|
||||
if (countObj instanceof Number) {
|
||||
count = ((Number)countObj).intValue();
|
||||
}
|
||||
else if (countObj instanceof String) {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user