码迷,mamicode.com
首页 >  
搜索关键字:servletactioncontext    ( 141个结果
图形校验码
public void verifyCode() throws IOException{ HttpServletRequest request = ServletActionContext.getRequest(); HttpServletResponse response = ServletAct...
分类:其他好文   时间:2015-05-26 18:36:29    阅读次数:168
上传文件使用的函数(日期文件夹)
函数: //文件上传用的函数 protected String saveUploadFile(File upload) { //1,得到文件上传的文件夹的真实路径 String basePath = ServletActionContext.getServletContext().getRealPath("/WEB-INF/upload_files"); SimpleDateFo...
分类:Web程序   时间:2015-05-26 14:28:22    阅读次数:155
使用ServletActionContext类直接访问Servlet API
使用ServletActionContext类直接访问Servlet API Struts2提供了借助ServletActionContext类访问Servlet API。ServletActionContext中的方法是静态的方法 访问Servlet API的方法主要有如下几个: static PageContext getPageContext()      用于...
分类:Windows程序   时间:2015-05-09 08:52:07    阅读次数:154
(转)ActionContext和ServletActionContext
前面已经了解到ActionContext是Action执行时的上下文,里面存放着Action在执行时需要用到的对象,我们也称之为广义值栈。 Struts2在每次执行Action之前都会创建新的ActionContext,在同一个线程里ActionContext里面的属性是唯一的,这样Action就可...
分类:其他好文   时间:2015-05-05 18:39:32    阅读次数:206
struts2中获取request、response,与android客户端进行交互(文件传递给客户端)
用struts2作为服务器框架,与android客户端进行交互需要得到request、response对象。struts2中获取request、response有两种方法。第一种:利用ServletActionContext的静态方法Struts2 利用ServletActionContext类来维...
分类:移动开发   时间:2015-04-26 22:28:30    阅读次数:154
10.用户模块:退出登录
点击退出,销毁session,返回到首页。 1、在menu.jsp中加入退出的链接 退出| 2、在UserAction.java中加入方法quit /** * 退出 * @return */ public String quit(){ //销毁session ServletActionContext.getRequest().getSes...
分类:其他好文   时间:2015-04-26 13:53:40    阅读次数:123
java修改文件名
publicvoidrenameFile(StringoldFile,StringnewFile){HttpServletRequestrequest=ServletActionContext.getRequest();Stringpath=request.getSession().getServletContext().getRealPath("/");StringupdatePath=path+"upload"+File.separator;Fileoldfile=newFile(updatePath+o..
分类:编程语言   时间:2015-04-24 16:52:22    阅读次数:135
Struts2---ActionContext和ServletActionContext小结
转载自:http://www.cnblogs.com/tanglin_boy/archive/2010/01/18/1650871.html感谢原文作者的总结1. ActionContext在Struts2开发中,除了将请求参数自动设置到Action的字段中,我们往往也需要在Action里直接获取请...
分类:其他好文   时间:2015-04-18 16:03:24    阅读次数:138
ajax 实例
jsp页面代码:后台action代码:try { /** 获取response对象 */ HttpServletResponse response = ServletActionContext.getResponse(); /** 获取输出o...
分类:Web程序   时间:2015-04-02 18:17:19    阅读次数:153
后台程序控制js弹出框
public void jsWindow(String msg, int i){ HttpServletResponse response=ServletActionContext.getResponse(); try { response.setContentType("text/html...
分类:Web程序   时间:2015-04-02 18:10:52    阅读次数:138
141条   上一页 1 ... 7 8 9 10 11 ... 15 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!