결과화

 

 

 

package com.example.hellow;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class IntentUseActivity extends Activity{
 //암시적 Intent 사용 예제...
 @Override
 protected void onCreate(Bundle savedInstanceState) {
  // TODO Auto-generated method stub
  super.onCreate(savedInstanceState);
  setContentView(R.layout.intent_use1);
  
  final EditText phone = (EditText)findViewById(R.id.phone);
  Button call = (Button)findViewById(R.id.call);
  
  call.setOnClickListener(new View.OnClickListener() {
   
   @Override
   public void onClick(View v) {
    String phoneNumber = phone.getText().toString();
    
    Intent intent = new Intent();
    intent.setAction(android.content.Intent.ACTION_DIAL);
    intent.setData(Uri.parse("tel:" + phoneNumber));
    startActivity(intent);
   }
  });
 }

 

-------------------------------------------------------------------------------------------------

 

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >
<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal" >
   
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="전화번호 : " />

    <EditText
        android:id="@+id/phone"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="01012349999">
        <requestFocus />
    </EditText>
</LinearLayout>

    <Button
        android:id="@+id/call"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="전화걸기" />

</LinearLayout>

windows 7 에서 텔넷을 이용해서

안드로이드 예뮬레이터에서 배터리 수치를 변경할수 있다.

 

 

텔넷 설치방법....

제어판 -> 프로그램 및 기능 -> windows 기능 사용/ 사용 안함 메뉴 클릭 -> 텔넷 클라이언트 체크 후 확인

 

 

▶텔넷 설치후 배터리 수치 변경하기...

cmd창에서

1. telnet localhost [포트번호..]

 

2. ex) power capacity 100 //100으로 배터리 수치 변경..

        power capacity 65 //65으로 배터리 수치 변경..

 

MainActivity

 package com.example.hellow;

import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.BatteryManager;
import android.os.Bundle;
import android.widget.TextView;

public class MainActivity extends Activity {
 TextView plugged;
 TextView status;
 TextView level;

 private BroadcastReceiver receiver = new BroadcastReceiver(){
  private Intent intent;
  public void onReceive(Context context, Intent intent){
   this.intent = intent;
   plugged.setText(getPlugged());
   status.setText(getStatus());
   level.setText(getLevel());

  }

  public String getPlugged(){
   int plug = intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, 0);
   String pluggedStr = "";
   switch(plug){
   case BatteryManager.BATTERY_PLUGGED_AC :
    pluggedStr = "BATTERY_PLUGGED_AC";
    break;
    
   case BatteryManager.BATTERY_PLUGGED_USB :
    pluggedStr = "BATTERY_PLUGGED_USB";
    break;
   } return pluggedStr;
  }

  public String getStatus(){
   int plug = intent.getIntExtra(BatteryManager.EXTRA_STATUS, 0);
   String statusStr = "";
   switch(plug){
   case BatteryManager.BATTERY_STATUS_CHARGING :
    statusStr = "BATTERY_STATUS_CHARGING";
    break;
   case BatteryManager.BATTERY_STATUS_DISCHARGING :
    statusStr = "BATTERY_STATUS_DISCHARGING";
    break;
   case BatteryManager.BATTERY_STATUS_UNKNOWN :
    statusStr = "BATTERY_STATUS_UNKNOWN";
    break;
   case BatteryManager.BATTERY_STATUS_FULL :
    statusStr = "BATTERY_STATUS_FULL";
    break;
   case BatteryManager.BATTERY_STATUS_NOT_CHARGING :
    statusStr = "BATTERY_STATUS_NOT_CHARGING";
    break;
   } return statusStr;

  }

  public String getLevel(){
   int lv = intent.getIntExtra(BatteryManager.EXTRA_LEVEL, 0);
   String levelStr = "" + lv + "%";
   return levelStr;

  }

 };

 @Override
 protected void onCreate(Bundle savedInstanceState) {
  // TODO Auto-generated method stub
  super.onCreate(savedInstanceState);
  setContentView(R.layout.batterystatus);
  plugged = (TextView)findViewById(R.id.txt_plugged);
  status = (TextView)findViewById(R.id.txt_status);
  level = (TextView)findViewById(R.id.txt_level);
  
  //브로드캐스트 리시버를 등록
  //첫번째 방법. manifest.xml에 등록
  //두번째 방법. activity에서 registerReceiver() 등록
  
  //배터리 상태가 변경되면
  registerReceiver(receiver, new IntentFilter(Intent.ACTION_BATTERY_CHANGED));
  
  
 }

 @Override
 protected void onStop() {
  // TODO Auto-generated method stub
  super.onStop();
  unregisterReceiver(receiver);
 }


}

 

-----------------------------------------------------------------------------------------------

batterystatus.xml

 

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <TextView
        android:id="@+id/txt_plugged"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

    <TextView
        android:id="@+id/txt_status"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

    <TextView
        android:id="@+id/txt_level"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

</LinearLayout>

 

1. http://www.servlets.com/ 접속

2. 왼쪽 메뉴에서 3번째 - com.oreilly.servlet 클릭!!!

3. cos-26Dec2008.zip  맨밑에 다운!!

4. 압축을 푼다!

5. lib 폴더에 있는 cos.jar 를 이클립스의 WEB-INF의 lib에 넣어준다!!!

 

밑에 두개의 jsp 파일을 실행하면 오류가 난다. 그 이유는

 

fileUpload.jsp에서

 

//파일이 업로드되는 폴더를 지정한다.
 String saveFolder = "fileSave";

 

이렇게 되어 있기 때문에 fileSave 폴더를 만들어야 합니다.

 

어디에 만드냐구요?

 

 

the realpath is : 블라블라~~

 

fileSelect.jsp를 실행후 the realpath is : 블라블라~~

 

[블라블라~~] 경로에 만들어 줘야 합니다.

 

fileSelect.jsp

 <%@ page  contentType="text/html; charset=utf-8"  %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head><title>파일 업로드 예제</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<form name="fileForm" method="post" enctype="multipart/form-data"
action="fileUpload.jsp">

  <table width="450" border="1" align="center" bordercolordark="#FF9900" cellspacing="0" cellpadding="5">
    <tr bgcolor="#ffcc00">
    <td colspan="2" height="21">
      <div align="center"><b><font size="2">파일 업로드 예제</font></b></div>
    </td>
  </tr>
  <tr bgcolor="#FFff99">
      <td> 작성자</td>
      <td> <b>         <input type="text" name="user" size=30>    </b> </td>
  </tr>
  <tr bgcolor="#FFff99">
      <td> 제  목</td>
      <td>         <input type="text" name="title" size=30>      </td>
  </tr>
  <tr bgcolor="#FFff99">
      <td> 파일명</td>
      <td>         <input type="file" name="uploadFile" size=30>      </td>
  </tr>
  <tr bgcolor="#FFff99">
    <td height="42" colspan="2">
      <div align="center">
        <input type="submit" name="Submit" value="파일 올리기">
      </div>
    </td>
  </tr>
</table>
</form>
</body>
</html>

 

 

fileUpload.jsp

 <%@page import="java.io.File"%>
<%@page import="java.util.Enumeration"%>
<%@page import="com.oreilly.servlet.multipart.DefaultFileRenamePolicy"%>
<%@page import="com.oreilly.servlet.MultipartRequest"%>
<%@page import="java.io.IOException"%>
<%@ page contentType="text/html; charset=utf-8"%>
<%
 String realFolder = ""; //웹 어플리케이션의 절대 경로
 
 //파일이 업로드되는 폴더를 지정한다.
 String saveFolder = "fileSave";
 String encType = "utf-8"; //엔코딩타입
 int maxSize = 5 * 1024 * 1024; //최대 업로드 될 파일크기 5mb
 
 ServletContext context = getServletContext();
 
 //현재 jsp페이지의 웹 어플리케이션상의 절대 경로를 구한다.
 realFolder = context.getRealPath(saveFolder);
 out.println("the realpath is : " + realFolder + "<br>");
 
 try{
  MultipartRequest multi = null;
  //전송을 담당할 콤포넌트를 생성하고 파일을 전송한다.
  //전송할 파일명을 가지고 있는 객체, 서버상의 절대경로,
  //최대 업로드될 파일크기, 문자크도, 기본 보안 적용
  multi = new MultipartRequest(request, realFolder, maxSize, encType, new DefaultFileRenamePolicy());
  
  //form의 파라미터 목록을 가져온다.
  Enumeration params = multi.getParameterNames();
  
  //파라미터를 출력한다.
  while(params.hasMoreElements()){
   String name = (String)params.nextElement(); //전송되는 파라미터 이름
   String value = multi.getParameter(name); //전송되는 파라미터 값
   out.println(name + " = " + value + "<br>");
  }
  
  out.println("-----------------------------------------------<br>");
  
  //전송할 파일 정보를 가져와 출력한다.
  Enumeration files = multi.getFileNames();
  //파일 정보가 있다면
  while(files.hasMoreElements()){
   //input 태그의 속성이 file인 태그의 name 속성값 : 파라미터 이름
   String name = (String)files.nextElement();
  
   //서버에 저장된 파일 이름
   String filename = multi.getFilesystemName(name);
   
   //전송전 원래의 파일 이름
   String original = multi.getOriginalFileName(name);
   
   //전송된 파일의 내용 타입
   String type = multi.getContentType(name);
   
   //전송된 파일 속성이 file인 태그의 name 속성값을 이용해 파일 객체 생성
   File file = multi.getFile(name);
   
   out.println("파라미터 이름 : " + name + "<br>");
   out.println("실제 파일 이름 : " + original + "<br>");
   out.println("저장된 파일 이름 : " + filename + "<br>");
   out.println("파일 타입: " + type + "<br>");
   
   if(file != null){
    out.println("크기 : " + file.length());
    out.println("<br>");
   }
  }
 }catch(IOException ioe){
  System.out.println(ioe);
 }catch(Exception e){
  System.out.println(e);
 }
%>

 

1. 학사정보와 수납정보가 불일치 합니다.
2. 학사정보가 수납원장의 정보가 같은지 확인하시기 바랍니다.
(재단 및 대학에 문의바랍니다.)

 

 

대학교 등록금 납부기간에 지급신청 버튼을 눌러야 합니다!!!!

JSTL은 Jsp Standart Tag Library
(프로그래밍 기능) 자바 클래스를 태그와 매핑해서 사용하던 커스텀 태그중에서
많이 사용되는 것을 모아놓은것.

 

▶ 라이브러리 어디서 받나?
http://jakarta.apache.org/ -> Taglibs -> Apache Standard Taglib, -> download -> binaries/ -> 버전.ZIP

   받고 나서 압축을 풀고 -> lib -> jstl.jar, standard.jar 를 이클립스의 프로젝트/WebContent/WEB_INF/lib

   에 넣어 주자..

 

 샘플 예제1

Member.java

 

package com.web4.model;

public class Member {
 private String name;

 public String getName() {
  return name;
 }

 public void setName(String name) {
  this.name = name;
 }
}

 

--------------------------------------------------------------------------------------------------

 

<%@ page import="java.util.HashMap"%>
<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<jsp:useBean id="member" class="com.web4.model.Member" />

<%
 HashMap<String, String> pref = new HashMap<String, String>();
%>
<html>
<head>
<title>표준 태그 라이브러리(JSTL) 예제</title>
</head>
<body>
<pre>
JSTL은 Jsp Standart Tag Library
(프로그래밍 기능) 자바 클래스를 태그와 매핑해서 사용하던 커스텀 태그중에서
많이 사용되는 것을 모아놓은것.

라이브러리 어디서 받나?
http://jakarta.apache.org/ -> Taglibs -> Apache Standard Taglib, -> download -> binaries/ -> 버전.ZIP

받고 나서 압축을 풀고 -> lib -> jstl.jar, standard.jar 를 이클립스의 프로젝트/WebContent/WEB_INF/lib에 넣어주자..
</pre>


예제1 시작!!!<br><br><br>

<c:set var="member" value="<%= member %>" />
<c:set target="${member}" property="name" value="사용자" />

<c:set var="pref" value="<%= pref %>" />
<c:set var="favoriteColor" value="${pref.color}" />

회원 이름 : ${member.name}<br>
좋아하는 색 : ${favoriteColor}


<br/>
<c:set target="${pref}" property="color" value="red" />
<c:set var="favoriteColor" value="${pref.color}" />
설정 이후 좋아하는 색 : ${favoriteColor}
</body>
</html> 

 

 

 샘플 예제2 - IF문

 <%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<html>
<head>
<title>표준 태그 라이브러리(JSTL) 예제 IF</title>
</head>
<body>
<pre>
JSTL은 Jsp Standart Tag Library
(프로그래밍 기능) 자바 클래스를 태그와 매핑해서 사용하던 커스텀 태그중에서
많이 사용되는 것을 모아놓은것.

라이브러리 어디서 받나?
http://jakarta.apache.org/ -> Taglibs -> Apache Standard Taglib, -> download -> binaries/ -> 버전.ZIP

받고 나서 압축을 풀고 -> lib -> jstl.jar, standard.jar 를 이클립스의 프로젝트/WebContent/WEB_INF/lib에 넣어주자..
</pre>


예제2 (IF문) 시작!!!<br><br><br>

<c:if test='true'>
무조건 수행<br>
</c:if>


<c:if test="${param.name =='bk'}">
name 파라미터의 값이 ${param.name} 입니다.<br>
</c:if>


<c:if test="${18 < param.age}">
당신의 나이는 18세 이상입니다.
</c:if>

</body>
</html>

 

 

 샘플 예제3 - choose문

 <%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<html>
<head>
<title>표준 태그 라이브러리(JSTL) 예제 CHOOSE</title>
</head>
<body>
예제3 (CHOOSE문) 시작!!!<br><br><br>

<ul>
 <c:choose>
  <c:when test="${param.name == 'bk'}">
  <li>당신의 이름은 ${param.name} 입니다.</li>
  </c:when>
  <c:when test="${param.age > 20}">
  <li>당신의 20세 이상입니다.</li>
  </c:when>
  
  <c:otherwise>
  <li>당신은 'bk'가 아니고 20세 이상이 아닙니다.</li>
  </c:otherwise>
 </c:choose>
</ul>

</body>
</html>

 

 

 샘플 예제4 - forEach문

 <%@page import="java.util.HashMap"%>
<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
 HashMap<String, Object> mapData = new HashMap<String, Object>();
 mapData.put("name", "사용자");
 mapData.put("today", new java.util.Date());
%>
<c:set var="intArray" value="<%= new int[] {1,2,3,4,5} %>" />
<c:set var="map" value="<%= mapData %>" />

<html>
<head>
<title>표준 태그 라이브러리(JSTL) 예제 FOREACH</title>
</head>
<body>
예제4 (FOREACH문) 시작!!!<br><br><br>
<h4>1부터 100까지 홀수의 합</h4>
<c:set var="sum" value="0"/>

<c:forEach var="i" begin="1" end="100" step="2">
 <c:set var="sum" value="${sum+i}" />
</c:forEach>
결과 = ${sum}
<br>

<h4>구구단 : 4단</h4>
<ul>
 <c:forEach var="i" begin="1" end="9">
  <li>4 * ${i} = ${4*i}
 </c:forEach>
</ul>
<br>

<h4>int형 배열</h4>
<c:forEach var="i" items="${intArray}" begin="2" end="4" varStatus="status">
 ${status.index} - ${status.count} - [${i}] <br />
</c:forEach>
<br>

<h4>Map</h4>
<c:forEach var="i" items="${map}">
 ${i.key} = ${i.value}<br>
</c:forEach>


</body>
</html>

 

 

 샘플 예제5 - forTokens문

 <%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
<title>표준 태그 라이브러리(JSTL) 예제 forTokens</title>
</head>
<body>
예제5 (forTokens문) 시작!!!<br><br><br>
콤마와 점을 구분자로 사용:<br>
<c:forTokens var="token" items="빨강색,주황색.노란색.초록색,파랑색,남색.보라색" delims=",">
 ${token}
</c:forTokens>

</body>
</html>

 

 샘플 예제6 - url문

 <%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
<title>표준 태그 라이브러리(JSTL) 예제 url</title>
</head>
<body>
예제6 (url문) 시작!!!<br><br><br>

<c:url value="http://search.daum.net/search" var="daum">
 <c:param name="w" value="blog"/>
 <c:param name="q" value="박지성"/>
</c:url>

<ul>
 <li>${daum}</li>
 <li><c:url value="/jstlEx1.jsp" /></li>
 <li><c:url value="./jstlEx1.jsp" /></li>
</ul>

</body>
</html>

 

샘플 예제7 - import문

<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<% request.setCharacterEncoding("utf-8"); %>
<html>
<head>
<title>표준 태그 라이브러리(JSTL) 예제 import</title>
</head>
<body>
예제7 (import문) 시작!!!<br><br><br>

<c:choose>
 <c:when test="${param.type == 'flickr'}">
  <c:import url="http://www.flickr.com/search/">
   <c:param name="f" value="hp"/>
   <c:param name="q" value="보라매공원"/>
  </c:import>
 </c:when>
 <c:when test="${param.type == 'youtube'}">
  <c:import url="http://www.youtube.com/results/">
   <c:param name="search_query" value="보라매공원"/>
  </c:import>
 </c:when>
 <c:otherwise>
  <c:import url="jstlEx1.jsp">
   <c:param name="message" value="선택헤주세요."/>
  </c:import>
 </c:otherwise> 
</c:choose>

</body>
</html>

Expression Language : Script언어
표현식보다 간결하게 사용
EL은 JSP의 기본 문법을 보완

 

 샘플 코드 1

<%@page import="java.util.HashMap"%>
<%@ page contentType="text/html; charset=utf-8"%>
<% request.setAttribute("name", "JSP 프로그래밍"); %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>Insert title here</title>
</head>
<body>
<%= (5+3)%7 %>
<pre>
Expression Language : Script언어
표현식보다 간결하게 사용
EL은 JSP의 기본 문법을 보완

EL은 자료 타입, 수치 연산자, 논리 연산자, 비교 연산자 등을 제공합니다.
</pre>

요청 URI : <%= request.getRequestURI() %><br>
${pageContext.request.requestURI}<br>
request의 name속성 : <%= request.getAttribute("name") %><br>
${requestScope.name}<br>

code 파리미터의 값 : <%= request.getParameter("code") %><br>
${param.code}<br><br><br>

<%
 String st = null;
 int[] array = new int[0];
 HashMap<String, String> map = new HashMap<String, String>();
%>
empty st : ${empty st}<br>
empty "" : ${empty ""}<br>
empty array : ${empty array}<br>
empty map : ${empty map}<br>
</body>
</html>

 

 

 샘플 코드 2 - (표현 언어에서 객체의 메서드 호출) 

Thermometer.java

 

package com.web4.model;

import java.util.HashMap;
import java.util.Map;

public class Thermometer {
 private Map<String, Double> locationCelsiusMap = new HashMap<String, Double>();
 
 public void setCelsius(String location, Double value){
  locationCelsiusMap.put(location, value);
 }
 
 public Double getCelsius(String location){
  return locationCelsiusMap.get(location);
 }
 
 public Double getFahrenheit(String location){
  Double celsius = getCelsius(location);
  if(celsius == null){
   return null;
  }
  return celsius.doubleValue() * 1.8 + 32.0;
 }
 
 public String getInfo(){
  return "온도계 변환기 1.1";
 }
}

 

--------------------------------------------------------------------------------------------------

 

thermometer.jsp

 

 

<%@page import="com.web4.model.Thermometer"%>
<%@ page contentType="text/html; charset=utf-8"%>
<%
 Thermometer thermometer = new Thermometer();
 request.setAttribute("t", thermometer);
%>
<html>
<head>
<title>온도 변환 예제</title>
</head>
<body>
${t.setCelsius('서울', 27.3)}
서울 온도 : 섭씨 ${t.getCelsius('서울')}도 / 화씨 ${t.getFahrenheit('서울')}

<br/>

정보 : &{t.info}
</body>
</html>

<jsp:include> 액션 태그의 기본 사용 방법은 다음과 같다.

 

<jsp:include page="포함할 페이지" flush="false"/>

 

▶page - 포함할 jsp페이지

flush - 지정한 jsp페이지를 실행하기 전에 출력 버퍼를 플러시 할지의 여부를 지정한다. true이면 출력 버퍼를 플러시하고, false이면 하지 않는다.

 

 

샘플코드

 

 main.jsp

 <%@ page contentType="text/html; charset=utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>main.jsp</title>
</head>
<body>
 <jsp:include page="sub.jsp" flush="false"/>
 
 include 이후의 내용
</body>
</html>

 

 sub.jsp

 <%@ page contentType="text/html; charset=utf-8"%>
<br>
sub.jsp에서 생성한 내용
<br>

 

 

결과화면

 

package com.shop.controller;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.shop.model.joinDAO;

@WebServlet("/join.do")
public class joinProcessServlet extends HttpServlet {
 private static final long serialVersionUID = 1L;

    public joinProcessServlet() {
        super();
    }

 protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  //요청 처리후 응답을 위한 마임타입과 문자셋 설정
  response.setContentType("text/html;charset=utf-8");
  //응답 결과를 클라이언트에게 보내기 위해서 문자스트림을 생성
  PrintWriter out = response.getWriter();
  String cmd = request.getParameter("command");
  if(cmd.equals("idcheck")){
   idCheck(request, response);
  } else {
   joinProc(request, response);
  }
 }
 
 joinDAO dao;
 
 protected void idCheck(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  response.setContentType("text/html;charset=utf-8");
  PrintWriter out = response.getWriter();
  dao = new joinDAO();
  String uid = request.getParameter("userid");
  boolean success = dao.dupIdCheck(uid);
  if(dao.dupIdCheck(uid)){
   out.println("이미 사용중인 아이디입니다.");
  } else {
   out.println("사용 가능한 아이디입니다.");
  }
 }
 
 protected void joinProc(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  
 }
}

'2020년도 이전 > temp' 카테고리의 다른 글

html5 - 4번 예제  (1) 2013.08.30
안드로이드 8월 13일 xml  (0) 2013.08.13
joinDAO.java  (0) 2013.08.01
join_confirm --- 수정중!!  (0) 2013.07.31
서블릿 -- LoginServlet.java  (0) 2013.07.31

+ Recent posts