今天在做圖書查詢時(shí),想讓查詢的條件通過(guò)GET的方式提交到相應(yīng)的action里.
問(wèn)題是中文數(shù)據(jù)提交到action里都成了亂碼.
用post提交時(shí),并不會(huì)出現(xiàn)上面提到的亂碼問(wèn)題.
請(qǐng)問(wèn)該怎樣解決提交用GET提交的亂碼問(wèn)題?
struts.xml已經(jīng)設(shè)置了
<constant name="struts.i18n.encoding" value="GBK" />
JSP頁(yè)面也設(shè)置了
<%@ page language="java" contentType="text/html; charset=GBK"%>
<s:form action="search.action" method="get">
<input type="hidden" name="order" value="hit">
<table>
<tr>
<td><s:textfield label="書名" name="bookName"/></td>
</tr>
<tr>
<td><s:textfield label="作者" name="authorName"/></td>
</tr>
<tr>
<td><s:textfield label="出版社" name="publishName"/></td>
</tr>
<tr>
<td>
<s:select label="折扣" list="#{0:'請(qǐng)選擇折扣',1:'30折以上',2:'30折到50折',3:'50折到70折',4:'70折以下'}"
listKey="key" listValue="value">
</s:select>
</td>
</tr>
<tr>
<td align="center"><input type="submit" value="確定"></td><td align="center"><input type="reset" value="重新填寫"></td>
</tr>
</table>
</s:form>
在SearchAction里輸出查詢條件.比如說(shuō)圖書名稱.在控制臺(tái)都成了亂碼
posted on 2007-11-22 14:14
Ke 閱讀(4198)
評(píng)論(4) 編輯 收藏 所屬分類:
問(wèn)題區(qū)