You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "dapeng.ni (JIRA)" <ji...@apache.org> on 2008/08/22 03:05:24 UTC

[jira] Created: (WW-2780) return null, rather than throw NullpointExetion while ServletActionContext.getRequest()

return null, rather than throw NullpointExetion while ServletActionContext.getRequest()
---------------------------------------------------------------------------------------

                 Key: WW-2780
                 URL: https://issues.apache.org/struts/browse/WW-2780
             Project: Struts 2
          Issue Type: Improvement
          Components: Core Actions
    Affects Versions: 2.1.2
            Reporter: dapeng.ni


I use STRUTS in mixed env with other framework.  In 2.0.x ,  I create utility method to get HttpRequest.  It try to get request from ServletActionContext.getRequest(), if it return null, then get from another API.  

But in 2.1.2,  if request is not from STRUTS,  ServletActionContext.getRequest() will throw NullpointException.. It is not good design. as I have to put try-catch even it just simply need a HttpRequest.

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


[jira] Commented: (WW-2780) return null, rather than throw NullpointExetion while ServletActionContext.getRequest()

Posted by "Wes Wannemacher (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2780?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45377#action_45377 ] 

Wes Wannemacher commented on WW-2780:
-------------------------------------

dapeng.ni, we haven't heard back from you since we asked for the stack trace a few weeks ago. I'm going to change this from Major to minor and it'd probably be easiest if you create a patch for us... That way we can evaluate what you're suggesting.

> return null, rather than throw NullpointExetion while ServletActionContext.getRequest()
> ---------------------------------------------------------------------------------------
>
>                 Key: WW-2780
>                 URL: https://issues.apache.org/struts/browse/WW-2780
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Core Actions
>    Affects Versions: 2.1.2
>            Reporter: dapeng.ni
>             Fix For: 2.1.4
>
>
> I use STRUTS in mixed env with other framework.  In 2.0.x ,  I create utility method to get HttpRequest.  It try to get request from ServletActionContext.getRequest(), if it return null, then get from another API.  
> But in 2.1.2,  if request is not from STRUTS,  ServletActionContext.getRequest() will throw NullpointException.. It is not good design. as I have to put try-catch even it just simply need a HttpRequest.

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


[jira] Commented: (WW-2780) return null, rather than throw NullpointExetion while ServletActionContext.getRequest()

Posted by "Wes Wannemacher (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2780?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45138#action_45138 ] 

Wes Wannemacher commented on WW-2780:
-------------------------------------

James,
I could be reading this wrong, but maybe there is an NPE in ServletActionContext.getResult()... The NPE may just be bubbling up to his utility method. I would leave it open for now, but change the Fix Version to 2.1.4.

dapeng.ni,
Can you post the stack trace of the NPE you receive? that would help us to track down why this is happening.

> return null, rather than throw NullpointExetion while ServletActionContext.getRequest()
> ---------------------------------------------------------------------------------------
>
>                 Key: WW-2780
>                 URL: https://issues.apache.org/struts/browse/WW-2780
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Core Actions
>    Affects Versions: 2.1.2
>            Reporter: dapeng.ni
>             Fix For: 2.1.3
>
>
> I use STRUTS in mixed env with other framework.  In 2.0.x ,  I create utility method to get HttpRequest.  It try to get request from ServletActionContext.getRequest(), if it return null, then get from another API.  
> But in 2.1.2,  if request is not from STRUTS,  ServletActionContext.getRequest() will throw NullpointException.. It is not good design. as I have to put try-catch even it just simply need a HttpRequest.

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


[jira] Issue Comment Edited: (WW-2780) return null, rather than throw NullpointExetion while ServletActionContext.getRequest()

Posted by "Musachy Barroso (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2780?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45378#action_45378 ] 

musachy edited comment on WW-2780 at 12/23/08 7:34 PM:
---------------------------------------------------------------

By "request is not from STRUTS" do you mean that the filter handling the request is the one for the other framework? In that case must of the struts methods in classed classes like ServletActionContext will fail (there is nothing we can do in that case either). 

      was (Author: musachy):
    By "request is not from STRUTS" do you mean that the filter handling the request is the one for the other framework? In that case must of the struts methods in classed classes like ServletActionContext will fail (there is nothing we can do in that either). 
  
> return null, rather than throw NullpointExetion while ServletActionContext.getRequest()
> ---------------------------------------------------------------------------------------
>
>                 Key: WW-2780
>                 URL: https://issues.apache.org/struts/browse/WW-2780
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Core Actions
>    Affects Versions: 2.1.2
>            Reporter: dapeng.ni
>            Priority: Minor
>             Fix For: 2.1.4
>
>
> I use STRUTS in mixed env with other framework.  In 2.0.x ,  I create utility method to get HttpRequest.  It try to get request from ServletActionContext.getRequest(), if it return null, then get from another API.  
> But in 2.1.2,  if request is not from STRUTS,  ServletActionContext.getRequest() will throw NullpointException.. It is not good design. as I have to put try-catch even it just simply need a HttpRequest.

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


[jira] Updated: (WW-2780) return null, rather than throw NullpointExetion while ServletActionContext.getRequest()

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

Wes Wannemacher updated WW-2780:
--------------------------------

    Priority: Minor  (was: Major)

> return null, rather than throw NullpointExetion while ServletActionContext.getRequest()
> ---------------------------------------------------------------------------------------
>
>                 Key: WW-2780
>                 URL: https://issues.apache.org/struts/browse/WW-2780
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Core Actions
>    Affects Versions: 2.1.2
>            Reporter: dapeng.ni
>            Priority: Minor
>             Fix For: 2.1.4
>
>
> I use STRUTS in mixed env with other framework.  In 2.0.x ,  I create utility method to get HttpRequest.  It try to get request from ServletActionContext.getRequest(), if it return null, then get from another API.  
> But in 2.1.2,  if request is not from STRUTS,  ServletActionContext.getRequest() will throw NullpointException.. It is not good design. as I have to put try-catch even it just simply need a HttpRequest.

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


[jira] Commented: (WW-2780) return null, rather than throw NullpointExetion while ServletActionContext.getRequest()

Posted by "Musachy Barroso (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2780?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45378#action_45378 ] 

Musachy Barroso commented on WW-2780:
-------------------------------------

By "request is not from STRUTS" do you mean that the filter handling the request is the one for the other framework? In that case must of the struts methods in classed classes like ServletActionContext will fail (there is nothing we can do in that either). 

> return null, rather than throw NullpointExetion while ServletActionContext.getRequest()
> ---------------------------------------------------------------------------------------
>
>                 Key: WW-2780
>                 URL: https://issues.apache.org/struts/browse/WW-2780
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Core Actions
>    Affects Versions: 2.1.2
>            Reporter: dapeng.ni
>            Priority: Minor
>             Fix For: 2.1.4
>
>
> I use STRUTS in mixed env with other framework.  In 2.0.x ,  I create utility method to get HttpRequest.  It try to get request from ServletActionContext.getRequest(), if it return null, then get from another API.  
> But in 2.1.2,  if request is not from STRUTS,  ServletActionContext.getRequest() will throw NullpointException.. It is not good design. as I have to put try-catch even it just simply need a HttpRequest.

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


[jira] Updated: (WW-2780) return null, rather than throw NullpointExetion while ServletActionContext.getRequest()

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

James Holmes updated WW-2780:
-----------------------------

    Fix Version/s: 2.1.3

Is this something we're going to consider or should we close it as Not A Problem?

> return null, rather than throw NullpointExetion while ServletActionContext.getRequest()
> ---------------------------------------------------------------------------------------
>
>                 Key: WW-2780
>                 URL: https://issues.apache.org/struts/browse/WW-2780
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Core Actions
>    Affects Versions: 2.1.2
>            Reporter: dapeng.ni
>             Fix For: 2.1.3
>
>
> I use STRUTS in mixed env with other framework.  In 2.0.x ,  I create utility method to get HttpRequest.  It try to get request from ServletActionContext.getRequest(), if it return null, then get from another API.  
> But in 2.1.2,  if request is not from STRUTS,  ServletActionContext.getRequest() will throw NullpointException.. It is not good design. as I have to put try-catch even it just simply need a HttpRequest.

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


[jira] Updated: (WW-2780) return null, rather than throw NullpointExetion while ServletActionContext.getRequest()

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

James Holmes updated WW-2780:
-----------------------------

    Fix Version/s:     (was: 2.1.3)
                   2.1.4

> return null, rather than throw NullpointExetion while ServletActionContext.getRequest()
> ---------------------------------------------------------------------------------------
>
>                 Key: WW-2780
>                 URL: https://issues.apache.org/struts/browse/WW-2780
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Core Actions
>    Affects Versions: 2.1.2
>            Reporter: dapeng.ni
>             Fix For: 2.1.4
>
>
> I use STRUTS in mixed env with other framework.  In 2.0.x ,  I create utility method to get HttpRequest.  It try to get request from ServletActionContext.getRequest(), if it return null, then get from another API.  
> But in 2.1.2,  if request is not from STRUTS,  ServletActionContext.getRequest() will throw NullpointException.. It is not good design. as I have to put try-catch even it just simply need a HttpRequest.

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


[jira] Updated: (WW-2780) return null, rather than throw NullpointExetion while ServletActionContext.getRequest()

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

Wes Wannemacher updated WW-2780:
--------------------------------

    Fix Version/s:     (was: 2.1.4)
                   2.1.5

> return null, rather than throw NullpointExetion while ServletActionContext.getRequest()
> ---------------------------------------------------------------------------------------
>
>                 Key: WW-2780
>                 URL: https://issues.apache.org/struts/browse/WW-2780
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Core Actions
>    Affects Versions: 2.1.2
>            Reporter: dapeng.ni
>            Priority: Minor
>             Fix For: 2.1.5
>
>
> I use STRUTS in mixed env with other framework.  In 2.0.x ,  I create utility method to get HttpRequest.  It try to get request from ServletActionContext.getRequest(), if it return null, then get from another API.  
> But in 2.1.2,  if request is not from STRUTS,  ServletActionContext.getRequest() will throw NullpointException.. It is not good design. as I have to put try-catch even it just simply need a HttpRequest.

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


[jira] Resolved: (WW-2780) return null, rather than throw NullpointExetion while ServletActionContext.getRequest()

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

Musachy Barroso resolved WW-2780.
---------------------------------

    Resolution: Not A Problem

see comments

> return null, rather than throw NullpointExetion while ServletActionContext.getRequest()
> ---------------------------------------------------------------------------------------
>
>                 Key: WW-2780
>                 URL: https://issues.apache.org/struts/browse/WW-2780
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Core Actions
>    Affects Versions: 2.1.2
>            Reporter: dapeng.ni
>            Priority: Minor
>             Fix For: 2.1.7
>
>
> I use STRUTS in mixed env with other framework.  In 2.0.x ,  I create utility method to get HttpRequest.  It try to get request from ServletActionContext.getRequest(), if it return null, then get from another API.  
> But in 2.1.2,  if request is not from STRUTS,  ServletActionContext.getRequest() will throw NullpointException.. It is not good design. as I have to put try-catch even it just simply need a HttpRequest.

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