- 浏览: 372798 次
- 性别:
- 来自: 深圳
-
文章分类
- 全部博客 (252)
- struts1.3 (18)
- spring2.0 (6)
- html & Css (30)
- soap (0)
- hibernate3.3.2 (3)
- JQuery1.4 (11)
- wsdl (0)
- Amazon EC2 (3)
- jsp (4)
- myeclipse skill (9)
- linux (1)
- servlet (1)
- english (7)
- Ajax (5)
- 常识 (3)
- 生活 (6)
- 工具 (42)
- 期货 & 外汇 (4)
- tomcat (2)
- ext (1)
- java se (11)
- java ee (1)
- it行业知识 (6)
- plsql developer skill (2)
- apache commons logging (1)
- apache commons HttpClient (1)
- apache commons codec (1)
- windows7 skill (3)
- 数据库设计 (2)
- oracle (5)
- junit (1)
- xStream (2)
- jdom (1)
- dwr (1)
- erp (2)
- javascript (4)
- Base64 (1)
- Ant (0)
- Apache CXF (1)
- 美剧 Friends season one (1)
- 设计模式 (1)
- android (0)
- html5 (0)
- SVN Skill (2)
- FindBugs (1)
- 云计算 (1)
- SAP (35)
- 演讲 (1)
- PMP (1)
- Velocity1.7 struts2.0 (1)
- svn (1)
最新评论
-
hijackwust:
最次的方法,没有之一
让一个工程并存jar包不同版本 -
手写白:
...
让一个工程并存jar包不同版本 -
wqsmd1:
连接不会关,怎么弄
Struts2 + JasperReports4 + DB2 Demo -
tntxia:
楼主,怎么没有放keymaker.jar这个包啊
Aqua Data Studio 破解及解决乱码说明 -
mrsea2010:
楼主,按照你的方法,点击联接,我都不能显示出页面,直接报404 ...
Struts2 + JasperReports4 + DB2 Demo
(1)通过struts内部的RequestProcessor来设置编码。
EncodingHandler.java
package com.test.util; import java.io.UnsupportedEncodingException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.RequestProcessor; public class EncodingHandler extends RequestProcessor { @Override protected boolean processPreprocess(HttpServletRequest request, HttpServletResponse response) { try { //当struts-config.xml中设置了此类的controller,所有请求会先经过这边做处理。 // <controller processorClass="com.test.util.EncodingHandler"></controller> request.setCharacterEncoding("utf-8"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } return true; } }
(2)通过servlet 的filter来设置编码,更通用。
EncodingServlet.java
package com.test.filter; import java.io.IOException; import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServlet; public class EncodingServlet extends HttpServlet implements Filter { private static final long serialVersionUID = 1L; @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain) throws IOException, ServletException { try { request.setCharacterEncoding("utf-8"); filterChain.doFilter(request, response); } catch (Exception ex) { } } @Override public void init(FilterConfig arg0) throws ServletException { } }
web.xml
<filter> <filter-name>encodingFilter</filter-name> <filter-class>com.test.filter.EncodingServlet</filter-class> </filter> <filter-mapping> <filter-name>encodingFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
发表评论
-
db 设计
2011-09-16 14:57 0sdf asdf -
2BW330_ZH_Col74_FV_Part_A4.part1.rar
2011-03-17 00:48 02BW330_ZH_Col74_ ... -
sap 前3次课
2011-03-13 23:14 0飞 -
vodaplex_c05需求
2010-12-29 00:02 0rt -
DispatchAction用法示例
2010-12-23 16:18 1702*action.java package com.test. ... -
解决web project中用FileInputStream读取properties系统找不到指定的路径
2010-12-17 00:22 5447package com.test.action; imp ... -
input hidden(隐藏域)传值例子
2010-11-21 23:30 0rt -
Struts配置文件详解
2010-11-09 23:28 1051<zt>http://blog.csdn.net/ ... -
Struts 的工作流程_ActionServlet 流程图 时序图
2010-10-06 19:35 1616Struts 的工作流程 (1)对于采用Struts框架的 ... -
Struts实现的MVC框架流程图
2010-10-06 19:23 1137Struts实现的MVC框架流程图 -
MVC_notes
2010-10-06 18:42 747(1)MVC模式的目的是实现Web系统的职能分工。 (2)M ... -
<bean:include>
2010-07-06 23:35 832<!-- 这种情况下,会将test.txt内容输出到页 ... -
<bean:header>
2010-07-06 22:53 712主要是获取http头信息用的。 <bean:he ... -
<bean:define>
2010-07-06 21:46 813action里面做处理。 Test test = new T ... -
<bean:page>
2010-06-28 00:31 860Action中的excute写入request.setAttr ... -
<bean:cookie>
2010-06-27 23:04 771在继承Action的excute方法中 //bean:c ... -
login_demo
2010-06-21 23:40 711note: (1)注意几种action用法。 Object ... -
test
2010-05-10 13:15 0test -
bean:message
2010-03-17 00:03 971*.jsp <%@taglib uri="h ... -
struts_doc(2)
2010-03-16 00:53 823...
相关推荐
Note: output_handler must be empty if this is set 'On' !!!! ; Instead you must use zlib.output_handler. ; http://php.net/output-handler ;output_handler = ; Transparent output compression using the ...
This allows you to build a more advanced test set execution flow, in which you can filter tests in a test set during execution, based on the status or type of each test. VAPI-XP is also fully ...
+ added BIFF8 XLS export filter + added to ODF export the Language property + [enterprise] added "scripts" folder for additional units ("uses" directive in report script) + [enterprise] added logs for...
* The filter_data used in the list-objects-filter (which manages a lazily sparse clone repository) did not use the dynamic array API correctly---'nr' is supposed to point at one past the last ...
The Set of Native Delphi Components for Borland Delphi versions 1, 2, 3, 4, 5, 6, 7, 2005, 2006, 2009 and Borland C++ Builder 1, 3, 4, 5, 6, 2006 & 2009. 100% Source Code. Last revision date Oct 12, ...