|
리비전 5, 1.2 kB
(mefour에 의해 체크인됨, 16 년 전)
|
--
|
- svn:mime-type 속성이
text/plain (으)로 설정되어있습니다.
|
| Line | |
|---|
| 1 |
<%@ page language="java" contentType="text/html; charset=EUC-KR" |
|---|
| 2 |
pageEncoding="EUC-KR"%> |
|---|
| 3 |
<% |
|---|
| 4 |
String pollId = request.getParameter("pollId"); |
|---|
| 5 |
int id = Integer.parseInt(pollId); |
|---|
| 6 |
|
|---|
| 7 |
Poll poll = new PollService().get(id); |
|---|
| 8 |
if (poll == null) { |
|---|
| 9 |
poll = new Poll(); |
|---|
| 10 |
} |
|---|
| 11 |
ArrayList<Item> items = poll.getItems(); |
|---|
| 12 |
int totalCount = poll.getTotalCount(); |
|---|
| 13 |
%> |
|---|
| 14 |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
|---|
| 15 |
|
|---|
| 16 |
<%@page import="net.okjsp.poll.Poll"%> |
|---|
| 17 |
<%@page import="net.okjsp.poll.PollService"%> |
|---|
| 18 |
<%@page import="java.util.ArrayList"%> |
|---|
| 19 |
<%@page import="net.okjsp.poll.Item"%><html> |
|---|
| 20 |
<head> |
|---|
| 21 |
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR"> |
|---|
| 22 |
<title>결과보기</title> |
|---|
| 23 |
</head> |
|---|
| 24 |
<body> |
|---|
| 25 |
<h2> |
|---|
| 26 |
Q : <%= poll.getQuestion() %> |
|---|
| 27 |
</h2> |
|---|
| 28 |
<h3>총투표수: <%= totalCount %></h3> |
|---|
| 29 |
<ul> |
|---|
| 30 |
<% |
|---|
| 31 |
if (items != null) { |
|---|
| 32 |
for(Item item : items){ |
|---|
| 33 |
int percent = item.getCount() * 100 / totalCount; |
|---|
| 34 |
%> |
|---|
| 35 |
<li> |
|---|
| 36 |
<%= item.getLabel() %>, <%= item.getCount() %>(<%= percent %>%) |
|---|
| 37 |
</li> |
|---|
| 38 |
<% |
|---|
| 39 |
} |
|---|
| 40 |
} // end if |
|---|
| 41 |
%> |
|---|
| 42 |
</ul> |
|---|
| 43 |
<input type="button" value="설문목록" onclick="document.location.href='list.jsp'"> |
|---|
| 44 |
|
|---|
| 45 |
</body> |
|---|
| 46 |
</html> |
|---|