创建Web应用和Struts框架的配置文件

2016-02-19 14:13 3 1 收藏

图老师小编精心整理的创建Web应用和Struts框架的配置文件希望大家喜欢,觉得好的亲们记得收藏起来哦!您的支持就是小编更新的动力~

【 tulaoshi.com - 编程语言 】

  创建Web应用的配置文件

  对于Struts应用,它的配置文件web.XML应该对ActionServlet类进行配置,此外,还应该声明Web应用所使用的Struts标签库,本例中声明使用了三个标签库: Struts Bean、Struts Html和Struts Logic标签库。例程1为web.xml的源代码。

(本文来源于图老师网站,更多请访问https://www.tulaoshi.com/bianchengyuyan/)例程1 web.xml
  
  ?xml version="1.0" encoding="UTF-8"?
  
  !DOCTYPE web-app
  
  PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
  
  "http://Java.sun.com/j2ee/dtds/web-app_2_2.dtd"
  
  web-app
  
  display-nameHelloApp Struts Application/display-name
  
  !-- Standard Action Servlet Configuration --
  
  servlet
  
  servlet-nameaction/servlet-name
  
  servlet-classorg.apache.struts.action.ActionServlet/servlet-class
  
  init-param
  
  param-nameconfig/param-name
  
  param-value/WEB-INF/struts-config.xml/param-value
  
  /init-param
  
  load-on-startup2/load-on-startup
  
  /servlet
  
  !-- Standard Action Servlet Mapping --
  
  servlet-mapping
  
  servlet-nameaction/servlet-name
  
  url-pattern*.do/url-pattern
  
  /servlet-mapping
  
  !-- The Usual Welcome File List --
  
  welcome-file-list
  
  welcome-filehello.jsp/welcome-file
  
  /welcome-file-list
  
  !-- Struts Tag Library Descriptors --
  
  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-location
  
  /taglib
  
  /web-app

  创建Struts框架的配置文件

(本文来源于图老师网站,更多请访问https://www.tulaoshi.com/bianchengyuyan/)

  正如前面提及的,Struts框架答应把应用划分成多个组件,提高开发速度。而Struts框架的配置文件struts-config.xml可以把这些组件组装起来,决定如何使用它们。例程2是helloapp应用的struts-config.xml文件的源代码。

例程2  struts-config.xml?xml version="1.0" encoding="ISO-8859-1" ?!DOCTYPE struts-config PUBLIC"-//Apache Software Foundation//DTD Struts Configuration 1.1//EN""http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd"!--This is the Struts configuration file 
  
  for the "Hello!" sample application--struts-config!-- ======== Form Bean Definitions ==================== --form-beansform-bean name="HelloForm" type="hello.HelloForm"//form-beans!-- ========== Action Mapping Definitions =================== -- action-mappings!-- Say Hello! --actionpath = "/HelloWorld" type = "hello.HelloAction" name = "HelloForm" scope = "request" validate = "true" input = "/hello.jsp" forward name="SayHello" path="/hello.jsp" //action /action-mappings !-- ========== Message Resources Definitions ================ -- message-resources parameter="hello.application"//struts-config

  

来源:https://www.tulaoshi.com/n/20160219/1606477.html

延伸阅读
标签: windows 操作系统
说起硬件配置文件,有很多朋友都忽略了它在Windows XP中所起的作用,其实如果利用得当的话,可以大大提高系统的工作效率。 什么是硬件配置文件 所谓硬件配置文件,是指在启动计算机时告诉Windows应该启动哪些设备,以及使用每个设备中的哪些设置的一系列指令。当用户第一次安装Windows时,系统会自动创建一个名为“Profile 1...
 1、 Struts 优点:业界“标准”(很多成功案例),学习资源丰富,Html标签非常优秀缺点:ActionForms使用不便、无法进行单元测试(StrutsTestCase只能用于集成) 2、 Spring MVC 优点:Lifecyle for overriding binding, validation, etc.;易于同其它View框架(Titles等)无缝集成,采用IOC便于测试缺点:使用人数少...
标签: PHP
今天,我们来侃侃PHP.INI文件中的一些有趣的内容吧。 PHP.INI文件相信每位PHP爱好者都不会陌生,在PHP的上一个版本PHP3.0中它被命名为PHP3.INI。用NOTEPAD打开它,文件通常在操作系统的Windows目录下。大家都看到,PHP.INI文件里面有很多分号“”,和Windows系统一样,这些分号用来表示注解,也就是说为了配置文件清晰易懂,开发者在分号...
标签: 服务器
Nginx 配置文件解析 cycle = ngx_init_cycle(&init_cycle): 1、在内存池中分配一个ngx_cycle_t变量,并初始化它的各个成员。 2、调用core类型的create_conf,实际只有一个ngx_core_module_create_conf函数----初始化ngx_core_conf_t结构(存放core_module支持的指令),保存在ngx_cycle-conf_ctx数组中。可以说,此时,ngx_c...
[SETUP]CpuVendor=SamsungCpuChip=S3C4510CpuEndian=LITTLEFlashVendor=SiliconStorageTechnologyFlashChip=SST39LF/VF160RamAddress=0x00400000FlashAddress=0x00000000FlashWidth=16FlashChipsPerSector=1LittleEndian=1Sim1=SYSCFG:$E7FFFF90       \Sim2=EXTDBWTH:003002   \Sim3=ROMCON0:000060&...

经验教程

414

收藏

44
微博分享 QQ分享 QQ空间 手机页面 收藏网站 回到头部