比如咱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?
解决方案 »
- 多文件上传问题! 一个浏览按钮, 可以选择多个文件
- 用session处理同一客户端上多用户登录的问题!
- web应用中怎么实现action可以调用的钩子?
- 有谁知道短信猫??
- 一个简单的聊天室的登陆,有错误
- 请问,我的JSP是连接SQL SERVER数据库的,我能只将我的JSP放在linux中,SQL SERVER装在windows中,这样可以连接吗?
- applet直接连接mysql异常?
- 请教,邮件删除问题,怎样通过选择复选框来删除邮件内容
- 怎样才能找到 import javax.servlet.*;
- 在线给分:在jsp页面内部能不能定义字函数或者类来调用
- javascript实现刷新浏览器(按F5),页面某处,假设是一个div,div中的内容就发生变化
- jsp中图片显示红叉
项目一般都不会放早root下面的吧?
root下面的不是些tomcat管理信息的页面嘛?
你不能把他们放到分开的action里面。