<form action="getMReader.action" method="get">
<table class="tbAddContactinfo" width="100%">
<tr>
<td style=" width:100px; text-align:right;">
<span>读者名:</span>
</td>
<td>
<input id="Text2" type="text" name="name" style="width:300px;" />
</td>
<td style="width:100px;">
<input type="submit" value="查询"/>
</td>
<td style="width:100px;">
<input type="button" value="添加" onclick="add();"/>
</td>
<td style="width:50%;"></td>
</tr>
</table>
</form>
求大神,回复尽量清楚详细一点,本人新手乱码
<table class="tbAddContactinfo" width="100%">
<tr>
<td style=" width:100px; text-align:right;">
<span>读者名:</span>
</td>
<td>
<input id="Text2" type="text" name="name" style="width:300px;" />
</td>
<td style="width:100px;">
<input type="submit" value="查询"/>
</td>
<td style="width:100px;">
<input type="button" value="添加" onclick="add();"/>
</td>
<td style="width:50%;"></td>
</tr>
</table>
</form>
求大神,回复尽量清楚详细一点,本人新手乱码
<%@ page contentType="text/html;charset=UTF-8"%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">然后java文件的编码格式也调为UTF-8
<filter-name>struts-cleanup</filter-name>
<filter-class>
org.apache.struts2.dispatcher.ActionContextCleanUp
</filter-class>
</filter>
<filter-mapping>
<filter-name>struts-cleanup</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-name>struts-cleanup</filter-name>
<filter-class>
org.apache.struts2.dispatcher.ActionContextCleanUp
</filter-class>
</filter>
<filter-mapping>
<filter-name>struts-cleanup</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<form action="getMReader.action" method="post"></form>
或者在config/Server.xml中找到Connector这个元素,然后,在这个元素中一个属性:URIEncoding="GBK"
这样可以统一解决。