- 浏览: 32468 次
- 性别:
- 来自: 北京
-
最新评论
文章列表
A:
<s:a xhref=""></s:a>-----超链接,类似于html里的<a></a>
<s:action name=""></s:action>-----执行一个view里面的一个action
<s:actionerror/>-----如果action的errors有值那么显示出来
<s:actionmessage/>-----如果action的message有值那么显示出来
<s:append></s:append> ...
struts2配置文
- 博客分类:
- Struts2配置
基础配置
WEB.XML
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
...
struts2配置文件中参数的传递
- 博客分类:
- Struts2配置
在Action中我们经常会从这个Action跳转到另一个Action中,如果只是简单的跳转那么很容易,只需在struts配置文件中添加一个result,如:<result name="index">/manager/managerInfo/account.jsp</result>.
result有一个type属性,这里的type默认是dispatcher,但这种情况下action之间是不能发送请求的,这时我们就要用到redirect、redirect-action、chain,当要请求一个action时,可设定type的值为以上三个中的一个
如 ...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; chars ...
hibernate 进行多表查询每个表中各取几个字段,也就是说查询出来的结果集没有一个实体类与之对应如何解决?
可以将查询返回一个DynaBean比如
Query query = super.getSession().createSQLQuery(sql);
return (Object[]) query.list().get(0);
返回 Object[]查询多表 多个字段
Or
Query query = super.getSession().createSQLQuery(sql);
Object obj = query.uniqueResult();
retu ...
http://www.oschina.net/question/129540_30919