ITeye博客

Struts

共 5 篇文章

Struts中iterator的用法

<s:iterator value="列表变量" status="下标代词" var="遍历元素"> ... ${遍历元素.属性} -> 访问单个元素的属性 ${下标代词.index} -> 访问列表下标 ... </s:iterator>

2013-03-13 16:46 · Struts

Action直接访问Servlet API

1. ActionContext import com.opensymphony.xwork2.ActionContext; ... ActionContext ctx = ActionContext.getContext(); ... //操作session ctx.getSession().put("key:xxx", "value:xxx"); //操作application ctx.getApplication().put("key:xxx", "value:xxx"); 2. 一些重要接口 虽然Struts2提供了ActionContext来操作Servlet API, 但是这种访…

2013-02-16 14:04 · Struts

struts2中ognl标签报错的原因

在jsp文件中,我们可以利用struts2的标签库,只需要在文件顶部 <%@ taglib prefix="s" uri="/struts-tags" %> 但是,有时候会报错,找了半天,原来是配置文件的关系 在web.xml文件中,需要加上如下 [code="xml"] struts-cleanup org.apache.struts2.dispatcher.ActionContextCleanUp ... struts-cleanup /* [/code]

2013-02-07 13:44 · Struts

第一个struts的web应用程序helloapp

struts作为非常成功的经典开源MVC模式,它是如下运作的: [color=blue][b] [size=large] * Controller(控制器)由ActionServlet和Action类来实现。 * ActionServlet负责读取struts-config.xml配置文件,使用 ActionMapping来查找对应的Action,并把请求转发给Action类。 * 对于大型应用,Action类充当用户请求和业务逻辑处理之间的Adaptot(适配器)。 * 在Model(模型)端,业务逻辑可以采用Java Bean或者EJB来完成。 * ActionForm Bean负责传递…

2009-08-11 20:46 · Struts · Apache · Struts · JSP · Web · Bean

在MyEclipse中手工配置Struts

我们知道,通过MyEclipse的右键菜单能够自动配置struts。但是这样我们就 无法知道struts配置到底需要做哪些事情。 今天,我们就来看一下如何手工配置一个struts的web应用程序。 具体来说,手工配置struts分为如下四大步骤: [b]1) 添加jar支持包[/b] [table] |struts.jar| |commons-logging.jar| |commons-beanutils.jar| |commons-digester.jar| |commons-fileupload.jar| |commons-validator.jar| |jakarta-oro.jar|…

2009-08-10 21:09 · Struts · Apache · Myeclipse · Struts · log4j · Web