[
https://issues.apache.org/jira/browse/WW-3999?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13665387#comment-13665387
]
Hudson commented on WW-3999:
----------------------------
Integrated in Struts2-JDK6 #711 (See
[https://builds.apache.org/job/Struts2-JDK6/711/])
WW-3999 Allows set respond code (Revision 1485653)
Result = SUCCESS
lukaszlenart :
Files :
*
/struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/xslt/XSLTResult.java
*
/struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/xslt/XSLTResultTest.java
> Allow XSLT result types to set response code
> --------------------------------------------
>
> Key: WW-3999
> URL: https://issues.apache.org/jira/browse/WW-3999
> Project: Struts 2
> Issue Type: Improvement
> Components: Other
> Affects Versions: 2.3.12
> Reporter: Steve Wolke
> Assignee: Lukasz Lenart
> Priority: Minor
> Fix For: 2.3.15
>
> Attachments: WW-3999.patch, XSLTResult.diff
>
> Original Estimate: 24h
> Remaining Estimate: 24h
>
> 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{
> + this.status = Integer.valueOf(status);
> + }catch(NumberFormatException e){
> + throw new IllegalArgumentException("Status value not number" +
> e.getMessage());
> + }
> + }
> +
> public String getExposedValue() {
> return exposedValue;
> }
>
> +
> public void setExposedValue(String exposedValue) {
> this.exposedValue = exposedValue;
> }
> @@ -328,7 +344,7 @@
>
> try {
> HttpServletResponse response =
> ServletActionContext.getResponse();
> -
> + response.setStatus(status);
> PrintWriter writer = response.getWriter();
>
> // Create a transformer for the stylesheet.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira