Description
Allow the XSLT Result type to return a custom HTTP status code.
not sure where to put files so here is a diff of suggested changes:
@@ -229,6 +229,9 @@
/** Indicates the location of the xsl template. */
private String stylesheetLocation;
+ /** Indicates the status to return in the response*/
+ private int status=200;
+
/** Indicates the property name patterns which should be exposed to the xml. */
private String matchingPattern;
@@ -271,10 +274,23 @@
return stylesheetLocation;
}
+ public String getStatus()
{ + return String.valueOf(status); + }+
+ public void setStatus(String status) {
+ try
catch(NumberFormatException e)
{ + throw new IllegalArgumentException("Status value not number" + e.getMessage()); + }+ }
+
public String getExposedValue()
+
public void setExposedValue(String exposedValue)
@@ -328,7 +344,7 @@
try {
HttpServletResponse response = ServletActionContext.getResponse();
-
+ response.setStatus(status);
PrintWriter writer = response.getWriter();
// Create a transformer for the stylesheet.