jsp - session

<%@ page contentType="text/html;charset=utf-8" %>

<html>
<head>
<title>Cookie Counter. ver Session</title>
</head>
<body>

<h4>Welcome to my blog</h4>
<%
// getAttribue()는 object형을 반환
// wrapper클래스의 사용이 필요.
Integer number = (Integer)session.getAttribute("counter");

if(number==null) { number = new Integer(1); }
else { number = new Integer(number.intValue()+1); }

// 세션의 저장.
session.setAttribute("counter", number);
%>

<p>Count Today : <%= number %></p>

</body>
</html>
크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기

Posted by 홍반장

2009/10/07 17:18 2009/10/07 17:18
Response
No Trackback , No Comment
RSS :
http://tcbs17.cafe24.com/tc/rss/response/4695

Trackback URL : http://tcbs17.cafe24.com/tc/trackback/4695

« Previous : 1 : ... 1749 : 1750 : 1751 : 1752 : 1753 : 1754 : 1755 : 1756 : 1757 : ... 6391 : Next »

블로그 이미지

- 홍반장

Archives

Recent Trackbacks

Calendar

«   2024/05   »
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  
Statistics Graph

Site Stats

Total hits:
189496
Today:
296
Yesterday:
669