You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Kevin Dahlhausen (JIRA)" <ji...@apache.org> on 2007/08/01 22:04:06 UTC

[jira] Created: (WW-2082) Result annotation for StreamResult uses value tag instead of inputName parameter for the name of the stream property

Result annotation for StreamResult uses value tag instead of  inputName parameter for the name of the stream property
---------------------------------------------------------------------------------------------------------------------

                 Key: WW-2082
                 URL: https://issues.apache.org/struts/browse/WW-2082
             Project: Struts 2
          Issue Type: Bug
    Affects Versions: 2.0.9, 2.0.8
         Environment: MS Windows, IBM RAD 7 Test Environment, WAS 6.1, Java 5
            Reporter: Kevin Dahlhausen
            Priority: Minor


The documentation for StreamResult at http://struts.apache.org/2.x/docs/stream-result.html and the released code differ on how the name of the result stream is determined by the framework.  The documentation says that this name is defined by he 'inputName' parameter, while the released code uses the 'value' tag of the result annotation.

In the following code, getXxx() is called to return the stream instead of getYyy() as the documentation would indicate.


@Result (name="success", type=StreamResult.class, value="xxx", params={"inputName", "yyy", "contentType", "application/x-download", "contentDisposition", "attachment; filename=test.txt"})
public class Download2Action extends ActionSupport
{   
    public InputStream getYyy() throws Exception
    { 
    	System.out.println("getYyy about to create stream");
    	return new FileInputStream("C:/temp/support.txt"); 
    }
    
    public InputStream getXxx() throws Exception 
    { 
    	System.out.println("getXxx about to create stream");
    	return new FileInputStream("C:/temp/support.txt"); 
    }

    public String execute() throws Exception
    {
    	System.out.println("Download2Action");
        return SUCCESS;
    }

}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (WW-2082) Result annotation for StreamResult uses value tag instead of inputName parameter for the name of the stream property

Posted by "Don Brown (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2082?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Don Brown resolved WW-2082.
---------------------------

    Resolution: Fixed
      Assignee: Don Brown

Actually, it turns out, they are the same thing.  The "value" attribute in the Result annotation, known in the XML config as the default parameter for a result, sets the 'inputName' parameter.  Therefore, when you define both the 'inputName' and the default parameter, the regular 'inputName' is processed first, then the default parameter is processed, overwriting the specifically named parameter.  

We could switch this, however, it would cause an issue for backwards-compatibility.  I'd rather just update the docs to clarify how the default parameter works.  I've updated the result types page: http://cwiki.apache.org/confluence/display/WW/Result+Types

> Result annotation for StreamResult uses value tag instead of  inputName parameter for the name of the stream property
> ---------------------------------------------------------------------------------------------------------------------
>
>                 Key: WW-2082
>                 URL: https://issues.apache.org/struts/browse/WW-2082
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - CodeBehind
>    Affects Versions: 2.0.8, 2.0.9
>         Environment: MS Windows, IBM RAD 7 Test Environment, WAS 6.1, Java 5
>            Reporter: Kevin Dahlhausen
>            Assignee: Don Brown
>            Priority: Minor
>             Fix For: 2.1.2
>
>
> The documentation for StreamResult at http://struts.apache.org/2.x/docs/stream-result.html and the released code differ on how the name of the result stream is determined by the framework.  The documentation says that this name is defined by he 'inputName' parameter, while the released code uses the 'value' tag of the result annotation.
> In the following code, getXxx() is called to return the stream instead of getYyy() as the documentation would indicate.
> @Result (name="success", type=StreamResult.class, value="xxx", params={"inputName", "yyy", "contentType", "application/x-download", "contentDisposition", "attachment; filename=test.txt"})
> public class Download2Action extends ActionSupport
> {   
>     //param inputName says this should be called
>     public InputStream getYyy() throws Exception
>     { 
>     	return new FileInputStream("C:/temp/support.txt"); 
>     }
>     
>     // value tag actually determines that this is called instead
>     public InputStream getXxx() throws Exception 
>     { 
>     	return new FileInputStream("C:/temp/support.txt"); 
>     }
>     public String execute() throws Exception
>     {
>         return SUCCESS;
>     }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WW-2082) Result annotation for StreamResult uses value tag instead of inputName parameter for the name of the stream property

Posted by "James Holmes (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2082?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

James Holmes updated WW-2082:
-----------------------------

    Fix Version/s:     (was: 2.0.11)
                   2.0.12

> Result annotation for StreamResult uses value tag instead of  inputName parameter for the name of the stream property
> ---------------------------------------------------------------------------------------------------------------------
>
>                 Key: WW-2082
>                 URL: https://issues.apache.org/struts/browse/WW-2082
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Configuration
>    Affects Versions: 2.0.8, 2.0.9
>         Environment: MS Windows, IBM RAD 7 Test Environment, WAS 6.1, Java 5
>            Reporter: Kevin Dahlhausen
>            Priority: Minor
>             Fix For: 2.0.12
>
>
> The documentation for StreamResult at http://struts.apache.org/2.x/docs/stream-result.html and the released code differ on how the name of the result stream is determined by the framework.  The documentation says that this name is defined by he 'inputName' parameter, while the released code uses the 'value' tag of the result annotation.
> In the following code, getXxx() is called to return the stream instead of getYyy() as the documentation would indicate.
> @Result (name="success", type=StreamResult.class, value="xxx", params={"inputName", "yyy", "contentType", "application/x-download", "contentDisposition", "attachment; filename=test.txt"})
> public class Download2Action extends ActionSupport
> {   
>     //param inputName says this should be called
>     public InputStream getYyy() throws Exception
>     { 
>     	return new FileInputStream("C:/temp/support.txt"); 
>     }
>     
>     // value tag actually determines that this is called instead
>     public InputStream getXxx() throws Exception 
>     { 
>     	return new FileInputStream("C:/temp/support.txt"); 
>     }
>     public String execute() throws Exception
>     {
>         return SUCCESS;
>     }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WW-2082) Result annotation for StreamResult uses value tag instead of inputName parameter for the name of the stream property

Posted by "Kevin Dahlhausen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2082?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kevin Dahlhausen updated WW-2082:
---------------------------------

    Description: 
The documentation for StreamResult at http://struts.apache.org/2.x/docs/stream-result.html and the released code differ on how the name of the result stream is determined by the framework.  The documentation says that this name is defined by he 'inputName' parameter, while the released code uses the 'value' tag of the result annotation.

In the following code, getXxx() is called to return the stream instead of getYyy() as the documentation would indicate.


@Result (name="success", type=StreamResult.class, value="xxx", params={"inputName", "yyy", "contentType", "application/x-download", "contentDisposition", "attachment; filename=test.txt"})
public class Download2Action extends ActionSupport
{   
    //param inputName says this should be called
    public InputStream getYyy() throws Exception
    { 
    	return new FileInputStream("C:/temp/support.txt"); 
    }
    
    // value tag actually determines that this is called instead
    public InputStream getXxx() throws Exception 
    { 
    	return new FileInputStream("C:/temp/support.txt"); 
    }

    public String execute() throws Exception
    {
        return SUCCESS;
    }

}

  was:
The documentation for StreamResult at http://struts.apache.org/2.x/docs/stream-result.html and the released code differ on how the name of the result stream is determined by the framework.  The documentation says that this name is defined by he 'inputName' parameter, while the released code uses the 'value' tag of the result annotation.

In the following code, getXxx() is called to return the stream instead of getYyy() as the documentation would indicate.


@Result (name="success", type=StreamResult.class, value="xxx", params={"inputName", "yyy", "contentType", "application/x-download", "contentDisposition", "attachment; filename=test.txt"})
public class Download2Action extends ActionSupport
{   
    public InputStream getYyy() throws Exception
    { 
    	System.out.println("getYyy about to create stream");
    	return new FileInputStream("C:/temp/support.txt"); 
    }
    
    public InputStream getXxx() throws Exception 
    { 
    	System.out.println("getXxx about to create stream");
    	return new FileInputStream("C:/temp/support.txt"); 
    }

    public String execute() throws Exception
    {
    	System.out.println("Download2Action");
        return SUCCESS;
    }

}


clarified the sample code

> Result annotation for StreamResult uses value tag instead of  inputName parameter for the name of the stream property
> ---------------------------------------------------------------------------------------------------------------------
>
>                 Key: WW-2082
>                 URL: https://issues.apache.org/struts/browse/WW-2082
>             Project: Struts 2
>          Issue Type: Bug
>    Affects Versions: 2.0.8, 2.0.9
>         Environment: MS Windows, IBM RAD 7 Test Environment, WAS 6.1, Java 5
>            Reporter: Kevin Dahlhausen
>            Priority: Minor
>
> The documentation for StreamResult at http://struts.apache.org/2.x/docs/stream-result.html and the released code differ on how the name of the result stream is determined by the framework.  The documentation says that this name is defined by he 'inputName' parameter, while the released code uses the 'value' tag of the result annotation.
> In the following code, getXxx() is called to return the stream instead of getYyy() as the documentation would indicate.
> @Result (name="success", type=StreamResult.class, value="xxx", params={"inputName", "yyy", "contentType", "application/x-download", "contentDisposition", "attachment; filename=test.txt"})
> public class Download2Action extends ActionSupport
> {   
>     //param inputName says this should be called
>     public InputStream getYyy() throws Exception
>     { 
>     	return new FileInputStream("C:/temp/support.txt"); 
>     }
>     
>     // value tag actually determines that this is called instead
>     public InputStream getXxx() throws Exception 
>     { 
>     	return new FileInputStream("C:/temp/support.txt"); 
>     }
>     public String execute() throws Exception
>     {
>         return SUCCESS;
>     }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WW-2082) Result annotation for StreamResult uses value tag instead of inputName parameter for the name of the stream property

Posted by "James Holmes (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2082?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

James Holmes updated WW-2082:
-----------------------------

      Component/s: Configuration
    Fix Version/s: 2.0.10

We either need to fix the docs or update the code.

> Result annotation for StreamResult uses value tag instead of  inputName parameter for the name of the stream property
> ---------------------------------------------------------------------------------------------------------------------
>
>                 Key: WW-2082
>                 URL: https://issues.apache.org/struts/browse/WW-2082
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Configuration
>    Affects Versions: 2.0.8, 2.0.9
>         Environment: MS Windows, IBM RAD 7 Test Environment, WAS 6.1, Java 5
>            Reporter: Kevin Dahlhausen
>            Priority: Minor
>             Fix For: 2.0.10
>
>
> The documentation for StreamResult at http://struts.apache.org/2.x/docs/stream-result.html and the released code differ on how the name of the result stream is determined by the framework.  The documentation says that this name is defined by he 'inputName' parameter, while the released code uses the 'value' tag of the result annotation.
> In the following code, getXxx() is called to return the stream instead of getYyy() as the documentation would indicate.
> @Result (name="success", type=StreamResult.class, value="xxx", params={"inputName", "yyy", "contentType", "application/x-download", "contentDisposition", "attachment; filename=test.txt"})
> public class Download2Action extends ActionSupport
> {   
>     //param inputName says this should be called
>     public InputStream getYyy() throws Exception
>     { 
>     	return new FileInputStream("C:/temp/support.txt"); 
>     }
>     
>     // value tag actually determines that this is called instead
>     public InputStream getXxx() throws Exception 
>     { 
>     	return new FileInputStream("C:/temp/support.txt"); 
>     }
>     public String execute() throws Exception
>     {
>         return SUCCESS;
>     }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WW-2082) Result annotation for StreamResult uses value tag instead of inputName parameter for the name of the stream property

Posted by "James Holmes (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2082?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

James Holmes updated WW-2082:
-----------------------------

    Fix Version/s:     (was: 2.0.10)
                   2.0.11

> Result annotation for StreamResult uses value tag instead of  inputName parameter for the name of the stream property
> ---------------------------------------------------------------------------------------------------------------------
>
>                 Key: WW-2082
>                 URL: https://issues.apache.org/struts/browse/WW-2082
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Configuration
>    Affects Versions: 2.0.8, 2.0.9
>         Environment: MS Windows, IBM RAD 7 Test Environment, WAS 6.1, Java 5
>            Reporter: Kevin Dahlhausen
>            Priority: Minor
>             Fix For: 2.0.11
>
>
> The documentation for StreamResult at http://struts.apache.org/2.x/docs/stream-result.html and the released code differ on how the name of the result stream is determined by the framework.  The documentation says that this name is defined by he 'inputName' parameter, while the released code uses the 'value' tag of the result annotation.
> In the following code, getXxx() is called to return the stream instead of getYyy() as the documentation would indicate.
> @Result (name="success", type=StreamResult.class, value="xxx", params={"inputName", "yyy", "contentType", "application/x-download", "contentDisposition", "attachment; filename=test.txt"})
> public class Download2Action extends ActionSupport
> {   
>     //param inputName says this should be called
>     public InputStream getYyy() throws Exception
>     { 
>     	return new FileInputStream("C:/temp/support.txt"); 
>     }
>     
>     // value tag actually determines that this is called instead
>     public InputStream getXxx() throws Exception 
>     { 
>     	return new FileInputStream("C:/temp/support.txt"); 
>     }
>     public String execute() throws Exception
>     {
>         return SUCCESS;
>     }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.