<html:form action="/message?action=question">
<table border="2">
<tr>
<td>留言</td>
<td>赛事名称:<html:select property="contestname">
<html:optionsCollection name="contest" value="contestName" label="contestName"/>
</html:select>
</td>
</tr>
<tr>
<td valign="top">内容:</td>
<td><html:textarea property="question"/></td>
</tr>
<tr>
<td align="right" colspan="2"><html:submit value="发表"/></td>
</tr>
</table>
</html:form>
这是JSP页面上的一张表单,我在输入留言提交后,跳回本页面,就在<html:textarea property="question"/>制定的文本框内出现了一串问号,求高人指点。
<table border="2">
<tr>
<td>留言</td>
<td>赛事名称:<html:select property="contestname">
<html:optionsCollection name="contest" value="contestName" label="contestName"/>
</html:select>
</td>
</tr>
<tr>
<td valign="top">内容:</td>
<td><html:textarea property="question"/></td>
</tr>
<tr>
<td align="right" colspan="2"><html:submit value="发表"/></td>
</tr>
</table>
</html:form>
这是JSP页面上的一张表单,我在输入留言提交后,跳回本页面,就在<html:textarea property="question"/>制定的文本框内出现了一串问号,求高人指点。
struts1.2 ,刚学没几天,求教,怎么把提交后的东西删掉
这是package com.househire.servlet;import java.io.IOException;
import java.io.UnsupportedEncodingException;import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;import org.apache.struts.action.ActionServlet;public class MyServlet extends ActionServlet{
public void process(HttpServletRequest request,HttpServletResponse response) throws UnsupportedEncodingException{
request.setCharacterEncoding("GBK");
response.setContentType("text/html;charset=GBK");
try {
super.process(request, response);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ServletException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}}
<servlet-name>action</servlet-name>
<servlet-class>com.househire.servlet.MyServlet</servlet-class>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
好了以后你项目里面就不会出现乱码了
可以解决乱码问题