struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Johannes Geppert (Resolved) (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (WW-3736) Client Validation is broken for Struts2 themes
Date Fri, 03 Feb 2012 19:55:53 GMT

     [ https://issues.apache.org/jira/browse/WW-3736?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Johannes Geppert resolved WW-3736.
----------------------------------

    Resolution: Fixed

I've added an additional check if data is an javascript object. Which should be true, because
since version 2.3.1 Struts returned an valid JSON Object. 

Else the result is handled like before. So we should also be backward compatible.

{code}
StrutsUtils.getValidationErrors = function(data) {
    if (typeof data === "object") {
        return data;
    }
    else {
        if (data.indexOf("/* {") === 0) {
            return eval("( " + data.substring(2, data.length - 2) + " )");
        } else {
            return null;
        }
    }
};
{code}
                
> Client Validation is broken for Struts2 themes
> ----------------------------------------------
>
>                 Key: WW-3736
>                 URL: https://issues.apache.org/jira/browse/WW-3736
>             Project: Struts 2
>          Issue Type: Bug
>          Components: XML Validators
>    Affects Versions: 2.3.1, 2.3.1.1
>            Reporter: Johannes Geppert
>            Assignee: Johannes Geppert
>            Priority: Critical
>              Labels: client, json, validation
>             Fix For: 2.3.2
>
>
> Since Version 2.3.1 the Client Validation for Struts2 Themes is broken.
> Because the StrutsUtils.getValidationErrors Methos in utils.js expected an commented
JSON String.
> StrutsUtils.getValidationErrors = function(data) {
>   if(data.indexOf("/* {") === 0) {
>     return eval("( " + data.substring(2, data.length - 2) + " )");
>   } else {
>     return null;
>   }  
> };

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

        

Mime
View raw message