Struts2页面提交中文乱码问题
在SSH项目的整合中,Struts2提交表单数据给后台的Action时,出现中文乱码;
1.前台页面
<%@ page language="java" import="java.util.*" pageEncoding="GB18030"%><%@ taglib prefix="s" uri="/struts-tags" %><%String path = request.getContextPath();String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html> <head> <base href="<%=basePath%>"> <title>My JSP 'index.jsp' starting page</title><meta http-equiv="pragma" content="no-cache"><meta http-equiv="cache-control" content="no-cache"><meta http-equiv="expires" content="0"> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"><meta http-equiv="description" content="This is my page"><!--<link rel="stylesheet" type="text/css" href="styles.css">--> </head> <body> This is my JSP page. <br> <s:form action="login.action" method="post"> <input type="text" id="test" name="stuVo.userName" /> <s:submit value="testSubmit" name="userNo"></s:submit> </s:form> <a href="login.action">test action</a> </body></html>