人太少了,兄弟,你先等等.等到有四個人了.就可以了.
另外,說明一下.我的問題是我Tomcat的問題.重新安裝了個4.0就好了.
//==============================================================================
//個人經驗.歡迎交流
//==============================================================================
1.進行字符的轉換.要寫函數.一般第一個函數TranStrType就可以了.但有時用其他函數多試幾次
<%!
public String TranStrType(String str) throws Exception
{
byte[] _tempByte=str.getBytes("ISO8859-1");
String _tempStr=new String(_tempByte);
return _tempStr;
}public static String ISOtoGBK(String strvalue)
{
try{
if(strvalue==null)
return null;
else
{
strvalue = new String(strvalue.getBytes("ISO8859-1"),"GBK");
return strvalue;
}
}catch(Exception e){
return null;
}
}
public static String ISOtoGB2312(String strvalue)
{
try{
if(strvalue==null)
return null;
else
{
strvalue = new String(strvalue.getBytes("ISO8859-1"),"gb2312");
return strvalue;
}
}catch(Exception e){
return null;
}
}
public static String ISOtoBIG5(String strvalue)
{
try{
if(strvalue==null)
return null;
else
{
strvalue = new String(strvalue.getBytes("ISO8859-1"),"big5");
return strvalue;
}
}catch(Exception e){
return null;
}
}
public static String Gb2312toISO(String strvalue)
{
try{
if(strvalue==null)
return null;
else
{
strvalue = new String(strvalue.getBytes("gb2312"), "ISO8859-1");
return strvalue;
}
}catch(Exception e){
return null;
}
}
public static String GBKtoISO(String strvalue)
{
try{
if(strvalue==null)
return null;
else
{
strvalue = new String(strvalue.getBytes("gbk"), "ISO8859-1");
return strvalue;
}
}catch(Exception e){
return null;
}
}
public static String GIG5toISO(String strvalue)
{
try{
if(strvalue==null)
return null;
else
{
strvalue = new String(strvalue.getBytes("big5"), "ISO8859-1");
return strvalue;
}
}catch(Exception e){
return null;
}
}
%>
2.用Tomcat4.0.
這個版本的Tomcat再直接連接中文名的文件不會出現找不到文件的情況.而4.1則不行4.在JSP文件第一行加
<%@ page contentType="text/html;charset=big5"%>(繁體 )
<%@ page contentType="text/html;charset=gb2312"%>(簡體 )5.在html的head中加入
<meta http-equiv="Content-Type" content="text/html; charset=big5">(繁體 )
<meta http-equiv="Content-Type" content="text/html; charset=gb2313">簡體 )6.如果是在IE中直接顯示Excel,Word,PowerPoint.則在jakarta-tomcat-4.0\conf的web.xml文件中加入
<mime-mapping>
<extension>xls</extension>
<mime-type>application/msxls</mime-type>
</mime-mapping>
<mime-mapping>
<extension>doc</extension>
<mime-type>application/msword</mime-type>
</mime-mapping>
<mime-mapping>
<extension>ppt</extension>
<mime-type>application/vnd.ms-powerpoint</mime-type>
</mime-mapping>//==============================================================================
另外,說明一下.我的問題是我Tomcat的問題.重新安裝了個4.0就好了.
//==============================================================================
//個人經驗.歡迎交流
//==============================================================================
1.進行字符的轉換.要寫函數.一般第一個函數TranStrType就可以了.但有時用其他函數多試幾次
<%!
public String TranStrType(String str) throws Exception
{
byte[] _tempByte=str.getBytes("ISO8859-1");
String _tempStr=new String(_tempByte);
return _tempStr;
}public static String ISOtoGBK(String strvalue)
{
try{
if(strvalue==null)
return null;
else
{
strvalue = new String(strvalue.getBytes("ISO8859-1"),"GBK");
return strvalue;
}
}catch(Exception e){
return null;
}
}
public static String ISOtoGB2312(String strvalue)
{
try{
if(strvalue==null)
return null;
else
{
strvalue = new String(strvalue.getBytes("ISO8859-1"),"gb2312");
return strvalue;
}
}catch(Exception e){
return null;
}
}
public static String ISOtoBIG5(String strvalue)
{
try{
if(strvalue==null)
return null;
else
{
strvalue = new String(strvalue.getBytes("ISO8859-1"),"big5");
return strvalue;
}
}catch(Exception e){
return null;
}
}
public static String Gb2312toISO(String strvalue)
{
try{
if(strvalue==null)
return null;
else
{
strvalue = new String(strvalue.getBytes("gb2312"), "ISO8859-1");
return strvalue;
}
}catch(Exception e){
return null;
}
}
public static String GBKtoISO(String strvalue)
{
try{
if(strvalue==null)
return null;
else
{
strvalue = new String(strvalue.getBytes("gbk"), "ISO8859-1");
return strvalue;
}
}catch(Exception e){
return null;
}
}
public static String GIG5toISO(String strvalue)
{
try{
if(strvalue==null)
return null;
else
{
strvalue = new String(strvalue.getBytes("big5"), "ISO8859-1");
return strvalue;
}
}catch(Exception e){
return null;
}
}
%>
2.用Tomcat4.0.
這個版本的Tomcat再直接連接中文名的文件不會出現找不到文件的情況.而4.1則不行4.在JSP文件第一行加
<%@ page contentType="text/html;charset=big5"%>(繁體 )
<%@ page contentType="text/html;charset=gb2312"%>(簡體 )5.在html的head中加入
<meta http-equiv="Content-Type" content="text/html; charset=big5">(繁體 )
<meta http-equiv="Content-Type" content="text/html; charset=gb2313">簡體 )6.如果是在IE中直接顯示Excel,Word,PowerPoint.則在jakarta-tomcat-4.0\conf的web.xml文件中加入
<mime-mapping>
<extension>xls</extension>
<mime-type>application/msxls</mime-type>
</mime-mapping>
<mime-mapping>
<extension>doc</extension>
<mime-type>application/msword</mime-type>
</mime-mapping>
<mime-mapping>
<extension>ppt</extension>
<mime-type>application/vnd.ms-powerpoint</mime-type>
</mime-mapping>//==============================================================================
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货