用struts wml标记来实现wap开发--tiles篇

先定义tiles:

        "-//Apache Software Foundation//DTD Tiles Configuration//EN"
       "http://jakarta.apache.org/struts/dtds/tiles-config.dtd">


   
   
       
       
  
  
  
       
       
   

 



layout.jsp:

<%@ page contentType="text/vnd.wap.wml; charset=UTF-8" %>
<%@ include file="/WEB-INF/pages/common/taglibs.jsp"%>

 
  


   
   
    
     
    
   

      


     

   
    
     
    
   

      


     

   
    
     
     
     
    
   

      
     

      
     

      
     

   
    
     
    
   

      
     

  

 


taglibs.jsp:
<%@ taglib uri="/WEB-INF/app.tld"    prefix="app" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-wml.tld" prefix="wml" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-tiles.tld"      prefix="tiles" %>

struts-config.xml

          "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
          "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">



 

 
 

   


                        type="org.apache.struts.validator.DynaValidatorForm">
     
     
   


   
                        type="org.apache.struts.webapp.example.RegistrationForm"/>

   
                        type="org.apache.struts.webapp.example.SubscriptionForm"/>

 


 
 
   
   
   
   
 


 
 

   
                   type="org.apache.struts.webapp.example.EditRegistrationAction"
          attribute="registrationForm"
              scope="request"
           validate="false">
     
   

   
                   type="org.apache.struts.webapp.example.EditSubscriptionAction"
          attribute="subscriptionForm"
              scope="request"
           validate="false">
     
     
   

   
                   type="org.apache.struts.webapp.example.LogoffAction">
      =".mainLayout"/>
   

   
                   type="org.apache.struts.webapp.example.LogonAction"
               name="logonForm"
              scope="session"
              input="logon">
                      key="expired.password"
               type="org.apache.struts.webapp.example.ExpiredPasswordException"
               path="/changePassword.jsp"/>
   

   
                   type="org.apache.struts.webapp.example.SaveRegistrationAction"
               name="registrationForm"
              scope="request"
              input="registration"/>

   
                   type="org.apache.struts.webapp.example.SaveSubscriptionAction"
               name="subscriptionForm"
              scope="request"
              input="subscription">
     
     
   


   
                forward="/tour.wml">
   
 

 


 

 
   
   
 


 

      parameter="org.apache.struts.webapp.example.ApplicationResources"/>


 

 
   
 

 
       
   

 
                         value="/WEB-INF/validator-rules.xml,
                            /WEB-INF/validation.xml"/>
 





你可能感兴趣的:(开发语言)