Action boolean properties values are not available to XSLTResult.
-----------------------------------------------------------------
Key: WW-2457
URL: https://issues.apache.org/struts/browse/WW-2457
Project: Struts 2
Issue Type: Bug
Components: Other
Affects Versions: 2.1.0, 2.0.11, 2.0.10
Environment: Windows XP, JDK 1.5
Reporter: Steve Wolke
For instance the action BooleanAction.java:
------------------------------------------------------------------
import com.opensymphony.xwork2.Action;
public class BooleanAction implements Action{
private boolean testFalse = false;
public String execute() throws Exception { return this.SUCCESS;}
public boolean isTestFalse() { return testFalse; }
public void setTestFalse(boolean testFalse) { this.testFalse = testFalse;}
}
------------------------------------------------------------------
will produce the result:
<result>
<testFalse/>
</result>
but should produce :
<result>
<testFalse>false</testFalse>
</result>
The diff below fixes the problem with
org.apache.struts2.views.xslt.AdapterFactory creating a BeanAdapter for a
java.lang.Boolean value:
Index: AdapterFactory.java
===================================================================
--- AdapterFactory.java (revision 615211)
+++ AdapterFactory.java (working copy)
@@ -146,7 +146,7 @@
if (valueType.isArray())
adapterClass = ArrayAdapter.class;
- else if (value instanceof String || value instanceof Number ||
valueType.isPrimitive())
+ else if (value instanceof String || value instanceof Number || value
instanceof Boolean || valueType.isPrimitive())
adapterClass = StringAdapter.class;
else if (value instanceof Collection)
adapterClass = CollectionAdapter.class;
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.