jsp의 소스는 이렇습니다, 제가 짠 소스가 아니라 이미 있는 소스이고 이것을 안드로이드에서
로그인을 하고 다음페이지의 데이터를 파싱해서 사용을 하려합니다.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ko">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr" />
<title>그룹 스터디룸 관리 시스템 CMS v1 User Login Page</title>
<style type="text/css">
<!--
.style2 {
font-size: 9pt;
font-family: Verdana, Arial, Helvetica, sans-serif;
color: #555555;
padding-top: 40px;
}
.style3 {font-size: 8pt}
.signin {
padding-top: 10px;
}
-->
</style>
<script>
function gofocus() {
document.form1.user_id.focus();
}
</script>
</head>
<body onload="gofocus()">
<div style="padding-top:100px">
<table border="0" align="center" cellpadding="0" cellspacing="0" style="background:url(/user/img/login_bg_s.gif) no-repeat top left; ">
<form name="form1" method="post" action="/user/inc/login_action.asp">
<tr>
<td width="440" height="300" valign=top > </td>
<td width=204 ><!-- ***아이디 패스워드 시작*** -->
<div class="style2" id="idpass" >
Log-in Name<br/>
<input name="user_id" type="text" size="20" value="" style="ime-mode:disabled"> <br/>
Password<br/>
<input name="user_pw" type="password" size="20" style="ime-mode:disabled">
<div class="signin">
<p><input type="image" src="./img/btn_signin_off.gif" border="0"
onmouseover="this.src='./img/btn_signin_on.gif" onmouseout="this.src='./img/btn_signin_off.gif" />
</p>
<input name="idcheck" type="hidden" value="Y">
<!--p>
<input name="idcheck" type="hidden" value="Y" />
<label for="remember" class="style3"> ID 저장 </label>
</p-->
</div>
</div>
<!-- ***아이디 패스워드 끝 *** -->
</td>
</tr>
</form>
</table>
</div>
</body>
</html>
대충 이런정도이고
제가 해본 방법은
URL url = new URL("http://210.125.155.19:8080/user/inc/login_action.asp);
HttpURLConnection httpURLCon = (HttpURLConnection)url.openConnection();
httpURLCon.setDefaultUseCaches(false);
httpURLCon.setDoInput(true);
httpURLCon.setDoOutput(true);
httpURLCon.setRequestMethod("POST");
httpURLCon.setRequestProperty("content-type", "application/x-www-form-urlencoded");
StringBuffer sb = new StringBuffer();
sb.append("user_id").append("=").append("1234").append("&");
sb.append("user_pw").append("=").append("123");
PrintWriter pw = new PrintWriter(new OutputStreamWriter(httpURLCon.getOutputStream(), "EUC-KR"));
pw.write(sb.toString());
pw.flush();
Toast.makeText(this, "?? : " + sb.toString(), Toast.LENGTH_SHORT)
.show();
이런식으로 접근하면 되는 거에요?
현재 계속해보고는 있지만 확신이 안들어서 여기에 질문을 합니다.
꼭 답변해주세요,,ㅠㅠㅠ



