日期:2014-05-17 浏览次数:20792 次
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
request.setCharacterEncoding("utf-8");
Songs song = (Songs)request.getAttribute("song");
ShowAllSongs sas = new ShowAllSongs();
PrintWriter out = response.getWriter();
int result = sas.updataSonginfo(song, song.getSongid());
if(result == 0){
out.println("更新失败!请重新检查或联系开发者!</p>");
out.println("<a href=\"./showAllSongList.jsp\" >返回歌曲列表</a>");
}else{
out.println("更新成功!</p>");
out.println("<a href=\"./showAllSongList.jsp\" >返回歌曲列表</a>");
}
}
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<jsp:directive.page import="com.fjzkx.onlineTelQQ.biz.ShowAllSongs"/>
<jsp:directive.page import="com.fjzkx.onlineTelQQ.data.Songs"/>
<jsp:directive.page import="com.fjzkx.onlineTelQQ.db.DBConnection"/>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'editSongsInfo.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="编辑歌曲信息">
</head>
<body>
<%
Songs song = new Songs();
String sid = request.getParameter("songid");
int songid = Integer.parseInt(sid);
ShowAllSongs showAllSongs = new ShowAllSongs();
try{
song = showAllSongs.getSongInfo(songid);
}catch(Exception e){
e.printStackTrace();
}
if(song!=null){
%>
<form action="/www/servelet/editSongInfo" method="post">
<table border="1" align="center">
<tr>
<th align="center">歌曲编号</th>
<th align="center">分类编号</th>
<th align="center">拼音字母</th>
<th align="center">歌曲地址</th>
<th align="center">加入时间</th>
<th align="center">歌曲名称</th>
<th align="center">歌手</th>
&l