因為公司都是用的台灣繁體字,編碼是BIG5 所以我在增加物料信息的時候都是BIG5形式添加的
<%@ page contentType="text/html;charset=BIG5" language="java"%>
現在有個問題,二種跳轉方式,二種不同的結果,一種是亂碼,一種可以字體不會變亂碼
第一種方式:
 <script language="javascript">
function JsSave(uri){
     document.getElementById("form1").action=uri;
     document.getElementById("form1").submit();
}
 </script>
<form  enctype="multipart/form-data" name="form1" method="post" >
<td colspan="4" align="center"><input type=button value="增加" onclick="JsSave('daogetcangguanaddmate.do')">&nbsp;&nbsp;
          <input type=reset value="重填">
</td>
 </form>這種方式添加的時候有繁體字不會變亂碼
第二種方式:
<form action="daogetcangguanaddmate.doenctype="multipart/form-data" name="form1" method="post" >
<input type=submit value="增加" onclick="JsSave('daogetcangguanaddmate.do')">
 </form>這個就有問題,並且有個很怪的現象,當你點增加的瞬間,有繁體的字馬上轉化成簡體,到後台變變成亂碼了
我想用第二種方式,因為有的客戶說要用回車進行添加數據,第一種就不行了,有沒高手幫下忙第二種方法怎麼變亂碼了

解决方案 »

  1.   

    我的過濾濾WEB.xml這樣配的
    <filter>
    <filter-name>Set Character Encoding</filter-name>
    <filter-class>
    com.common.filters.SetCharacterEncodingFilter
    </filter-class>
    <init-param>
    <param-name>encoding</param-name>
    <param-value>BIG5</param-value>
    </init-param>
    </filter>
    <filter-mapping>
    <filter-name>Set Character Encoding</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping>  
      

  2.   

    第二種方式: 
    <form action="daogetcangguanaddmate.doenctype="multipart/form-data" name="form1" method="post" > 
    <input type=submit value="增加" onclick="JsSave('daogetcangguanaddmate.do')"> LZ 是发布错了还是程序中就这样啊
    <form action="daogetcangguanaddmate.do" enctype="multipart/form-data" name="form1" method="post" > 
      

  3.   

    第二种方法有了action了就不要 onclick事件了吧
      

  4.   

    對,樓上說的是的,第二種方式不用onclick事件
      

  5.   

    那小不小得它一瞬間繁變簡是啥原因,我的頁面是BIG5形式的,輸的字體也是BIG5的,過濾器也是BIG5過濾的,那一瞬間是啥原因,能不能說明下