jsp页面播发器中文问题
tomcat server.xml配置
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" URIEncoding="UTF-8"/>
<!-- A "Connector" using the shared thread pool-->
<Connector executor="tomcatThreadPool"
port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" URIEncoding="UTF-8"/>
jsp页面
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<object type="application/x-shockwave-flash" data="player/audioplayer.swf" width="290" height="24"
id="audioplayer<%=map.get("id")%>">
<param name="movie" value="player/audioplayer.swf" />
<param name="FlashVars" value="playerID=<%=map.get("name")%>&soundFile=<%=music %>" />
<param name="quality" value="high" />
<param name="menu" value="false" />
<param name="wmode" value="transparent" />
</object>
获取的路径为
/omvs/upload/SHINee - Everybody.mp3 不含中文的是播放没有问题的
/omvs/upload/陈慧琳 - 皮外伤.mp3 含有中文的就播放不了
有哪位大神帮忙解决下
------解决方案--------------------用js转码后再赋值。
//先引入jquery,然后。。
var name='<%=map.get("name")%>';
var music='<%=music %>';
//alert(name);//打印出来名称是否乱码
//如果乱码就在这里给name 转码, 看一下后台control接收的是否乱码
$(function(){
var v ="playerID="+name+"&soundFile="+music ;
$('param[name="FlasVars"]').eq(0).attr('value',v);//设置值
});
<param name="FlashVars" value="" />