jsp中选择一个下拉菜单的内容让其出现对应音乐或者图片
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
request.setCharacterEncoding("UTF-8");
String pic = request.getParameter("picture");
%>
<html>
<center>
<body background="image/<%=pic%>" >
<form action="" method=post name="form">
选择背景音乐:<br/><select name="music">
<option value="魏晨-不变.mp3">不变</option>
<option value="买辣椒也用券 - 起风了.mp3">起风了</option>
</select><br/>
选择背景图像:<br/><select name="picture" size="2" >
<option value="vision1.jpg">魏晨
<option value="landi1.jpg">李兰迪
</select><br/>
<%
String music = request.getParameter("music");
if(music!=null){
if(music.equals("魏晨-不变.mp3")){
out.println("<embed src='music/魏晨-不变.mp3' hidden='true' ></embed>");
}else{
out.println("<embed src='music/买辣椒也用券 - 起风了.mp3' hidden='true' ></embed>");
}
}
%>
<input type="submit" value="提交"/>
</form>
</body>
</center>
</html>