首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

struts1.x学习札记(3)

2012-09-08 
struts1.x学习笔记(3)1)在struts发布的webapp中,自带很多struts自带的war包,这些应用包都是学习struts比较

struts1.x学习笔记(3)

1)在struts发布的webapp中,自带很多struts自带的war包,这些应用包都是学习struts比较的例子,尤其是struts-blank.war(struts最精简最干净的空白应用环境)、struts-documentation.war(struts的开发文档)、struts-mailreader.war(struts的很多应用示例)。

?

2)在struts中有个非常实用的功能,防止表单重复提交,当然还有些比较常用的struts标签,如<html:multibox>及<html:optionCollection>等等。

?

3)ActionForm与DynaActionForm两种表单的区别及使用。

?

4)在struts1.2中有许多实用的Action类,比如:Action、DispatchAction、ForwardAction、DownloadAction、LocaleAction等等实用的Action类。

?

5)在servlet中应该使用this.getServlet().getServletContext().getRealPath("/");而不应该使用request.getRealPath("/")该方法也过时。

?

6)如下,Filter的配置如下,红色标注的说明可以配置其它的servlet,这样的话表示只对哪些servlet生效。

<filter>
? ??<filter-name>encode</filter-name>
? ??<filter-class>com.wuhaiming.web.init.EncodeFilter</filter-class>
? ?</filter>
<filter-mapping>
? ??<filter-name>encode</filter-name>
? ??<servlet-name>action</servlet-name>
</filter-mapping>
<servlet>
???? <servlet-name>action</servlet-name>
???? <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
???? <init-param>

???? 。。。。

?

7)要熟练使用struts文件上传组件。

热点排行