2013-04-11 76 views
2

我有這樣的形式:服務器端驗證工作,但它並沒有顯示錯誤消息

<s:form 
     action="conexion" validate="true" theme="css_xhtml"> 
     <s:textfield name="username" key="profile.rut" labelposition="left" /> 
     <s:password name="password" key="profile.password" labelposition="left" /> 
     <s:submit id="boton_ingreso" align="left" cssClass="send" value="Entrar" /> 
    </s:form> 

此驗證器:

<validators> 
<field name="username"> 
    <field-validator type="requiredstring"> 
     <param name="trim">true</param> 
     <message>*</message> 
    </field-validator> 
    <field-validator type="rutValidator"> 
     <param name="trim">true</param> 
     <message>*</message> 
    </field-validator> 
</field> 
<field name="password"> 
    <field-validator type="requiredstring"> 
     <param name="trim">true</param> 
     <message>*</message> 
    </field-validator> 
</field>  
</validators> 

而且這樣的定義:

<action name="conexion" class="agenda.SecurityAction"> 
     <interceptor-ref name="profiling"> 
      <param name="profilingKey">profilingKey</param> 
     </interceptor-ref>    
     <interceptor-ref name="jsonValidationWorkflowStack"/> 
     <result name="success" type="tiles">/profile.tiles</result> 
     <result name="error" type="redirectAction"> 
      <param name="actionName">cliente</param> 
     </result> 
     <result name="input" type="redirectAction"> 
      <param name="actionName">cliente</param> 
     </result> 
    </action>     

該作品完美的客戶端。但是,當我從表單中刪除validate =「true」以便測試服務器端時,valdation occus和表單再次加載,但不會顯示錯誤消息。

關於相同的其他問題:我沒有使用JSON驗證,但正常的客戶端驗證。爲什麼當我刪除定義時它不起作用?

我想這是因爲也許jsonValidationWorkflowStack繼承自其他驗證攔截器。如果是這樣,可能很方便的定義另一個,而不是jsonValidationWorkflowStack。

回答

相關問題