리비전 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 |
request.setCharacterEncoding("euc-kr"); |
---|
5 |
|
---|
6 |
String question = request.getParameter("question"); |
---|
7 |
String[] items = request.getParameterValues("item"); |
---|
8 |
|
---|
9 |
ArrayList<Item> list = new ArrayList<Item>(); |
---|
10 |
for (int i=0; i<items.length; i++) { |
---|
11 |
Item item = new Item(); |
---|
12 |
item.setLabel(items[i]); |
---|
13 |
list.add(item); |
---|
14 |
} |
---|
15 |
Poll poll = new Poll(); |
---|
16 |
poll.setQuestion(question); |
---|
17 |
poll.setItems(list); |
---|
18 |
|
---|
19 |
int pollId = new PollService().add(poll); |
---|
20 |
%> |
---|
21 |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
---|
22 |
|
---|
23 |
<%@page import="net.okjsp.poll.Item"%> |
---|
24 |
<%@page import="java.util.ArrayList"%> |
---|
25 |
<%@page import="net.okjsp.poll.Poll"%> |
---|
26 |
<%@page import="net.okjsp.poll.PollService"%><html> |
---|
27 |
<head> |
---|
28 |
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR"> |
---|
29 |
<title>설문저장</title> |
---|
30 |
</head> |
---|
31 |
<body> |
---|
32 |
<h1 align="center" style="font-size:50px; color:#ff0000">설문저장</h1> |
---|
33 |
<h1 style="font-size:40px">* 설문이 등록되었습니다.</h1> |
---|
34 |
<form> |
---|
35 |
<input type="button" value="설문보기" |
---|
36 |
onclick="document.location.href='view.jsp?pollId=<%= pollId %>'"></input> |
---|
37 |
<input type="button" value="설문목록" |
---|
38 |
onclick="document.location.href='list.jsp'"></input> |
---|
39 |
</form> |
---|
40 |
</body> |
---|
41 |
</html> |
---|