Posted on 2005-05-18 17:07
JavaXP 阅读(1263)
评论(0) 编辑 收藏 所属分类:
原创教程
处子教程,多多支持!
1. 在Eclipes下正确建立一个Lomboz Project 并正确配置文件。
2. 在Tomcat下正确配置 Project
3. 将Struts下\lib 的所有.jar(10个)文件复制到\web\WEB-INF\lib下在导入!(一个一个选,不过可以一起导入)。
4. 将Struts下\lib下struts-bean.tld,struts-html.tld,struts-logic.tld,struts-nested.tld,struts-template.tld,struts-tiles.tld(6个文件)复制到\web\WEB-INF下。
5. 修改web.xml文件,添加:
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>WEB-INF/struts-config.xml</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servler-name>action</servlet-name>
<url-pattern>.do</url-pattern>
</servlet-mapping>
6.在\web\WEB-INF下建立struts-config.xml文件。
7.写入内容:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
<struts-config>
<!-- ========== Data Source Configuration =============================== -->
<data-sources />
<!-- ========== Form Bean Definitions ================================== -->
<form-beans />
<!-- ========== Global Exception Definitions ============================== -->
<global-exceptions />
<!-- ========== Global Forward Definitions =============================== -->
<global-forwards />
<!-- ========== Action Mapping Definitions =============================== -->
<action-mappings />
<!-- ========== Controller Configuration ================================ -->
<controller />
<!-- ========== Message Resources Definitions ============================ -->
<!-- ========== Plug Ins Configuration ================================= -->
<message-resources parameter="com.lee.struts.ApplicationResources" />
</struts-config>
Struts配置完毕!
(不能有任何错误!)