比如咱CSDN的首页下面打开之后 链接是:
http://www.csdn.net/
这个链接下面读取了很多很多的信息,这些信息肯定都是动态生成的吧。我的系统目前是这样设计的:
这上面的几个区域分别对应一个Action,所以在加载首页的时候我是这样处理的:
public String index()
{
listNotice = noticeService.getAllNotice();
listInstrument = instrumentService.getAllInstrument();
listInstrumentReservation= instrumentReservationService.getAllInstrumentReservation();
int pagesize = 15;// 每页10条记录
int offset = 0;
HttpServletRequest request = ServletActionContext.getRequest();
if (request.getParameter("pager.offset") != null)
offset = Integer.parseInt(request.getParameter("pager.offset"));
PageModel pm = instrumentService
.findAllInstrument(offset, pagesize);
Map session = ActionContext.getContext().getSession();
session.put("pm", pm);
request.setAttribute("pm", pm);
return SUCCESS;
}
也就是说我加载了很多很多的Action,所以浏览器的链接也变成下面的了。
http://localhost:8080/ItemSys/user/indexAction.action
我想问下,关于首页加载这么多Action,其实是执行了很多Action,而且浏览器地址还是显示为首页的呢。
是不是生成了HTML?
http://www.csdn.net/
这个链接下面读取了很多很多的信息,这些信息肯定都是动态生成的吧。我的系统目前是这样设计的:
这上面的几个区域分别对应一个Action,所以在加载首页的时候我是这样处理的:
public String index()
{
listNotice = noticeService.getAllNotice();
listInstrument = instrumentService.getAllInstrument();
listInstrumentReservation= instrumentReservationService.getAllInstrumentReservation();
int pagesize = 15;// 每页10条记录
int offset = 0;
HttpServletRequest request = ServletActionContext.getRequest();
if (request.getParameter("pager.offset") != null)
offset = Integer.parseInt(request.getParameter("pager.offset"));
PageModel pm = instrumentService
.findAllInstrument(offset, pagesize);
Map session = ActionContext.getContext().getSession();
session.put("pm", pm);
request.setAttribute("pm", pm);
return SUCCESS;
}
也就是说我加载了很多很多的Action,所以浏览器的链接也变成下面的了。
http://localhost:8080/ItemSys/user/indexAction.action
我想问下,关于首页加载这么多Action,其实是执行了很多Action,而且浏览器地址还是显示为首页的呢。
是不是生成了HTML?
解决方案 »
- 一个ssh项目,其中一个action的service为空指针
- java.sql.SQLException: No suitable driver found for jdbc://localhost:8080/test
- 如何用HIBERNATE调用存储过程
- 如何将String类型的日期转换成java.sql.Date类型存进数据库?
- 急~~~new一个实体对象时自增长的Id为0而不是Null.为什么?
- Struts2中使用Extjs的问题
- 求教多人如何操作application?
- 这是什么??????????????
- 在JSP中如何打开新的页面,类似html的target="_black"
- 请问JSP页面NULL如何去掉????
- javascript实现刷新浏览器(按F5),页面某处,假设是一个div,div中的内容就发生变化
- jsp中图片显示红叉
项目一般都不会放早root下面的吧?
root下面的不是些tomcat管理信息的页面嘛?
你不能把他们放到分开的action里面。