Webxサーバ側認証



Webx 3はサーバ側認証をサポートしており、クライアント認証はまだサポートされていません.サーバ側検証構成はform.xmlでは、大体次のように構成されています.

  
  
  
  
  1. <?xml version="1.0" encoding="UTF-8"?> 
  2. <beans:beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  3.     xmlns:services="http://www.alibaba.com/schema/services" 
  4.     xmlns:fm-conditions="http://www.alibaba.com/schema/services/form/conditions" 
  5.     xmlns:fm-validators="http://www.alibaba.com/schema/services/form/validators" 
  6.     xmlns="http://www.alibaba.com/schema/services/form/validators" 
  7.     xmlns:beans="http://www.springframework.org/schema/beans" 
  8.     xmlns:p="http://www.springframework.org/schema/p" 
  9.     xsi:schemaLocation=" 
  10.         http://www.alibaba.com/schema/services http://localhost:8080/schema/services.xsd 
  11.         http://www.alibaba.com/schema/services/form/conditions http://localhost:8080/schema/services-form-conditions.xsd 
  12.         http://www.alibaba.com/schema/services/form/validators http://localhost:8080/schema/services-form-validators.xsd 
  13.         http://www.springframework.org/schema/beans http://localhost:8080/schema/www.springframework.org/schema/beans/spring-beans.xsd 
  14.     "> 
  15.  
  16.     <services:form postOnlyByDefault="true"> 
  17.         <!-- 
  18.           - =============================================== 
  19.           -  csrf token。 
  20.           - =============================================== 
  21.          --> 
  22.         <services:group name="csrfCheck"> 
  23.             <services:field name="csrfToken"> 
  24.                 <csrf-validator> 
  25.                     <message> </message> 
  26.                 </csrf-validator> 
  27.             </services:field> 
  28.         </services:group> 
  29.         <!-- 
  30.           - =============================================== 
  31.           - Simple form 
  32.           - =============================================== 
  33.          --> 
  34.         <services:group name="simple" extends="csrfCheck"> 
  35.             <services:field name="name" displayName=" "> 
  36.                 <required-validator> 
  37.                     <message>  ${displayName}</message> 
  38.                 </required-validator> 
  39.             </services:field> 
  40.         </services:group> 
  41.     </services:form> 
  42.  
  43. </beans:beans> 

Webx 2では次のようになります.

  
  
  
  
  1. <?xml version="1.0" encoding="GB18030"?> 
  2. <form> 
  3.     <group name="register"> 
  4.         <field name="id" displayName=" ID"> 
  5.             <required-validator> 
  6.                 <message> ${displayName}</message> 
  7.             </required-validator> 
  8.             <regexp-validator pattern="^[A-Za-z_][A-Za-z_0-9]*$"> 
  9.                 <message>${displayName} 、 、 </message> 
  10.             </regexp-validator> 
  11.             <length-validator minLength="4" maxLength="10"> 
  12.                 <message>${displayName} ${minLength} , ${maxLength} </message> 
  13.             </length-validator> 
  14.         </field> 
  15.     </group> 
  16. </form>