`
itlangzicn
  • 浏览: 38402 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

浅析struts-config.xml文件

阅读更多

<?xml version="1.0" encoding="ISO-8859-1" ?>

<!DOCTYPE struts-config PUBLIC
          "-//Apache Software Foundation//DTD Struts Configuration 1.3//EN"
          "http://struts.apache.org/dtds/struts-config_1_3.dtd">
<struts-config>

 <form-beans>
  <form-bean name="regForm"
   type="cn.itcast.web.struts.forms.RegForm"/>
 </form-beans>

//有<form-beans>节点就有FormBeanConfig类与之对应,在这个类中有相应的方法和属性
//例如:有,属性:name,type等。方法:getName(),setName(),getType(),setType()等方法
 
 <action-mappings>
 
  <action path="/reg"
   type="cn.itcast.web.struts.actions.RegAction"
   name="regForm"
   input="/user-reg.jsp">
   <forward name="success" path="/reg-success.jsp"/>
  </action>
 
 </action-mappings>
// 有<action-mappings>节点就有相应的ActionConfig类与之对应,在这个类中有相应的方法和属
// 性,例如:属性:path,type,方法:getPath(),setPath,getInput() 等等

 <message-resources parameter="MessageResources"></message-resources>

// 有<message-resources>节点就有MessageResourcesConfig类与之对应,在这个类中有相应的// 方法和属性。例如:setParameter(),getParameter()等等
</struts-config>

 

 

注:对于配置文件,框架都会有相应的类与之对应,使配置文件中的属性值都变成了各个类中的属性值,执行时通过get方法得到。

0
0
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics