[자바JSP학원교육추천,JSP기초실무,JDBC,서블릿,평일주말야간저녁교육학원추천]JSP 쇼핑카트, 장바구니 예제[JSP 세션 장바구니예제, ShoppingCart],오라클자바커뮤니티실무학원
(ShoppingCart.html)
<html>
<head>
<title> Book store </title>
</head>
<head>
<title> Book store </title>
</head>
<body>
<center> <h1> OracleJavaCommunity Book Sore </h1> </center>
<hr>
원하는 품목을 클릭하세요.<br><br>
<a href="javabook.html">자바 관련 서적 </a> <br><br>
<a href="c++book.html">c++ 관련 서적 </a> <br><br>
<a href="cbook.html">c언어 관련서적 </a>
<hr>
</body>
</html>
<center> <h1> OracleJavaCommunity Book Sore </h1> </center>
<hr>
원하는 품목을 클릭하세요.<br><br>
<a href="javabook.html">자바 관련 서적 </a> <br><br>
<a href="c++book.html">c++ 관련 서적 </a> <br><br>
<a href="cbook.html">c언어 관련서적 </a>
<hr>
</body>
</html>
(c++book.html)
<html>
<head>
<title> C++ Programming Series </title>
</head>
<body>
<center> <h1> C++ Programming Series </h1> </center>
<b> Add to ShoppingCart </b> <br><br>
<hr>
<form action = "BookStore.jsp" method="post">
<input type="Checkbox" name="book" value="C++ Programming Bible">
C++ Programming Bible <br><br>
<input type="Checkbox" name="book" value="C++ Programming Basic">
C++ Programming Basic <br><br>
<input type="Checkbox" name="book" value="Data Structure in C++">
Data Structure in C++ <br><br>
<input type="Checkbox" name="book" value="The C++ programming Lan...">
The C++ programming Language <br><br>
<hr>
<input type="submit" value="Add to ShoppingCart">
<input type="reset" value="Clear Selected item">
</form>
</body>
</html>
<head>
<title> C++ Programming Series </title>
</head>
<body>
<center> <h1> C++ Programming Series </h1> </center>
<b> Add to ShoppingCart </b> <br><br>
<hr>
<form action = "BookStore.jsp" method="post">
<input type="Checkbox" name="book" value="C++ Programming Bible">
C++ Programming Bible <br><br>
<input type="Checkbox" name="book" value="C++ Programming Basic">
C++ Programming Basic <br><br>
<input type="Checkbox" name="book" value="Data Structure in C++">
Data Structure in C++ <br><br>
<input type="Checkbox" name="book" value="The C++ programming Lan...">
The C++ programming Language <br><br>
<hr>
<input type="submit" value="Add to ShoppingCart">
<input type="reset" value="Clear Selected item">
</form>
</body>
</html>
(cbook.html)
C Programming Basic <br><br>
<input type="Checkbox" name="book" value="C Data Structure">
C Data Structure <br><br>
<input type="Checkbox" name="book" value="C graphic programming">
C graphic programming <br><br>
<hr>
<input type="submit" value="Add to ShoppingCart">
<input type="reset" value="Clear Selected item">
</form>
</body>
</html>
<input type="Checkbox" name="book" value="C Data Structure">
C Data Structure <br><br>
<input type="Checkbox" name="book" value="C graphic programming">
C graphic programming <br><br>
<hr>
<input type="submit" value="Add to ShoppingCart">
<input type="reset" value="Clear Selected item">
</form>
</body>
</html>
(javabook.html)
<input type="Checkbox" name="book" value="Java Servlet
Programming">
Java Servlet Programming <br><br>
<input type="Checkbox" name="book" value="Java Network Programming">
Java Network Programming <br><br>
Java Servlet Programming <br><br>
<input type="Checkbox" name="book" value="Java Network Programming">
Java Network Programming <br><br>
<hr>
<input type="submit" value="Add to ShoppingCart">
<input type="reset" value="Clear Selected item">
</form>
</body>
</html>
<input type="submit" value="Add to ShoppingCart">
<input type="reset" value="Clear Selected item">
</form>
</body>
</html>
(BookStore.jsp)
<%@ page
info="Show all your books"
import="java.util.*"
contentType="text/html; charset=euc-kr"
%>
<html>
<head>
<title> Total Selected Books </title>
<body>
<%
Integer bookCount=(Integer)session.getValue("bookCount");
if(bookCount==null)
{
bookCount = new Integer(0);
}
String[] booksSelected;
String bookName;
booksSelected = request.getParameterValues("book");
if(booksSelected != null)
{
for(int i=0; i<booksSelected.length; i++)
{
bookName = booksSelected[i];
bookCount = new Integer(bookCount.intValue() +1);
info="Show all your books"
import="java.util.*"
contentType="text/html; charset=euc-kr"
%>
<html>
<head>
<title> Total Selected Books </title>
<body>
<%
Integer bookCount=(Integer)session.getValue("bookCount");
if(bookCount==null)
{
bookCount = new Integer(0);
}
String[] booksSelected;
String bookName;
booksSelected = request.getParameterValues("book");
if(booksSelected != null)
{
for(int i=0; i<booksSelected.length; i++)
{
bookName = booksSelected[i];
bookCount = new Integer(bookCount.intValue() +1);
session.putValue("book"+bookCount, bookName);
session.putValue("bookCount", bookCount);
}
}
%>
<b><center> 당신이 지금까지 선택한 책들의 목록입니다</center></b>
<br><br>
<hr><br><br>
<%
for(int i=1; i<= bookCount.intValue(); i++) {
String book = (String)session.getValue("book" + i);
out.println(book + "<br><br>");
}
session.putValue("bookCount", bookCount);
}
}
%>
<b><center> 당신이 지금까지 선택한 책들의 목록입니다</center></b>
<br><br>
<hr><br><br>
<%
for(int i=1; i<= bookCount.intValue(); i++) {
String book = (String)session.getValue("book" + i);
out.println(book + "<br><br>");
}
%>
<hr>
<a href= "ShoppingCart.html"> 처음으로 돌아가기 </a>
<br><br>
<hr>
<a href= "ShoppingCart.html"> 처음으로 돌아가기 </a>
<br><br>
<hr> 이것은 page 디렉티브의 info속성 값입니다.
<%= ((javax.servlet.jsp.HttpJspPage)page).getServletInfo() %>
</body>
</html>
<%= ((javax.servlet.jsp.HttpJspPage)page).getServletInfo() %>
</body>
</html>
[출처] 오라클자바커뮤니티 -
http://www.oraclejavacommunity.co.kr/bbs/board.php?bo_table=LecServletJSP&wr_id=266
오라클자바커뮤니티교육센터, 개발자전문교육, 개인80%환급
www.oraclejavacommunity.com
평일주간(9:30~18:10) 개강
(7/07)[기업100%환급]C#4.0,WinForm,ADO.NET프로그래밍
(7/07)[기업100%환급]Spring ,MyBatis,Hibernate실무과정
(7/07)[기업100%환급]자바기초에서 JDBC, Servlet/JSP까지
(7/07)[채용예정교육]오라클자바개발잘하는신입뽑기프로젝트,교육전취업확정
(7/14)[기업100%환급]SQL기초에서 Schema Object까지
(7/14)[기업100%환급]PL/SQL,ORACLE HINT,TUNING
(7/14)[기업100%환급]안드로이드개발자과정
평일야간(19:00~21:50) 개강
(7/01)안드로이드개발자과정
(7/01)닷넷(C#,Network,ADO.NET,ASP.NET)마스터과정
(7/02)Spring3.X, MyBatis, Hibernate실무과정
(7/02)자바웹(JSP,Spring,MyBatis,XPlatform)프로젝트과정
(7/02)JAVA,Network&WEB&Framework(자바기초에서웹스프링까지)
(7/03)웹퍼블리싱 마스터
(7/15)SQL기초에서실무까지
(7/15)MyBatis3.X, Hibernate4.X ORM실무과정
(7/22)자바기초에서JSP,Ajax,jQuery,Spring3.2,MyBatis까지
주말(10:00~17:50) 개강
(7/05)자바기초에서JSP,Ajax,jQuery,Spring3.2,MyBatis까지
(7/05)SQL초보에서 Schema Object까지
(7/12)자바웹(JSP,Spring,MyBatis,XPlatform)프로젝트과정
(7/12)MyBatis3.X, Hibernate4.X ORM실무과정
(7/12)개발자를위한PLSQL,SQL튜닝,힌트
(7/13)C#,ASP.NET마스터
(7/19)Spring3.X, MyBatis, Hibernate실무과정
(7/19)웹퍼블리싱 마스터
(7/19)안드로이드개발자과정
주말저녁(18:30~22:20) 개강
(7/19)JAVA,Network&WEB&Framework
(8/09)SQL기초에서실무까지
www.oraclejavacommunity.com
평일주간(9:30~18:10) 개강
(7/07)[기업100%환급]C#4.0,WinForm,ADO.NET프로그래밍
(7/07)[기업100%환급]Spring ,MyBatis,Hibernate실무과정
(7/07)[기업100%환급]자바기초에서 JDBC, Servlet/JSP까지
(7/07)[채용예정교육]오라클자바개발잘하는신입뽑기프로젝트,교육전취업확정
(7/14)[기업100%환급]SQL기초에서 Schema Object까지
(7/14)[기업100%환급]PL/SQL,ORACLE HINT,TUNING
(7/14)[기업100%환급]안드로이드개발자과정
평일야간(19:00~21:50) 개강
(7/01)안드로이드개발자과정
(7/01)닷넷(C#,Network,ADO.NET,ASP.NET)마스터과정
(7/02)Spring3.X, MyBatis, Hibernate실무과정
(7/02)자바웹(JSP,Spring,MyBatis,XPlatform)프로젝트과정
(7/02)JAVA,Network&WEB&Framework(자바기초에서웹스프링까지)
(7/03)웹퍼블리싱 마스터
(7/15)SQL기초에서실무까지
(7/15)MyBatis3.X, Hibernate4.X ORM실무과정
(7/22)자바기초에서JSP,Ajax,jQuery,Spring3.2,MyBatis까지
주말(10:00~17:50) 개강
(7/05)자바기초에서JSP,Ajax,jQuery,Spring3.2,MyBatis까지
(7/05)SQL초보에서 Schema Object까지
(7/12)자바웹(JSP,Spring,MyBatis,XPlatform)프로젝트과정
(7/12)MyBatis3.X, Hibernate4.X ORM실무과정
(7/12)개발자를위한PLSQL,SQL튜닝,힌트
(7/13)C#,ASP.NET마스터
(7/19)Spring3.X, MyBatis, Hibernate실무과정
(7/19)웹퍼블리싱 마스터
(7/19)안드로이드개발자과정
주말저녁(18:30~22:20) 개강
(7/19)JAVA,Network&WEB&Framework
(8/09)SQL기초에서실무까지
댓글 없음:
댓글 쓰기