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 18:05:06 UTC

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

    [ 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