使用Servlet和JSP构建Web应用程序
在Web应用程序开发中,Servlet和JSP是两种常用的技术。下面将详细介绍如何使用它们构建一个名为eMotherEarth的应用程序,包括购物车展示、订单确认等功能,并分析这两种技术的优缺点。
1. 使用Servlet构建Web应用程序
在使用Servlet构建eMotherEarth应用程序时,主要涉及到几个关键页面和对应的Servlet。
1.1 第三页:ShowCart
ShowCart页面用于展示用户购物车的内容,并提供完成购买的选项。以下是ShowCart Servlet的代码:
package com.nealford.art.history.servletemotherearth;
import com.nealford.art.history.servletemotherearth.lib.*;
import java.io.*;
import java.sql.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class ShowCart extends EMotherServletBase {
static final private String SQL_GET_PRODUCT =
"select * from products where id = ?";
public void doPost(HttpServletRequest request,
超级会员免费看
订阅专栏 解锁全文
4851

被折叠的 条评论
为什么被折叠?



