Struts
共 31 篇文章
详解struts2中struts.properties
Struts 2框架有两个核心配置文件: struts.xml和struts.properties 其中struts.xml文件主要负责管理应用中的Action映射,以及该Action包含的Result定义等。除此之外,Struts 2框架还包含一个struts.properties文件,该文件定义了Struts 2框架的大量属性,开发者可以通过改变这些属性来满足应用的需求。 struts.properties文件是一个标准的Properties文件,该文件包含了系列的key-value对象,每个key就是一个Struts 2属性,该key对应的value就是一个Struts 2属性值。 s…
2007-10-25 00:17 · Struts · 应用服务器 · velocity · Struts · freemarker · 框架
struts2的struts.properties配置文件详解
struts.action.extension The URL extension to use to determine if the request is meant for a Struts action 用URL扩展名来确定是否这个请求是被用作Struts action,其实也就是设置 action的后缀,例如login.do的\'do\'字。 struts.configuration The org.apache.struts2.config.Configuration implementation class org.apache.struts2.config.Configura…
2007-10-24 23:55 · Struts · Apache · Spring · velocity · Struts · freemarker
Struts 2 间接实现零配置
所谓间接实现零配置,是指只要做些初始化的配置之后,在以后的开发中基本上不用再对每个Action做配置 struts.xml这样配置 代码 <action name="*/*" method="{2}" class="workbench.web.actions.{1}Action"> <result name="custom">/view/{1}/${target}.jsp</result> </action> <script>render_code();</script> struts.properties的配置: 代码 struts.objectFactory = spring strut…
2007-10-19 11:41 · Struts · Spring · Struts · XML · JSP · Web
Parameters in configuration results
Parameters in configuration results Edit Page Browse Space Add Page Add News Added by Dariusz Wojtas, last edited by Dariusz Wojtas on Feb 03, 2007 (view change) Sometimes there is a need to redirect from one action to another, but you do not know the exact url or the destination url requires param…
2007-10-10 17:12 · Struts · Struts
How do we upload files
xml 代码 How do we upload files Edit Page Browse Space Add Page Add News Added by tm_jee, last edited by Ted Husted on Jan 28, 2007 (view change) You can obtain the MultipartRequestWrapper from the ServletActionContext or by utilizing the fileUpload interceptor. The fileUpload interceptor is preferre…
2007-10-10 16:47 · Struts · Apache · Struts · XML · Access · Servlet
display dynamic or static images
How can we display dynamic or static images that can be provided as an array of bytes Edit Page Browse Space Add Page Add News Added by tm_jee , last edited by Ted Husted on Jul 22, 2006 ( view change ) To display an image represented as an array of bytes Reference an Action for the image src attri…
2007-10-10 16:38 · Struts · HTML · Apache · Struts · XML · JSP
Struts2 验证器
<validators> <validator name="required" class="com.opensymphony.xwork2.validator.validators.RequiredFieldValidator"/> <validator name="requiredstring" class="com.opensymphony.xwork2.validator.validators.RequiredStringValidator"/> <validator name="int" class="com.opensymphony.xwork2.validator.valida…
2007-10-08 22:30 · Struts
Apache Struts 2 Plugin Registry
Apache Struts 2 Plugin Registry Home Edit Page Browse Space Add Page Add News Added by Don Brown , last edited by Frank W. Zammetti on Jun 06, 2007 ( view change ) show comment show comment hide comment Comment: Added a phrase in the second paragraph to clarify that plugins may require other depend…
2007-10-03 17:25 · Struts
Struts 2 官方
Struts 2 官方: http://struts.apache.org/2.0.9/index.html
2007-10-03 17:22 · Struts · HTML · Apache · Struts
struts2与spring2集成
在Eclipse下建立一个Dynamic Web Application。 从struts2.0.6的lib目录中复制下面的库文件到WEB-INF/lib目录下: commons-logging-1.1.jar freemarker-2.3.8.jar ognl-2.6.9.jar struts-api-2.0.6.jar struts-core-2.0.6.jar struts-spring-plugin-2.0.6.jar xwork-2.0.0.jar 从spring中lib目录中复制下面的库文件到WEB-INF/lib目录下: spring.jar 修改web.xml,增加一个str…
2007-10-03 17:12 · Struts
struts2的struts.properties配置文件详解
struts.action.extension The URL extension to use to determine if the request is meant for a Struts action 用URL扩展名来确定是否这个请求是被用作Struts action,其实也就是设置 action的后缀,例如login.do的'do'字。 struts.configuration The org.apache.struts2.config.Configuration implementation class org.apache.struts2.config.Configurati…
2007-10-03 17:02 · Struts
Struts 2与AJAX(第三部分)
Struts 2与AJAX(第三部分) 很久没有更新BLOG了,前一段时间公司的项目比较忙,另外我还和一位出版社的朋友谈写书的事情,所以一直没有时间,完成《Struts 2与AJAX》。后来写书的事情吹了,趁今天有点空闲就把它完成。 在大家看这部分文章之前,我想对于写书的事情说两句,或者应该叫发牢骚才对。通过这次写书失败的经历,我明白为什么国内的IT书籍多数是滥于充数、粗制滥造、缺乏经典。其实说白了就是一个“钱”字作怪。为了市场,很多编辑可能会“建议”你去“抄考”一些国内相对畅销的同类书籍,例如写Struts就一定要按所谓的MVC进行目录分类,美其名曰“容易入门”。我认为“MVC”的概念虽然…
2007-10-03 16:53 · Struts
Struts 2与AJAX(第二部分)
在上一篇文章《 Struts 2与AJAX(第一部分) 》,我已经简单地介绍了<s:tree />的一些用法,接下来我将继续深入讲解<s:tree />的使用和通过DWR实现AJAX校验。 更多<s:tree /> 在Struts 2的showcase中有两个<s:tree />的例子,分别是静态树与动态树。所谓的静态树即是在编写JSP代码时通过<s:treenode />生成树节点。我的上一篇文章的例子就是一个典型的静态树。而动态树则是在程序运行期间,Struts 2 运行时(Runtime)根据程序中的数据动态创建树节点。虽然在两个例子中<s:tree />的theme属性都为“ajax…
2007-10-03 16:52 · Struts
Struts 2与AJAX(第一部分)
Struts 2与AJAX(第一部分) 在当今——Web 2.0概念铺天盖地的Internet环境下,简易的AJAX集成对于一个成功的WEB框架来说是不可或缺的。因此,Struts 2其中的一个重要的功能(Feature)就是“ First-class AJAX support - Add interactivity and flexibility with AJAX tags that look and feel just like standard Struts tags(大意: 一流的AJAX支持 ——通过AJAX标志增加互动性和灵活性,而且使用这些AJAX标志与普通的Struts标志…
2007-10-03 16:51 · Struts
struts2表单标签
Form Tags Browse Space View Info Added by scud , last edited by yangkaifeng on May 21, 2006 ( view change ) <style type="text/css"> div.auto_complete { width: 350px; background: #fff; } div.auto_complete ul { border: 1px solid #888; margin: 0; padding: 0; width: 100%; list-style-type: none; } div.a…
2007-10-03 16:48 · Struts
Struts2 with logon
关于此工程中的所有设置是承接前一篇文章 Struts2介绍之使用链接标签 中的设置,具体文件路径设置如下图所示,开发环境JDK1.5+MyEclipse5.5+Tomcat6.0。 <v:shapetype id="_x0000_t75" stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t" o:spt="75" coordsize="21600,21600"><v:stroke joinstyle="miter"></v:stroke><v:formulas><v:f eqn="if lineDr…
2007-10-03 16:45 · Struts
Struts2介绍之使用链接标签
Web应用区别于普通的站点之处在于Web应用可以创建一个动态的响应。为了使从一个页面中链接一个动态数据变得简单,Struts2框架提供了一系列的标签。 Struts标签的一种用法是创建链接到其他Web资源,特别是针对那些在本地应用中的资源。 <o:p> </o:p> 1.普通链接<o:p></o:p> Web程序中最普通的应用是链接到其他页面,下面看Welcome.jsp。 <%@ page contentType="text/html; charset=UTF-8" %> <%@ taglib prefix="s" uri="/struts-tags" %> <html> <head> <…
2007-10-03 16:42 · Struts
Strus 2的新表单标志的使用
Struts 2为大家提供了不少常用的很酷的表单标志,简化了我们程序员的工作。不过,由于这些都是新标志,大家可能在使用上还存在不少疑问。本文将就朋友们的回复、留言或Email上的问题,分别对这些酷标志进行讲述。 表单标志使用小技巧 Struts 2的表单标志在输出(render)HTML时,使用了模板的概念,增加了复杂性(因为它不像Struts 1.x的表单标志,它通常都是一个标志对应HTML的一个元素),因此大家在使用时,需要一些技巧: Struts 2的UI标志的表单标志默认是以表格布局,按钮是右对齐的。如果你不喜欢此风格,你可以简单地将<s:form />标志的“theme”属性设为“…
2007-10-03 16:35 · Struts
在Struts 2中实现文件上传
实现原理 Struts 2是通过Commons FileUpload文件上传。Commons FileUpload通过将HTTP的数据保存到临时文件夹,然后Struts使用fileUpload拦截器将文件绑定到Action的实例中。从而我们就能够以本地文件方式的操作浏览器上传的文件。 具体实现 前段时间Apache发布了Struts 2.0.6 GA,所以本文的实现是以该版本的Struts作为框架的。以下是例子所依赖类包的列表: 清单1 依赖类包的列表 首先,创建文件上传页面FileUpload.jsp,内容如下: <% @ page language = " java " contentT…
2007-10-03 16:33 · Struts