Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    strange reaction of validator type="matchesField"

    I have the following in a .ds.xml and when the validator for the password filed passes (if 2 password fields do match), it returns the "<fmt:message key="account.err.confirmPassword"/>" and displayed as an error message.
    if the password fields do not match then, properly rendered string is returned.
    Strange...or is it my configuration?

    I have tried other validator types and works O.K.
    <Debug>
    === 2010-02-10 18:07:17,099 [l0-1] INFO IDACall - Performing 1 operation(s)
    === 2010-02-10 18:07:17,114 [l0-1] DEBUG ValidationContext - Adding validation errors at path '/accountSpringDMI/confirmPassword': {errorMessage=<fmt:message xmlns:fmt="urn:jsptld:/WEB-INF/lib/fmt.tld" key="account.err.confirmPassword"/>}
    === 2010-02-10 18:07:17,114 [l0-1] INFO Validation - Validation error: [
    {
    recordPath:"/accountSpringDMI",
    confirmPassword:{errorMessage:"<fmt:message xmlns:fmt=\"urn:jsptld:/WEB-INF/lib/fmt.tld\" key=\"account.err.confirmPassword\"/>"}
    }
    ]
    Code:
    <!--
    <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
    -->
    <DataSource xmlns:fmt="urn:jsptld:/WEB-INF/lib/fmt.tld"
        ID="accountSpringDMI"
        serverType="generic">
        <fields>
            <field name="id" type="text" primaryKey="true">
                <title><fmt:message key="account.id"/></title>
            </field>
            <filed name="firstName" type="text" required="true">
                <title><fmt:message key="account.firstName"/></title>
            </filed>
            <field name="lastName" type="text" required="true">
                <title><fmt:message key="account.lastName"/></title>
            </field>
            <field name="pass" required="true">
                <title><fmt:message key="account.password"/></title>
            </field>
            <field name="confirmPassword" required="true">
                <title><fmt:message key="account.confirmPassword"/></title>
                <validators>
                    <Validator type="matchesField" otherField="pass">
                        <errorMessage><fmt:message key="account.err.confirmPassword"/></errorMessage>
                    </Validator>
                </validators>
            </field>
            <field name="authority" type="text" required="true">
                <title><fmt:message key="account.authority"/></title>
                <valueMap>
                    <value ID="ROLE_OPERATOR"><fmt:message key="account.authority.operator"/></value>
                    <value ID="ROLE_SUPERVISOR"><fmt:message key="account.authority.supervisor"/></value>
                    <value ID="ROLE_ADMINISTRATOR"><fmt:message key="account.authority.administrator"/></value>
                </valueMap>
            </field>
        </fields>
        <serverObject lookupStyle="spring" bean="accountSpringDMI"/>
    </DataSource>

    #2
    With Firebug you can look at what the .jsp is returning, which is basically a JSON structure, and see whether your fmt tags are working or not.

    Comment


      #3
      Thanks for your reply.

      The fmt tag works for all the other cases except for the following entry, and works if the filed entries of the "confirmPassword" and the "pass" do not match,which is correct.

      But even if those entries do match, it still invalidates the entries and the
      "<fmt:message key="account.err.confirmPassword"/></errorMessage>" is shown in a tool tip when I hover the cursor over the red icon which gets displayed left to the password field.

      Code:
               <field name="confirmPassword" required="true">
                  <title><fmt:message key="account.confirmPassword"/></title>
                  <validators>
                      <Validator type="matchesField" otherField="pass">
                          <errorMessage><fmt:message key="account.err.confirmPassword"/></errorMessage>
                      </Validator>
                  </validators>
              </field>

      Comment


        #4
        Yes, you mentioned that before. Please see previous advice for next steps.

        Comment


          #5
          The Firebug did not show anything but here is the output from my intelliJ console when running in GWT development mode.

          Code:
          2010-02-11 03:19:31,483 DEBUG [btpool0-5] org.springframework.security.web.context.SecurityContextPersistenceFilter - SecurityContextHolder now cleared, as request processing completed - 116367 
           2010-02-11 03:19:31,640 DEBUG [btpool0-5] org.springframework.security.web.FilterChainProxy - Converted URL to lowercase, from: '/biztrack/sc/idacall'; to: '/biztrack/sc/idacall' - 116524 
           2010-02-11 03:19:31,640 DEBUG [btpool0-5] org.springframework.security.web.FilterChainProxy - Candidate is: '/biztrack/sc/idacall'; pattern is /**; matched=true - 116524 
           2010-02-11 03:19:31,640 DEBUG [btpool0-5] org.springframework.security.web.FilterChainProxy - /biztrack/sc/IDACall?isc_rpc=1&isc_v=SC_SNAPSHOT-2009-12-17&isc_xhr=1&isc_tnum=2 at position 1 of 8 in additional filter chain; firing Filter: 'jp.co.alibaba.biztrack.gwt.server.authentication.BiztrackConcurrentSessionFilter@4fe785b' - 116524 
           2010-02-11 03:19:31,640 DEBUG [btpool0-5] org.springframework.security.web.FilterChainProxy - /biztrack/sc/IDACall?isc_rpc=1&isc_v=SC_SNAPSHOT-2009-12-17&isc_xhr=1&isc_tnum=2 at position 2 of 8 in additional filter chain; firing Filter: 'org.springframework.security.web.context.SecurityContextPersistenceFilter@5e8fa0ec' - 116524 
           2010-02-11 03:19:31,640 DEBUG [btpool0-5] org.springframework.security.web.context.HttpSessionSecurityContextRepository - Obtained a valid SecurityContext from SPRING_SECURITY_CONTEXT: 'org.springframework.security.core.context.SecurityContextImpl@4497eb72: Authentication: org.springframework.security.authentication.UsernamePasswordAuthenticationToken@4497eb72: Principal: org.springframework.security.core.userdetails.User@ff43bd00: Username: test; Password: [PROTECTED]; Enabled: true; AccountNonExpired: true; credentialsNonExpired: true; AccountNonLocked: true; Granted Authorities: ROLE_USER; Password: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@ffff10d0: RemoteIpAddress: 0:0:0:0:0:0:0:1%0; SessionId: 1xqypslwbzz8f; Granted Authorities: ROLE_USER' - 116524 
           2010-02-11 03:19:31,640 DEBUG [btpool0-5] org.springframework.security.web.FilterChainProxy - /biztrack/sc/IDACall?isc_rpc=1&isc_v=SC_SNAPSHOT-2009-12-17&isc_xhr=1&isc_tnum=2 at position 3 of 8 in additional filter chain; firing Filter: 'org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter@608573e2' - 116524 
           2010-02-11 03:19:31,641 DEBUG [btpool0-5] org.springframework.security.web.FilterChainProxy - /biztrack/sc/IDACall?isc_rpc=1&isc_v=SC_SNAPSHOT-2009-12-17&isc_xhr=1&isc_tnum=2 at position 4 of 8 in additional filter chain; firing Filter: 'org.springframework.security.web.savedrequest.RequestCacheAwareFilter@597b2bef' - 116525 
           2010-02-11 03:19:31,641 DEBUG [btpool0-5] org.springframework.security.web.FilterChainProxy - /biztrack/sc/IDACall?isc_rpc=1&isc_v=SC_SNAPSHOT-2009-12-17&isc_xhr=1&isc_tnum=2 at position 5 of 8 in additional filter chain; firing Filter: 'org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@258185ce' - 116525 
           2010-02-11 03:19:31,641 DEBUG [btpool0-5] org.springframework.security.web.FilterChainProxy - /biztrack/sc/IDACall?isc_rpc=1&isc_v=SC_SNAPSHOT-2009-12-17&isc_xhr=1&isc_tnum=2 at position 6 of 8 in additional filter chain; firing Filter: 'org.springframework.security.web.session.SessionManagementFilter@115f5925' - 116525 
           2010-02-11 03:19:31,641 DEBUG [btpool0-5] org.springframework.security.web.FilterChainProxy - /biztrack/sc/IDACall?isc_rpc=1&isc_v=SC_SNAPSHOT-2009-12-17&isc_xhr=1&isc_tnum=2 at position 7 of 8 in additional filter chain; firing Filter: 'org.springframework.security.web.access.ExceptionTranslationFilter@ad5950c' - 116525 
           2010-02-11 03:19:31,641 DEBUG [btpool0-5] org.springframework.security.web.FilterChainProxy - /biztrack/sc/IDACall?isc_rpc=1&isc_v=SC_SNAPSHOT-2009-12-17&isc_xhr=1&isc_tnum=2 at position 8 of 8 in additional filter chain; firing Filter: 'org.springframework.security.web.access.intercept.FilterSecurityInterceptor@4c2c4c62' - 116525 
           2010-02-11 03:19:31,641 DEBUG [btpool0-5] org.springframework.security.web.access.intercept.DefaultFilterInvocationSecurityMetadataSource - Converted URL to lowercase, from: '/biztrack/sc/idacall'; to: '/biztrack/sc/idacall' - 116525 
           2010-02-11 03:19:31,641 DEBUG [btpool0-5] org.springframework.security.web.access.intercept.DefaultFilterInvocationSecurityMetadataSource - Candidate is: '/biztrack/sc/idacall'; pattern is /biztrack/sc/idacall*; matched=true - 116525 
           2010-02-11 03:19:31,641 DEBUG [btpool0-5] org.springframework.security.web.access.intercept.FilterSecurityInterceptor - Secure object: FilterInvocation: URL: /biztrack/sc/IDACall?isc_rpc=1&isc_v=SC_SNAPSHOT-2009-12-17&isc_xhr=1&isc_tnum=2; Attributes: [ROLE_USER] - 116525 
           2010-02-11 03:19:31,641 DEBUG [btpool0-5] org.springframework.security.web.access.intercept.FilterSecurityInterceptor - Previously Authenticated: org.springframework.security.authentication.UsernamePasswordAuthenticationToken@4497eb72: Principal: org.springframework.security.core.userdetails.User@ff43bd00: Username: test; Password: [PROTECTED]; Enabled: true; AccountNonExpired: true; credentialsNonExpired: true; AccountNonLocked: true; Granted Authorities: ROLE_USER; Password: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@ffff10d0: RemoteIpAddress: 0:0:0:0:0:0:0:1%0; SessionId: 1xqypslwbzz8f; Granted Authorities: ROLE_USER - 116525 
           2010-02-11 03:19:31,641 DEBUG [btpool0-5] org.springframework.security.access.vote.AffirmativeBased - Voter: org.springframework.security.access.vote.RoleVoter@755cce4b, returned: 1 - 116525 
           2010-02-11 03:19:31,641 DEBUG [btpool0-5] org.springframework.security.web.access.intercept.FilterSecurityInterceptor - Authorization successful - 116525 
           2010-02-11 03:19:31,641 DEBUG [btpool0-5] org.springframework.web.context.support.XmlWebApplicationContext - Publishing event in Root WebApplicationContext: org.springframework.security.access.event.AuthorizedEvent[source=FilterInvocation: URL: /biztrack/sc/IDACall?isc_rpc=1&isc_v=SC_SNAPSHOT-2009-12-17&isc_xhr=1&isc_tnum=2] - 116525 
           2010-02-11 03:19:31,641 DEBUG [btpool0-5] org.springframework.security.web.access.intercept.FilterSecurityInterceptor - RunAsManager did not change Authentication object - 116525 
           2010-02-11 03:19:31,641 DEBUG [btpool0-5] org.springframework.security.web.FilterChainProxy - /biztrack/sc/IDACall?isc_rpc=1&isc_v=SC_SNAPSHOT-2009-12-17&isc_xhr=1&isc_tnum=2 reached end of additional filter chain; proceeding with original chain - 116525 
           === 2010-02-11 03:19:31,641 [l0-5] INFO  RequestContext - URL: '/biztrack/sc/IDACall', User-Agent: 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; ja-JP-mac; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7': Moz (Gecko) with Accept-Encoding header
          === 2010-02-11 03:19:31,646 [l0-5] DEBUG XML - Parsed XML from (in memory stream): 4ms
          === 2010-02-11 03:19:31,654 [l0-5] DEBUG RPCManager - Processing 1 requests.
          === 2010-02-11 03:19:31,654 [l0-5] DEBUG RPCManager - Request #1 (DSRequest) payload: {
              values:{id:"hanishi", firstName:"Haruhiko", lastName:"Nishi", password:"h@n1shi", passwordConfirm:"h@n1shi",
               authority:"ROLE_ADMINISTRATOR"},
              operationConfig:{dataSource:"accountSpringDMI", operationType:"add"},
              componentId:"isc_OID_50",
              appID:"builtinApplication",
              operation:"accountSpringDMI_add",
              oldValues:{},
              criteria:{}
          }
          === 2010-02-11 03:19:31,654 [l0-5] INFO  IDACall - Performing 1 operation(s)
          === 2010-02-11 03:19:31,657 [l0-5] DEBUG ValidationContext - Adding validation errors at path '/accountSpringDMI/passwordConfirm': {errorMessage=<fmt:message xmlns:fmt="urn:jsptld:/WEB-INF/lib/fmt.tld" key="account.err.confirmPassword"/>}
          === 2010-02-11 03:19:31,673 [l0-5] INFO  Validation - Validation error: [
              {
                  recordPath:"/accountSpringDMI",
                  passwordConfirm:{errorMessage:"<fmt:message xmlns:fmt=\"urn:jsptld:/WEB-INF/lib/fmt.tld\" key=\"account.err.confirmPassword\"/>"}
              }
          ]
          === 2010-02-11 03:19:31,674 [l0-5] DEBUG RPCManager - Content type for RPC transaction: text/plain; charset=UTF-8
          === 2010-02-11 03:19:31,675 [l0-5] DEBUG RPCManager - non-DMI response, dropExtraFields: false
          2010-02-11 03:19:31,676 DEBUG [btpool0-5] org.springframework.security.web.access.ExceptionTranslationFilter - Chain processed normally - 116560 
           2010-02-11 03:19:31,676 DEBUG [btpool0-5] org.springframework.security.web.context.SecurityContextPersistenceFilter - SecurityContextHolder now cleared, as request processing completed - 116560 
           2010-02-11 03:19:31,783 DEBUG [btpool0-5] org.springframework.security.web.FilterChainProxy - Converted URL to lowercase, from: '/biztrack/sc/skins/enterprise/images/actions/exclamation.png'; to: '/biztrack/sc/skins/enterprise/images/actions/exclamation.png' - 116667 
           2010-02-11 03:19:31,783 DEBUG [btpool0-5] org.springframework.security.web.FilterChainProxy - Candidate is: '/biztrack/sc/skins/enterprise/images/actions/exclamation.png'; pattern is /**; matched=true - 116667 
           2010-02-11 03:19:31,783 DEBUG [btpool0-5] org.springframework.security.web.FilterChainProxy - /biztrack/sc/skins/Enterprise/images/actions/exclamation.png at position 1 of 8 in additional filter chain; firing Filter: 'jp.co.alibaba.biztrack.gwt.server.authentication.BiztrackConcurrentSessionFilter@4fe785b' - 116667 
           2010-02-11 03:19:31,783 DEBUG [btpool0-5] org.springframework.security.web.FilterChainProxy - /biztrack/sc/skins/Enterprise/images/actions/exclamation.png at position 2 of 8 in additional filter chain; firing Filter: 'org.springframework.security.web.context.SecurityContextPersistenceFilter@5e8fa0ec' - 116667 
           2010-02-11 03:19:31,784 DEBUG [btpool0-5] org.springframework.security.web.context.HttpSessionSecurityContextRepository - Obtained a valid SecurityContext from SPRING_SECURITY_CONTEXT: 'org.springframework.security.core.context.SecurityContextImpl@4497eb72: Authentication: org.springframework.security.authentication.UsernamePasswordAuthenticationToken@4497eb72: Principal: org.springframework.security.core.userdetails.User@ff43bd00: Username: test; Password: [PROTECTED]; Enabled: true; AccountNonExpired: true; credentialsNonExpired: true; AccountNonLocked: true; Granted Authorities: ROLE_USER; Password: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@ffff10d0: RemoteIpAddress: 0:0:0:0:0:0:0:1%0; SessionId: 1xqypslwbzz8f; Granted Authorities: ROLE_USER' - 116668 
           2010-02-11 03:19:31,784 DEBUG [btpool0-5] org.springframework.security.web.FilterChainProxy - /biztrack/sc/skins/Enterprise/images/actions/exclamation.png at position 3 of 8 in additional filter chain; firing Filter: 'org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter@608573e2' - 116668 
           2010-02-11 03:19:31,784 DEBUG [btpool0-5] org.springframework.security.web.FilterChainProxy - /biztrack/sc/skins/Enterprise/images/actions/exclamation.png at position 4 of 8 in additional filter chain; firing Filter: 'org.springframework.security.web.savedrequest.RequestCacheAwareFilter@597b2bef' - 116668 
           2010-02-11 03:19:31,784 DEBUG [btpool0-5] org.springframework.security.web.FilterChainProxy - /biztrack/sc/skins/Enterprise/images/actions/exclamation.png at position 5 of 8 in additional filter chain; firing Filter: 'org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@258185ce' - 116668 
           2010-02-11 03:19:31,784 DEBUG [btpool0-5] org.springframework.security.web.FilterChainProxy - /biztrack/sc/skins/Enterprise/images/actions/exclamation.png at position 6 of 8 in additional filter chain; firing Filter: 'org.springframework.security.web.session.SessionManagementFilter@115f5925' - 116668 
           2010-02-11 03:19:31,784 DEBUG [btpool0-5] org.springframework.security.web.FilterChainProxy - /biztrack/sc/skins/Enterprise/images/actions/exclamation.png at position 7 of 8 in additional filter chain; firing Filter: 'org.springframework.security.web.access.ExceptionTranslationFilter@ad5950c' - 116668 
           2010-02-11 03:19:31,784 DEBUG [btpool0-5] org.springframework.security.web.FilterChainProxy - /biztrack/sc/skins/Enterprise/images/actions/exclamation.png at position 8 of 8 in additional filter chain; firing Filter: 'org.springframework.security.web.access.intercept.FilterSecurityInterceptor@4c2c4c62' - 116668 
           2010-02-11 03:19:31,784 DEBUG [btpool0-5] org.springframework.security.web.access.intercept.DefaultFilterInvocationSecurityMetadataSource - Converted URL to lowercase, from: '/biztrack/sc/skins/enterprise/images/actions/exclamation.png'; to: '/biztrack/sc/skins/enterprise/images/actions/exclamation.png' - 116668 
           2010-02-11 03:19:31,784 DEBUG [btpool0-5] org.springframework.security.web.access.intercept.DefaultFilterInvocationSecurityMetadataSource - Candidate is: '/biztrack/sc/skins/enterprise/images/actions/exclamation.png'; pattern is /biztrack/sc/idacall*; matched=false - 116668 
           2010-02-11 03:19:31,784 DEBUG [btpool0-5] org.springframework.security.web.access.intercept.FilterSecurityInterceptor - Public object - authentication not attempted - 116668 
           2010-02-11 03:19:31,784 DEBUG [btpool0-5] org.springframework.web.context.support.XmlWebApplicationContext - Publishing event in Root WebApplicationContext: org.springframework.security.access.event.PublicInvocationEvent[source=FilterInvocation: URL: /biztrack/sc/skins/Enterprise/images/actions/exclamation.png] - 116668 
           2010-02-11 03:19:31,784 DEBUG [btpool0-5] org.springframework.security.web.FilterChainProxy - /biztrack/sc/skins/Enterprise/images/actions/exclamation.png reached end of additional filter chain; proceeding with original chain - 116668 
           === 2010-02-11 03:19:31,784 [l0-5] INFO  RequestContext - URL: '/biztrack/sc/skins/Enterprise/images/actions/exclamation.png', User-Agent: 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; ja-JP-mac; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7': Moz (Gecko) with Accept-Encoding header
          === 2010-02-11 03:19:31,785 [l0-5] INFO  Download - done streaming: /Users/hanishi/Library/Caches/IntelliJIdea90/gwt/biztrack.biztrackb4e5f631/biztrack.e6b8f010/run/www/biztrack/sc/skins/Enterprise/images/actions/exclamation.png
          2010-02-11 03:19:31,785 DEBUG [btpool0-5] org.springframework.security.web.access.ExceptionTranslationFilter - Chain processed normally - 116669 
           2010-02-11 03:19:31,785 DEBUG [btpool0-5] org.springframework.security.web.context.SecurityContextPersistenceFilter - SecurityContextHolder now cleared, as request processing completed - 116669
          
          [DataSource]
          
          <!--
          <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
          -->
          
          <DataSource xmlns:fmt="urn:jsptld:/WEB-INF/lib/fmt.tld"
              ID="accountSpringDMI"
              serverType="generic">
              <fields>
                  <field name="id" type="text" primaryKey="true" required="true">
                      <title><fmt:message key="account.id"/></title>
                  </field>
                  <filed name="firstName" type="text" canEdit="true" required="true">
                      <title><fmt:message key="account.firstName"/></title>
                  </filed>
                  <field name="lastName" type="text" canEdit="true" required="true">
                      <title><fmt:message key="account.lastName"/></title>
                  </field>
                  <field name="password" type="text" canEdit="true" required="true">
                      <title><fmt:message key="account.password"/></title>
                  </field>
                  <field name="passwordConfirm" type="text" required="true">
                      <title><fmt:message key="account.confirmPassword"/></title>
                      <validators>
                          <Validator type="matchesField" otherField="password">
                              <errorMessage><fmt:message key="account.err.confirmPassword"/></errorMessage>
                          </Validator>
                      </validators>
                  </field>
                  <field name="authority" type="enum" canEdit="true" required="true">
                      <title><fmt:message key="account.authority"/></title>
                      <valueMap>
                          <value ID="ROLE_OPERATOR"><fmt:message key="account.authority.operator"/></value>
                          <value ID="ROLE_SUPERVISOR"><fmt:message key="account.authority.supervisor"/></value>
                          <value ID="ROLE_ADMINISTRATOR"><fmt:message key="account.authority.administrator"/></value>
                      </valueMap>
                  </field>
              </fields>
              <serverObject lookupStyle="spring" bean="accountSpringDMI"/>
          </DataSource> 
          
          and the web.xml has the entry below
          -------------------------------------------
          
              <jsp-config>
                  <!-- Isomorphic JSP tags -->
                  <taglib>
                      <taglib-uri>isomorphic</taglib-uri> 
                      <taglib-location>/WEB-INF/iscTaglib.xml</taglib-location> 
                  </taglib>
                  <jsp-property-group>
                      <url-pattern>/ds/*</url-pattern>
                  </jsp-property-group>
              </jsp-config>
          </web-app>

          Comment


            #6
            One last time: use Firebug to see what your .jsp is returning (the Net panel).

            The only source of that "fmt" string is the .jsp. So you need to look at what the .jsp is outputting and correct the problem there.

            Comment


              #7
              The following is what I get in the Firebug console and it is returned by
              http://localhost:8888/biztrack/sc/IDACall?isc_rpc=1&isc_v=SC_SNAPSHOT-2009-12-17&isc_xhr=1&isc_tnum=12

              and the fmt tag works just fine for the other validators declarations
              I also have disabled the use of the fmt tag in for the errorMessage and it is giving me the similar result.(errorMessage:"ERROR")
              The validator seems to be working as a client side script, but once entries are posted to the server side it returns the error response.

              Code:
              //isc_RPCResponseStart-->[
                  {
                      errors:[
                          {
                              recordPath:"/accountSpringDMI",
                              passwordConfirm:{errorMessage:"<fmt:message xmlns:fmt=\"urn:jsptld:/WEB-INF/lib/fmt.tld\" key=\"account.err.confirmPassword\"/>"}
                          }
                      ],
                      isDSResponse:true,
                      invalidateCache:false,
                      status:-4,
                      data:null
                  }
              ]//isc_RPCResponseEnd

              Comment


                #8
                That's expected. If someone is bypassing your client-side checks, they are trying to hack the system and it doesn't matter what error message they receive so long as the rule is enforced.

                Comment


                  #9
                  All I wanted know is the definitive way to internationalize DataSource definitions declared in XML .ds.xml

                  I've follwed the directions given in the SmartClient reference,but still not clear how this is working behind the scenes.

                  Does anybody have tried it?

                  Comment


                    #10
                    One again - you have already succeeded.

                    For the built-in validators, you are successfully delivering i18n messages to the client.

                    Users who are not trying to hack the system will never see the non-i18n server versions of these messages.

                    For custom validators, as the docs say, provide i18n Strings to the APIs on DSResponse for reporting errors.

                    Comment


                      #11
                      It is expected result? so I just ignore the response from the server side?
                      But if the DataSource is bound to the DynamicForm doesn't the response gets reflected to the form that was submitted? Or do I need to disable displaying the DynamicForm immediately after the post is completed, so I don't get this result?

                      Comment


                        #12
                        One last attempt to explain..

                        The Validator declarations in the DataSource are enforced both client and server side. If you simply call validate() on your form before saving data, if there are errors, the users will see correct i18n error messages.

                        If a request were ever submitted to the server that contained errors that should have been caught by client-side enforcement of validators, then you know that the request was sent by someone intentionally trying to circumvent your client-side securiy checks. It doesn't matter what error message this person receives, only that the rule is enforced.

                        Comment


                          #13
                          I'm still kind of confused about the behavior of the "matchesField" type that is different from other validation types I've tried and all worked fine.
                          matchesField validation type properly gets handled only at the client side.( if in is declaration, "clientOnly" is set to true, no problems generated. If this property is not set to true, the server replies with the response I've been posting.)

                          I understand what your are saying. It only needs to happen client side.
                          Is this a result of the something I've found in the smartclient's reference manual? that says,

                          "Normally, if the server is trying to run validators and finds a validator that it can't execute, for safety reasons validation is considered to have failed. Use this flag to explicitly mark a validator that only needs to run on the client."

                          for some reason this is what seems to be happening for the matchesField validation type.

                          After all I've figured that retuning JSP pages are not appropriate way to i18n the GWT apps and it is also mentioned in the SmartClient reference.

                          "Alternatively, XML DataSources can be loaded by targetting a special servlet provided by the SmartClient Server. This servlet yields exactly the same Javascript as the equivalent <isomorphic:loadDS/>, so the two methods are interchangeable. The servlet-based method is ideal in environments where JSP tags cannot be used (SmartGWT is one such environment). "

                          There are other elements that needs to be i18nized besides DataSource bounded components, such as button's and HeaderSpan for ListGrids, so GWT way of i18n may be right way to deal with.
                          I wonder how other people are dealing with i18n smartGWT.

                          Comment


                            #14
                            By the way, I'm using smartgwtpro-2.0.jar

                            Comment


                              #15
                              For i18n for strings built into the framework, you use the language packs delivered as GWT modules.

                              For i18n strings in your application code, use the well-documented GWT approaches.

                              For .ds.xml files, use the approach you are using (which is already working).

                              The mention about .jsp not being available refers specifically to the host .html file being .html by default rather than .jsp. You can use .jsp with SmartGWT in general, and in this particular case (i18n for .ds.xml files) it's the recommended approach.
                              Last edited by Isomorphic; 11 Feb 2010, 04:31.

                              Comment

                              Working...
                              X