get에 대해서...
미쁘다
수다님들 안녕하세요??
혹시 이곳에 jsp를 여쭤볼 수 있을 까 해서 글을 적어봅니다
jsp질문 하는 곳이 아니라면 정말 죄송합니다
부탁드릴게요
몇 시 간째 이러고 있어서 글을 적습니다
!doctype html public -//w3c//dtd html 4.01 transitional//en http://www.w3.org/tr/html4/loose.dtdhtmlheadmeta http-equiv=content-type content=text/html; charset=utf-8title문제/title/headbody form method=get action=servlet/answer 이순신 장군은 이름은??br 1. input type=radio name=no1 value=1이순신br 2. input type=radio name=no1 value=2라디오br 3. input type=radio name=no1 value=3이순신1br 라디오를 영어로??br 1. input type=radio name=no2 value=4radiobr 2. input type=radio name=no2 value=5radio1br 3. input type=radio name=no2 value=6radio2br 1+1은??br 1. input type=radio name=no3 value=72br 2. input type=radio name=no3 value=81br 3.input type=radio name=no3 value=912br 1+2는?br 1.input type=radio name=no4 value=103br 2.input type=radio name=no4 value=1111br 3.input type=radio name=no4 value=122br 1+3은?br 1.input type=radio name=no5 value=134br 2.input type=radio name=no5 value=141br 3.input type=radio name=no5 value=152br br br input type=submit value=정답 input type=reset value=취소 /form/body/html
import java.io.ioexception;import java.io.printwriter;
import javax.servlet.servletexception;import javax.servlet.http.httpservlet;import javax.servlet.http.httpservletrequest;import javax.servlet.http.httpservletresponse;
public class answer extends httpservlet{
@override protected void doget(httpservletrequest req, httpservletresponse resp) throws servletexception, ioexception { req.setcharacterencoding(utf-8); resp.setcontenttype(text/html;charset=utf-8); int count = 0; string result = req.getparameter(no1); string result2 = req.getparameter(no2); string result3 = req.getparameter(no3); string result4 = req.getparameter(no4); string result5 = req.getparameter(no5); string result6 = req.getparameter(value); printwriter out = resp.getwriter(); out.println(html); out.println(head); out.println(title 출력결과 /title); out.println(/head); out.println(body); if(result==no1 && result6==1){ count = count + 1; out.println(count); } if(result6==4){ count = count + 1; out.println(count); } if(result6==7){ count = count + 1; out.println.println(count); } if(result6==10){ count = count + 1; out.println(count); } if(result6==13){ count = count + 1; out.println(count); } out.println(정답은?? + count); out.println(/body); out.println(/html); }}
이렇게 했는데 count 값이 계속 0 이 나옵니다...ㅠㅠ
어떻게 해야 하는지 자문을 구해봅니다