struts-config.xml具体含义

来源:百度知道 编辑:UC知道 时间:2024/05/01 11:37:45
详细解释下这些语句的具体含义吧!
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config_1_2.dtd">

<struts-config>
<data-sources />
<form-beans >
<form-bean name="loginForm" type="com.yourcompany.struts.form.LoginForm" />

</form-beans>

<global-exceptions />
<global-forwards />
<action-mappings >
<action
attribute="loginForm"
input="/form/login.jsp"
name="loginForm"
path="/login"
scope="request"
type="com.yourcompany.struts.action.LoginAction&qu

用struts+参数去搜索引擎搜索!

<form-beans >
<form-bean name="loginForm" type="com.yourcompany.struts.form.LoginForm" />

</form-beans>
是你表单提交以后传到ACTION里的值 也就是说如果你表单提交时的值必须得跟formBean的值一一对应
<global-forwards />
是全局的跳转
<action
attribute="loginForm"
input="/form/login.jsp"
name="loginForm"
path="/login"
scope="request"
type="com.yourcompany.struts.action.LoginAction" />
attribute是你的ACTION对应的值对象
input是你表单提交过来的页面
name跟attribute差不多
path是你的ACTION的名字 在form标签上的action参数上要写path
type是你的ACTION所在的CLASS

基本上 只要了解<global-forwards> 标签
<form-beans > 标签还有
<action >标签就可以了