?? photoupdateinservlet.java
字號:
package jdbcbook.photo;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;
import jdbcbook.pub.util.*;
/**
* 照片信息錄入頁面入口處理類
*/
public class PhotoUpdateInServlet extends HttpServlet
{
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException
{
// 取得照片的主鍵值
int nPhotoID = RequestUtil.getInt( request, "photoid", 0 );
if( nPhotoID > 0 )
{
// 取得主鍵值對應的照片信息
request.setAttribute( "photo", photo );
}
// 取得所有的照片分類信息
Collection coll = CategoryBean.queryCategory( null );
request.setAttribute( "categorys", coll );
// 跳轉到照片信息錄入頁面
RequestDispatcher dispatcher = request.getRequestDispatcher( "photo_update.vm" );
dispatcher.forward( request, response );
}
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException
{
doPost( request, response );
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -