DOC

3096.docjava

By Jennifer Walker,2014-10-14 09:24
10 views 0
3096.docjava

    由于程序的原因,本文件未被完整保存。

    首页 ? 研究文集 ? 开发框架

    Jbuilder 7.0 开发Struts 项目

    sunxia 原创 (参与分!7967,专家分!50) 发表!2003-04-17 18:12 版本!1.0 阅读!7931

     首先,从http://jakarta.apache.org下载jakarta-struts-1.0.2.zip,解开后有两个主要目录libwebapps,里面包含有Struts.jar包,和一些标签。

    Jbuilder中建立工程newTest,新建newTest.jsp,logon.jsp.同时新建newTestForm.java,newTestAction.java

    接着为该工程引入,Struts.jar包,

    jakarta-struts-1.0.2.zip 解压后的lib 目录下的所有*.Tld文件考到工程的WEB-INF 目录下面, 修改web.xml文件!

    内容如下!

    <?xml version="1.0" encoding="UTF-8"?>

    <!DOCTYPE web-app PUBLIC "-

    //Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">

    <web-app>

     <servlet>

     <servlet-name>action</servlet-name>

     <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>

     <init-param> <param-name>application</param-name>

     <param-value>org.apache.struts.webapp.example.ApplicationResources</param-value>

     </init-param>

     <init-param>

     <param-name>config</param-name>

     <param-value>/WEB-INF/struts-config.xml</param-value>

     </init-param>

     <init-param>

     <param-name>debug</param-name>

     <param-value>2</param-value>

     </init-param>

     <init-param>

     <param-name>detail</param-name>

     <param-value>2</param-value>

     </init-param>

     <init-param>

     <param-name>validate</param-name>

     <param-value>true</param-value>

     </init-param>

     <load-on-startup>2</load-on-startup>

     </servlet>

     <servlet-mapping>

     <servlet-name>action</servlet-name>

     <url-pattern>/</url-pattern>

     </servlet-mapping>

     <taglib>

     <taglib-uri>/WEB-INF/app.tld</taglib-uri>

     <taglib-location>/WEB-INF/app.tld</taglib-location>

     </taglib>

     <taglib>

     <taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>

     <taglib-location>/WEB-INF/struts-bean.tld</taglib-location>

     </taglib>

     <taglib>

     <taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>

     <taglib-location>/WEB-INF/struts-html.tld</taglib-location>

     </taglib>

     <taglib>

     <taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>

     <taglib-location>/WEB-INF/struts-logic.tld</taglib-