You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Marwan Oweis (JIRA)" <ji...@apache.org> on 2011/03/21 17:57:05 UTC

[jira] [Created] (WW-3595) Unable to evaluate Long property in redirectAction

Unable to evaluate Long property in redirectAction
--------------------------------------------------

                 Key: WW-3595
                 URL: https://issues.apache.org/jira/browse/WW-3595
             Project: Struts 2
          Issue Type: Bug
    Affects Versions: 2.1.6
            Reporter: Marwan Oweis


Passing a Long property as part of a redirect results in strange behavior.
A workaround is to add a String getter in the action for the Long property.




{code}
        <action name="entity/create/*" class="test.CreateEntityAction" method="{1}">
            <interceptor-ref name="methodValidationStack" />
            <result name="success" type="redirectAction">edit/start?entity.id=${entity.id}</result>
        </action>
        <action name="entity/edit/*" class="test.EditEntityAction" method="{1}">
            <interceptor-ref name="poSearchPerMethodValidationStack" />
            <result name="success" type="redirectAction">edit/start?entity.id=${entity.id}</result>
        </action>
{code}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (WW-3595) Unable to evaluate Long property in redirectAction

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

Marwan Oweis updated WW-3595:
-----------------------------

    Description: 
Passing a Long property as part of a redirect results in strange behavior.

For example, the following URL is generated:
https://trials-dev.nci.nih.gov/protected/family/curate/start.action?family.id=gov.nih.nci.coppa.po:po-web:war:3.4-SNAPSHOT

instead of something like:
https://trials-dev.nci.nih.gov/protected/family/curate/start.action?family.id=45435

struts.xml:
        <action name="family/curate/*" class="gov.nih.nci.po.web.curation.CurateFamilyAction" method="{1}">
            <interceptor-ref name="poSearchPerMethodValidationStack" />
            <result name="success">/WEB-INF/jsp/curate/family/family.jsp</result>
            <result name="input">/WEB-INF/jsp/curate/family/family.jsp</result>
            <result name="list">/protected/search/family/list.action</result>
        </action>
        <action name="family/create/*" class="gov.nih.nci.po.web.create.CreateFamilyAction" method="{1}">
            <interceptor-ref name="poSearchPerMethodValidationStack" />
            <result name="success" type="redirectAction">family/curate/start?family.id=${family.id}</result>
            <result name="input">/WEB-INF/jsp/curate/family/family.jsp</result>
        </action>

Where, Family.java:

public class Family  {
    private Long id;
    ...
}


  was:
Passing a Long property as part of a redirect results in strange behavior.
A workaround is to add a String getter in the action for the Long property.




{code}
        <action name="entity/create/*" class="test.CreateEntityAction" method="{1}">
            <interceptor-ref name="methodValidationStack" />
            <result name="success" type="redirectAction">edit/start?entity.id=${entity.id}</result>
        </action>
        <action name="entity/edit/*" class="test.EditEntityAction" method="{1}">
            <interceptor-ref name="poSearchPerMethodValidationStack" />
            <result name="success" type="redirectAction">edit/start?entity.id=${entity.id}</result>
        </action>
{code}


> Unable to evaluate Long property in redirectAction
> --------------------------------------------------
>
>                 Key: WW-3595
>                 URL: https://issues.apache.org/jira/browse/WW-3595
>             Project: Struts 2
>          Issue Type: Bug
>    Affects Versions: 2.1.6
>            Reporter: Marwan Oweis
>
> Passing a Long property as part of a redirect results in strange behavior.
> For example, the following URL is generated:
> https://trials-dev.nci.nih.gov/protected/family/curate/start.action?family.id=gov.nih.nci.coppa.po:po-web:war:3.4-SNAPSHOT
> instead of something like:
> https://trials-dev.nci.nih.gov/protected/family/curate/start.action?family.id=45435
> struts.xml:
>         <action name="family/curate/*" class="gov.nih.nci.po.web.curation.CurateFamilyAction" method="{1}">
>             <interceptor-ref name="poSearchPerMethodValidationStack" />
>             <result name="success">/WEB-INF/jsp/curate/family/family.jsp</result>
>             <result name="input">/WEB-INF/jsp/curate/family/family.jsp</result>
>             <result name="list">/protected/search/family/list.action</result>
>         </action>
>         <action name="family/create/*" class="gov.nih.nci.po.web.create.CreateFamilyAction" method="{1}">
>             <interceptor-ref name="poSearchPerMethodValidationStack" />
>             <result name="success" type="redirectAction">family/curate/start?family.id=${family.id}</result>
>             <result name="input">/WEB-INF/jsp/curate/family/family.jsp</result>
>         </action>
> Where, Family.java:
> public class Family  {
>     private Long id;
>     ...
> }

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (WW-3595) Unable to evaluate Long property in redirectAction

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

Lukasz Lenart updated WW-3595:
------------------------------

    Fix Version/s:     (was: 2.3.x)
                   2.3.6
    
> Unable to evaluate Long property in redirectAction
> --------------------------------------------------
>
>                 Key: WW-3595
>                 URL: https://issues.apache.org/jira/browse/WW-3595
>             Project: Struts 2
>          Issue Type: Bug
>    Affects Versions: 2.1.6
>            Reporter: Marwan Oweis
>             Fix For: 2.3.6
>
>
> Passing a Long property as part of a redirect results in strange behavior.
> For example, the following URL is generated:
> https://trials-dev.nci.nih.gov/protected/family/curate/start.action?family.id=gov.nih.nci.coppa.po:po-web:war:3.4-SNAPSHOT
> instead of something like:
> https://trials-dev.nci.nih.gov/protected/family/curate/start.action?family.id=45435
> struts.xml:
>         <action name="family/curate/*" class="gov.nih.nci.po.web.curation.CurateFamilyAction" method="{1}">
>             <interceptor-ref name="poSearchPerMethodValidationStack" />
>             <result name="success">/WEB-INF/jsp/curate/family/family.jsp</result>
>             <result name="input">/WEB-INF/jsp/curate/family/family.jsp</result>
>             <result name="list">/protected/search/family/list.action</result>
>         </action>
>         <action name="family/create/*" class="gov.nih.nci.po.web.create.CreateFamilyAction" method="{1}">
>             <interceptor-ref name="poSearchPerMethodValidationStack" />
>             <result name="success" type="redirectAction">family/curate/start?family.id=${family.id}</result>
>             <result name="input">/WEB-INF/jsp/curate/family/family.jsp</result>
>         </action>
> Where, Family.java:
> public class Family  {
>     private Long id;
>     ...
> }

--
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

[jira] [Commented] (WW-3595) Unable to evaluate Long property in redirectAction

Posted by "Dave Newton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WW-3595?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13009216#comment-13009216 ] 

Dave Newton commented on WW-3595:
---------------------------------

Did you try renaming the "family" property as a sanity check? I find it difficult to believe that this is general behavior since I do this and have no such issues. That it seems to be pulling in an artifact name makes me wonder, but w/o access to the value stack it's impossible to help much.

> Unable to evaluate Long property in redirectAction
> --------------------------------------------------
>
>                 Key: WW-3595
>                 URL: https://issues.apache.org/jira/browse/WW-3595
>             Project: Struts 2
>          Issue Type: Bug
>    Affects Versions: 2.1.6
>            Reporter: Marwan Oweis
>
> Passing a Long property as part of a redirect results in strange behavior.
> For example, the following URL is generated:
> https://trials-dev.nci.nih.gov/protected/family/curate/start.action?family.id=gov.nih.nci.coppa.po:po-web:war:3.4-SNAPSHOT
> instead of something like:
> https://trials-dev.nci.nih.gov/protected/family/curate/start.action?family.id=45435
> struts.xml:
>         <action name="family/curate/*" class="gov.nih.nci.po.web.curation.CurateFamilyAction" method="{1}">
>             <interceptor-ref name="poSearchPerMethodValidationStack" />
>             <result name="success">/WEB-INF/jsp/curate/family/family.jsp</result>
>             <result name="input">/WEB-INF/jsp/curate/family/family.jsp</result>
>             <result name="list">/protected/search/family/list.action</result>
>         </action>
>         <action name="family/create/*" class="gov.nih.nci.po.web.create.CreateFamilyAction" method="{1}">
>             <interceptor-ref name="poSearchPerMethodValidationStack" />
>             <result name="success" type="redirectAction">family/curate/start?family.id=${family.id}</result>
>             <result name="input">/WEB-INF/jsp/curate/family/family.jsp</result>
>         </action>
> Where, Family.java:
> public class Family  {
>     private Long id;
>     ...
> }

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (WW-3595) Unable to evaluate Long property in redirectAction

Posted by "Marwan Oweis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WW-3595?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13009209#comment-13009209 ] 

Marwan Oweis commented on WW-3595:
----------------------------------

A workaround is to add a String getter in the action for the Long property.

e.g. 

public class CreateFamilyAction { 
    ...
    public String getFamilyId() {
        if (getFamily() != null && getFamily().getId() != null) {
            return this.getFamily().getId().toString();
        }
        return "";
    }
    ....
} 

and

struts.xml:
<result name="success" type="redirectAction">family/curate/start?family.id=${familyId}</result> 

> Unable to evaluate Long property in redirectAction
> --------------------------------------------------
>
>                 Key: WW-3595
>                 URL: https://issues.apache.org/jira/browse/WW-3595
>             Project: Struts 2
>          Issue Type: Bug
>    Affects Versions: 2.1.6
>            Reporter: Marwan Oweis
>
> Passing a Long property as part of a redirect results in strange behavior.
> For example, the following URL is generated:
> https://trials-dev.nci.nih.gov/protected/family/curate/start.action?family.id=gov.nih.nci.coppa.po:po-web:war:3.4-SNAPSHOT
> instead of something like:
> https://trials-dev.nci.nih.gov/protected/family/curate/start.action?family.id=45435
> struts.xml:
>         <action name="family/curate/*" class="gov.nih.nci.po.web.curation.CurateFamilyAction" method="{1}">
>             <interceptor-ref name="poSearchPerMethodValidationStack" />
>             <result name="success">/WEB-INF/jsp/curate/family/family.jsp</result>
>             <result name="input">/WEB-INF/jsp/curate/family/family.jsp</result>
>             <result name="list">/protected/search/family/list.action</result>
>         </action>
>         <action name="family/create/*" class="gov.nih.nci.po.web.create.CreateFamilyAction" method="{1}">
>             <interceptor-ref name="poSearchPerMethodValidationStack" />
>             <result name="success" type="redirectAction">family/curate/start?family.id=${family.id}</result>
>             <result name="input">/WEB-INF/jsp/curate/family/family.jsp</result>
>         </action>
> Where, Family.java:
> public class Family  {
>     private Long id;
>     ...
> }

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (WW-3595) Unable to evaluate Long property in redirectAction

Posted by "Marwan Oweis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WW-3595?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13009327#comment-13009327 ] 

Marwan Oweis commented on WW-3595:
----------------------------------

This occurs for several other Action/Bean classes besides "family" (e.g. organization, person).
What's the best way to output the value stack? (redirecting to the url containing the artifact name results in a 404)

> Unable to evaluate Long property in redirectAction
> --------------------------------------------------
>
>                 Key: WW-3595
>                 URL: https://issues.apache.org/jira/browse/WW-3595
>             Project: Struts 2
>          Issue Type: Bug
>    Affects Versions: 2.1.6
>            Reporter: Marwan Oweis
>
> Passing a Long property as part of a redirect results in strange behavior.
> For example, the following URL is generated:
> https://trials-dev.nci.nih.gov/protected/family/curate/start.action?family.id=gov.nih.nci.coppa.po:po-web:war:3.4-SNAPSHOT
> instead of something like:
> https://trials-dev.nci.nih.gov/protected/family/curate/start.action?family.id=45435
> struts.xml:
>         <action name="family/curate/*" class="gov.nih.nci.po.web.curation.CurateFamilyAction" method="{1}">
>             <interceptor-ref name="poSearchPerMethodValidationStack" />
>             <result name="success">/WEB-INF/jsp/curate/family/family.jsp</result>
>             <result name="input">/WEB-INF/jsp/curate/family/family.jsp</result>
>             <result name="list">/protected/search/family/list.action</result>
>         </action>
>         <action name="family/create/*" class="gov.nih.nci.po.web.create.CreateFamilyAction" method="{1}">
>             <interceptor-ref name="poSearchPerMethodValidationStack" />
>             <result name="success" type="redirectAction">family/curate/start?family.id=${family.id}</result>
>             <result name="input">/WEB-INF/jsp/curate/family/family.jsp</result>
>         </action>
> Where, Family.java:
> public class Family  {
>     private Long id;
>     ...
> }

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (WW-3595) Unable to evaluate Long property in redirectAction

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

Lukasz Lenart updated WW-3595:
------------------------------

    Fix Version/s: 2.3.x
    
> Unable to evaluate Long property in redirectAction
> --------------------------------------------------
>
>                 Key: WW-3595
>                 URL: https://issues.apache.org/jira/browse/WW-3595
>             Project: Struts 2
>          Issue Type: Bug
>    Affects Versions: 2.1.6
>            Reporter: Marwan Oweis
>             Fix For: 2.3.x
>
>
> Passing a Long property as part of a redirect results in strange behavior.
> For example, the following URL is generated:
> https://trials-dev.nci.nih.gov/protected/family/curate/start.action?family.id=gov.nih.nci.coppa.po:po-web:war:3.4-SNAPSHOT
> instead of something like:
> https://trials-dev.nci.nih.gov/protected/family/curate/start.action?family.id=45435
> struts.xml:
>         <action name="family/curate/*" class="gov.nih.nci.po.web.curation.CurateFamilyAction" method="{1}">
>             <interceptor-ref name="poSearchPerMethodValidationStack" />
>             <result name="success">/WEB-INF/jsp/curate/family/family.jsp</result>
>             <result name="input">/WEB-INF/jsp/curate/family/family.jsp</result>
>             <result name="list">/protected/search/family/list.action</result>
>         </action>
>         <action name="family/create/*" class="gov.nih.nci.po.web.create.CreateFamilyAction" method="{1}">
>             <interceptor-ref name="poSearchPerMethodValidationStack" />
>             <result name="success" type="redirectAction">family/curate/start?family.id=${family.id}</result>
>             <result name="input">/WEB-INF/jsp/curate/family/family.jsp</result>
>         </action>
> Where, Family.java:
> public class Family  {
>     private Long id;
>     ...
> }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira