随笔分类 -  Struts2

摘要:最近做一个web项目中有上传文件的功能,已经写出并在本地和部署到服务器上测试了好几个文件上传都没问题(我用的是tomcat)。后来又上传了一个700多K的文件(前边的都是不足600K的,并且这个word文件用到了vb,比较复杂,可能造成读取较慢),在本地也是可以的,部署到服务器后在服务器上用服务器的... 阅读全文
posted @ 2014-12-07 19:58 Bright Moon ‘ s Blog 阅读(1402) 评论(0) 推荐(0)
摘要:String targetUrl = "http://localhost:8080/Test"; PostMethod filePost = new PostMethod(targetUrl) {//这个用来中文乱码 public String get... 阅读全文
posted @ 2014-12-06 17:39 Bright Moon ‘ s Blog 阅读(507) 评论(0) 推荐(0)
摘要:平时都是直接在action中按照struts2定义的格式来接流,最近看到华为技术人员调用struts2底层方法对文件流做了封装,感觉有用赶紧记了下来Java代码public void preExecute() { if (httpServletRequest instan... 阅读全文
posted @ 2014-12-06 16:30 Bright Moon ‘ s Blog 阅读(114) 评论(0) 推荐(0)
摘要:两个人的博客搜索关键词 “upload.parseRequest为空”http://bluthmatter.blog.163.com/blog/static/184294059201273121226377/http://blog.csdn.net/zbz0425/article/details/... 阅读全文
posted @ 2014-12-05 16:39 Bright Moon ‘ s Blog 阅读(141) 评论(0) 推荐(0)
摘要:获取单值Object obj = ((Object[])ActionContext.getContext().getParameters().get("parentCuetomerId"))[0]获取集合Object[] objs = (Object[]) ActionContext.getCont... 阅读全文
posted @ 2014-09-10 17:03 Bright Moon ‘ s Blog 阅读(162) 评论(0) 推荐(0)
摘要:单选按钮选中$("input[name='brand.isShow'][value=${brand.isShow}]").attr("checked",true);复选框选中$("select[name='goods.goodsType.uuid']").val(${goods.goodsType.... 阅读全文
posted @ 2014-07-03 10:56 Bright Moon ‘ s Blog 阅读(244) 评论(0) 推荐(0)
摘要:Struts2为页面展示数据提供了良好的支持,使开发者可以自定义输出的值。比如,你数据库有个status字段,存储的是整数类型的数据,不同的数字代表着不同的意义。那么在页面展示数据的时候必然不能展示出数值!!有以下几种解决方案:一、使用struts2的标签库中的。 优点:简单方便 缺点:太过于原... 阅读全文
posted @ 2014-06-05 13:15 Bright Moon ‘ s Blog 阅读(289) 评论(0) 推荐(0)
摘要:struts.xml configurationuser-defined interceptorpackage com.vincnet.jusns.interceptor;import com.opensymphony.xwork2.ActionInvocation;import com.opensymphony.xwork2.interceptor.AbstractInterceptor;import com.vincnet.jusns.entity.User;public class AuthenticationInterception extends AbstractIntercepto 阅读全文
posted @ 2014-01-25 15:41 Bright Moon ‘ s Blog 阅读(192) 评论(0) 推荐(0)
摘要:chain 用来处理Action链,被跳转的action中仍能获取上个页面的值,如request信息。 com.opensymphony.xwork2.ActionChainResultdispatcher 用来转向页面,通常处理JSP org.apache.struts2.dispatcher.ServletDispatcherResultfreemaker 处理FreeMarker模板 org.apache.struts2.views.freemarker.FreemarkerResulthttpheader 控制特殊HTTP行为的结果类型 org.apache.struts2.dispa 阅读全文
posted @ 2013-10-08 15:15 Bright Moon ‘ s Blog 阅读(312) 评论(0) 推荐(0)