root/okpoll/WebContent/view.jsp

리비전 5, 1.3 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 %>
13 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
14
15 <%@page import="net.okjsp.poll.Poll"%>
16 <%@page import="net.okjsp.poll.PollService"%>
17 <%@page import="java.util.ArrayList"%>
18 <%@page import="net.okjsp.poll.Item"%><html>
19 <head>
20 <meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
21 <title>설문보기</title>
22 </head>
23 <body>
24 <h1>설문보기</h1>
25 <h2>
26 Q : <%= poll.getQuestion() %>
27 </h2>
28 <form action="vote.jsp" method="post">
29 <input type="hidden" name="pollId" value="<%= pollId %>">
30 <ul>
31 <%
32         if (items != null)
33                 for(Item item : items){
34 %>             
35         <li><input type="radio" name="itemId" id="i<%= item.getId() %>" value="<%= item.getId() %>">
36         <label for="i<%= item.getId() %>"><%= item.getLabel() %></label>
37         </li>
38 <%
39                 }
40 %>
41 </ul>
42 <input type="submit" value="참여하기">
43 <input type="button" value="결과보기" onclick="document.location.href='report.jsp?pollId=<%= poll.getId() %>'">
44 </form>
45 </body>
46 </html>
참고: 소스 브라우저를 사용하면서 도움이 필요하다면, TracBrowser를 참고하십시오.