[Day2] JSP/Servlet 2 [12/5]

์ฐธ๊ณ ) https://javacpro.tistory.com/43

         ใ„ด JSP ๊ด€๋ จ ์„ค๋ช… ๋งํฌ 

 

db ์—ฐ๊ฒฐํ•ด์„œ ํ…Œ์ด๋ธ” select ํƒœ๊ทธ ์„ ํƒํ•˜๋ฉด table ํ˜•์‹์œผ๋กœ ๋ฐ˜ํ™˜ํ•˜๋Š” ์ฝ”๋”ฉ 

 

<form> action="" ์„œ๋ธŒ๋ฐ‹ X       ->   jquery Ajax  

   

    1) ์„ ํƒํ•œ ์˜ต์…˜์˜ selected ์†์„ฑ์„ ์„ค์ •ํ•˜๋ฉด๋œ๋‹ค. ( jquery )

<%
     // JSP ๊ธฐ๋ณธ ๊ฐ์ฒด (9๊ฐ€์ง€) : request ๊ฐ์ฒด : url ๊ฐ€์ ธ์˜ด. 
     String contextPath = request.getContextPath();
%>

 

 

<script>
  $("#selDept").change(function() {
	  // js    value, text
	  // jquery value, text
  	// ํผ ํƒœ๊ทธ ์—†์ด ์„œ๋ธŒ๋ฐ‹..  BOM-W,L,N,S,H
  	//                      "/jspPro"
  	location.href = "<%= contextPath %>/days02/test01.jsp?deptno=" + $(this).val();
  }); // change
</script>
<script>
   // 1์กฐ ์ฝ”๋”ฉ                         ?deptno=30
   // $("#selDept option[value=<%=pdeptno%>]").attr("selected", true);
   
   // $("#selDept").val( "<%=pdeptno%>" );
   
   // EL ?deptno=30
   // empty  EL ์—ฐ์‚ฐ์ž
   // param  EL ๊ธฐ๋ณธ ๊ฐ์ฒด
   $("#selDept").val( "${ empty param.deptno ? 10 :  param.deptno}" );
   
</script>
<script>
   // [ ์ „์ฒด ์„ ํƒ ๊ตฌํ˜„ ]
   //$("table thead :checkbox")
   $("#ckbAll").change( function (){
	   $("table tbody tr")
	                .find("td:first-child :checkbox")
	                .prop("checked",  $(this).prop("checked") );
   }); // change
</script>

<script>
   // "์„ ํƒํ•œ empno ํ™•์ธ" ๋ฒ„ํŠผ์„ ํด๋ฆญํ• ๋•Œ..
   $("#checkedEmpno").on("click" , function (){
	   
	   var empnos  = [];
	   
	   // $("table tbody :checkbox")  ๋ฐ˜๋ณต checked ํ™•์ธ
	   $("table tbody :checkbox[name=ckbEmp]:checked").each(function(i, element) {
	   	   // console.log( i  +  " /  " + element )
	   	   // DOM ํƒ์ƒ‰
	   	   // var empno =  $(this).parent().next().html();
	   	   //  <input type="checkbox"  name="ckbEmp"  data-empno="7369">
	   	   var empno = $(this).data("empno");
	   	   
	   	   // console.log( empno );
	   	   empnos.push( empno );
	   }); //  each
	   
	   // $("#demo").html(  "<ul><li>" + empnos.join("</li><li>")  + "</li></ul>"    ) ;
	   
	    // ์˜ˆ)
	    // location.href="<%= contextPath %>/days02/test01_ok.jsp?empno=7499&empno=7500&empno=8763";
	    
	    location.href="<%= contextPath %>/days02/test01_ok.jsp?empno=" + empnos.join("&empno=");
	   
   }); // click
</script>

* ํ•ด๋‹น ํŽ˜์ด์ง€์—์„œ ํด๋ฆญ์œผ๋กœ ํ•ด๋‹น ํŽ˜์ด์ง€ ํŒŒ๋ผ๋ฏธํ„ฐ ๋‚ ๋ ค์ฃผ๋Š” ๊ฒƒ ๊ฐ€๋Šฅ!

* ๋‹ค๋ฅธ ํŽ˜์ด์ง€๋กœ ๊ฐ’ ๋„˜๊ฒจ์ฃผ๋Š” ๊ฒƒ๋„ ๊ฐ€๋Šฅ!

(formํƒœ๊ทธ ์—†์ด)


์„œ๋ธ”๋ฆฟ(Servlet)

    1. ์„œ๋ธ”๋ฆฟ(Servlet) ์ด๋ž€? 

        ์ž๋ฐ” ์›น ๊ฐœ๋ฐœ ํ•„์ˆ˜ ์‚ฌํ•ญ.

        - JSP ํ‘œ์ค€์ด ๋‚˜์˜ค๊ธฐ ์ „์— ์ž๋ฐ” ์›น ๊ฐœ๋ฐœ์„ ์œ„ํ•ด์„œ ๋งŒ๋“ค์–ด์กŒ๋‹ค. 

        - ์„œ๋ธ”๋ฆฟ์„ ์ด์šฉํ•˜๋ฉด 

           "์ž๋ฐ” ํด๋ž˜์Šค" -> ์›น ๊ฐœ๋ฐœ.

           

    [2]. ์„œ๋ธ”๋ฆฟ ๊ตฌํ˜„ ๋ฐฉ๋ฒ•(๊ณผ์ •)

        1) [์„œ๋ธ”๋ฆฟ ๊ทœ์•ฝ]์— ๋”ฐ๋ผ ์ž๋ฐ” ํด๋ž˜์Šค ์ž‘์„ฑ(์„ ์–ธ) -- ???.java

            ใ„ฑ. ์ž๋ฐ” ํด๋ž˜์Šค์˜ ์ ‘๊ทผ ์ง€์ •์ž : public

            ใ„ด. javax.servlet.http.HttpServlet ํด๋ž˜์Šค ์ƒ์†

            ใ„ท. service(), get(), post() ๋ฉ”์„œ๋“œ๋ฅผ ์˜ค๋ฒ„๋ผ์ด๋”ฉ ํ•ด์•ผํ•œ๋‹ค.

 

        ์ดํด๋ฆฝ์Šค ๊ฐœ๋ฐœ 2+3 X

        2)  ???.java ์„ ์ปดํŒŒ์ผ ํ•ด์„œ ???.class ์ƒ์„ฑ ( ํด๋ž˜์ŠคํŒŒ์ผ )

        3)  ํด๋ž˜์Šค ํŒŒ์ผ์„   /WEB-INF/classes ํด๋”์— ์ด๋™.

        

        4)  

             ใ„ฑ. web.xml ํŒŒ์ผ์— ์„œ๋ธ”๋ฆฟ ํด๋ž˜์Šค๋ฅผ ์„ค์ •(๋“ฑ๋ก).

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

    ์˜ˆ) 

        1) ์„œ๋ธ”๋ฆฟ ๊ทœ์•ฝ์„ ๋”ฐ๋Š” ์ž๋ฐ” ํด๋ž˜์Šค ์„ ์–ธ 

           days02 ํŒจํ‚ค์ง€  + Now.java ์ถ”๊ฐ€

NOW

package days02;

import java.io.IOException;
import java.io.PrintWriter;
import java.text.SimpleDateFormat;
import java.util.Date;

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

public class Now extends HttpServlet{

	@Override
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		super.doGet(request, response);
	}

	@Override
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		super.doPost(request, response);
	}

	@Override
	protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
		response.setContentType("text/html; charset=UTF-8" );
		
		PrintWriter out = response.getWriter();
		out.println("<!DOCTYPE html>");
		out.println("<html>");
		out.println("<head>");
		out.println("<meta charset='UTF-8'>");
		out.println("<title>2022.12.05 ์„œ๋ธ”๋ฆฟ</title>");
		out.println("</head>");
		out.println("<body>");
		
		Date now = new Date();
		String pattern = "yyyy-MM-dd hh:mm:ss";
		SimpleDateFormat sdf = new SimpleDateFormat(pattern);
		String strNow = sdf.format(now);
		
		out.println("> ํ˜„์žฌ ๋‚ ์งœ, ์‹œ๊ฐ„ : " +  strNow);
		
		out.println("</body>");
		out.println("</html>");
	} // service

} // class

** alt shift s : ์˜ค๋ฒ„๋ผ์ด๋”ฉ -> do get, do post, service 

 

        2) web.xml   Now.java ์„œ๋ธ”๋ฆฟ ๋“ฑ๋ก.

  <!-- ์„œ๋ธ”๋ฆฟ ๋“ฑ๋ก + URL ๋งคํ•‘ ์„ค์ • -->
  <servlet>
    <description>ํ˜„์žฌ ๋‚ ์งœ,์‹œ๊ฐ„์„ ์‘๋‹ตํ•˜๋Š” ์ฒซ ๋ฒˆ์งธ ์„œ๋ธ”๋ฆฟ</description>
    <description>days02 ํŒจํ‚ค์ง€ ์„ ์–ธ๋œ ์„œ๋ธ”๋ฆฟ</description>
    <servlet-name>now</servlet-name>
    <servlet-class>days02.Now</servlet-class>
  </servlet>
  <servlet-mapping>
     <servlet-name>now</servlet-name>
     <!-- *** URL ํŒจํ„ด ๋งคํ•‘ ๊ทœ์น™ *** -->
     <!-- <url-pattern>http://localhost/jspPro/days02/now</url-pattern> -->     
     <url-pattern>/days02/now</url-pattern> 
     <url-pattern>/days02/now.htm</url-pattern> 
     <!-- <url-pattern>/test/now.ss</url-pattern> -->
     
      <!-- ์˜ฌ๋ฐ”๋ฅธ url ํŒจํ„ด์ด ์•„๋‹ˆ์˜ˆ์š”.  1/2/3/4  ํ•ด๋‹น๋˜์ง€ ์•Š๋Š”๋‹ค. -->
      <!-- <url-pattern>/test/*.ss</url-pattern> --> 
      <!-- <url-pattern>*.ss</url-pattern>  -->
      
     <!-- <url-pattern>/foo/bar/*</url-pattern>  -->
     <!-- <url-pattern>/baz/*</url-pattern>  -->
     <!-- <url-pattern>/catalog</url-pattern> --> 
     <!-- <url-pattern>*.bop</url-pattern>  -->     
  </servlet-mapping>

        3) ์„œ๋ธ”๋ฆฟ ๋งคํ•‘ ์„ค์ •

             ์š”์ฒญURL -> ์„œ๋ธ”๋ฆฟ ํ˜ธ์ถœ-> ์‘๋‹ต  

             http://localhost/jspPro[/days02/now]         ์š”์ฒญ

             http://localhost/jspPro[/days02/now.htm]  ์š”์ฒญ

 

 

 

<a href="http://localhost/jspPro/days02/now">now ์„œ๋ธ”๋ฆฟ ํ˜ธ์ถœ</a><br>
<a href="http://localhost/jspPro/days02/now.htm">now ์„œ๋ธ”๋ฆฟ ํ˜ธ์ถœ</a><br>
<!-- web.xml url-pattern ์„ค์ • -->
<a href="http://localhost/jspPro/test/now.ss">now ์„œ๋ธ”๋ฆฟ ํ˜ธ์ถœ</a><br>
<a href="http://localhost/jspPro/today.ss">now ์„œ๋ธ”๋ฆฟ ํ˜ธ์ถœ</a><br>

Now.java

response.setContentType("text/html; charset=UTF-8" );

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

             ใ„ด. ์„œ๋ธ”๋ฆฟ 3.0  @WebServlet ์–ด๋…ธํ…Œ์ด์…˜์„ ์‚ฌ์šฉํ•ด์„œ ๋“ฑ๋ก ๊ฐ€๋Šฅ.            

             (  tomcat8.5 ->  jsp2.3  servlet4.0 EL3.0  ) 

                 days02.Hello.java ์„œ๋ธ”๋ฆฟ ํด๋ž˜์Šค ์ƒ์„ฑ.

src-main-java-days02 - servlet ์ƒ์„ฑ 

package days02;

import java.io.IOException;
import java.io.PrintWriter;
import java.text.SimpleDateFormat;
import java.util.Date;

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

/**
 * Servlet implementation class Hello
 */
/*
@WebServlet(
		description = "@WebServlet ์–ด๋…ธํ…Œ์ด์…˜์œผ๋กœ ๋‘ ๋ฒˆ์งธ ์„œ๋ธ”๋ฆฟ", 
		urlPatterns = { 
				"/hello.htm", 
				"/hello.ss", 
				"/hello"
		})
*/		
public class Hello extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public Hello() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

		response.setContentType("text/html; charset=UTF-8" );
		
		PrintWriter out = response.getWriter();
		out.println("<!DOCTYPE html>");
		out.println("<html>");
		out.println("<head>");
		out.println("<meta charset='UTF-8'>");
		out.println("<title>2022.12.05 ์„œ๋ธ”๋ฆฟ</title>");
		out.println("</head>");
		out.println("<body>");
		 
		out.println("> ์ธ์‚ฌ : Hello~ "   );
		
		out.println("</body>");
		out.println("</html>");
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doGet(request, response);
	}

}
<!-- ์ฃผ์˜ :  -->
<!-- ๊ธฐ์–ต : Deployment Descriptor  - DDํŒŒ์ผ = web.xml -->
<hr>
<a href="http://localhost/jspPro/hello.ss">hello ์„œ๋ธ”๋ฆฟ ํ˜ธ์ถœ</a><br>
<a href="http://localhost/jspPro/hello.htm">hello ์„œ๋ธ”๋ฆฟ ํ˜ธ์ถœ</a><br>
<a href="http://localhost/jspPro/hello">hello ์„œ๋ธ”๋ฆฟ ํ˜ธ์ถœ</a><br>

* DDํŒŒ์ผ web.xml ์—์„œ ๋งตํ•‘ ํ™•์ธ ๊ฐ€๋Šฅ!

        5)  ํ†ฐ์บฃ ๋“ฑ์˜ ์ปจํ…Œ์ด๋„ˆ๋ฅผ ์‹คํ–‰( ์„œ๋ฒ„ ์žฌ ์‹œ์ž‘.)

        6) ์›น ๋ธŒ๋ผ์šฐ์ €์—์„œ ํ™•์ธ.

        

        

        ์„œ๋ธ”๋ฆฟ์€ jsp ๋ณด๋‹ค ๋ณต์žกํ•˜์ง€๋งŒ MVC ํŒจํ„ด์œผ๋กœ ๊ฐœ๋ฐœํ•  ๋•Œ๋Š” ์„œ๋ธ”๋ฆฟ ์ดํ•ด ๋ฐ˜๋“œ์‹œ

        ์žˆ์–ด์•ผ ๋œ๋‹ค. 

 

    [3]. ์„œ๋ธ”๋ฆฟ ๋งคํ•‘ ์„ค์ •

    4. ์ดˆ๊ธฐํ™” ํŒŒ๋ผ๋ฏธํ„ฐ

    [5]. URL ํŒจํ„ด ๋งคํ•‘ ๊ทœ์น™   p 514

        1)      / ์‹œ์ž‘         /* ๋

           ์˜ˆ)    /test/board/*

                    /days02/*

        2)   *. ์‹œ์ž‘     ํ™•์žฅ์ž์— ๋Œ€ํ•œ ๋งคํ•‘

               *.ํ™•์žฅ์ž๋ช…

           ์˜ˆ)    *.htm

                    *.ss

              

        3) ์˜ค์ง     /    ๋งŒ ์žˆ๋Š” ๊ฒฝ์šฐ.  ( ๊ธฐ๋ณธ ์„œ๋ธ”๋ฆฟ )

        

        4) ์œ„์˜ 1~3 ๊ฒฝ์šฐ์™ธ์—     ์ •ํ™•ํ•˜๊ฒŒ URL ๋งคํ•‘

            ์˜ˆ)       /days02/now.html

      


์„œ๋ธ”๋ฆฟ ์˜ˆ์ œ

 

   0. ex03.jsp

       ใ„ฑ. get     ์ด๋ฆ„/๋‚˜์ด -> Info ์„œ๋ธ”๋ฆฟ ํด๋ž˜์Šค ์ „๋‹ฌ

       ใ„ด. post   ์ด๋ฆ„/๋‚˜์ด -> Info ์„œ๋ธ”๋ฆฟ ํด๋ž˜์Šค ์ „๋‹ฌ

       

์„ค์ • (jquery, css)

<link rel="stylesheet" href="//code.jquery.com/ui/1.13.2/themes/base/jquery-ui.css">
<link rel="stylesheet" href="/resources/demos/style.css">
<script src="https://code.jquery.com/jquery-3.6.0.js"></script>
<script src="https://code.jquery.com/ui/1.13.2/jquery-ui.js"></script>

   1.  Info ์„œ๋ธ”๋ฆฟ ํด๋ž˜์Šค ์„ ์–ธ

   2.   /info

        /days02/info.htm

    

* a๋งํฌ ํƒœ๊ทธ -> ok jsp ๋กœ ์ด๋™

 

jspPro url ๊ฐ€์ ธ์˜ด

<%
    //         "/jspPro"
    String contextPath = request.getContextPath();
%>

 

1) ์ผ๋ฐ˜ get (servlet์—†์ด)

       ์ •์ˆ˜ : <input type="text" id="n" name="n" value="10"> <br>
       <a href="<%= contextPath %>/days02/ex03_ok.jsp">ex03_ok.jsp</a>
   $("#tabs-1  a").click(function() {
   	    // event.preventDefault();
   	    // 1๋ฒˆ
   	    /*
   	    var origHref =  $(this).attr("href");
   	   $(this).attr( "href" ,  origHref +"?n=" + $("#n").val()  );
   	   */
   	   
   	    // 2๋ฒˆ
   	    $(this).attr("href", function (i, origHref){
   	    	return origHref +"?n=" + $("#n").val();
   	    });
   });

 

2) get, post + servlet

      <form>
         Name : <input type="text" id="name" name="name" value="ํ™๊ธธ๋™"><br>
         Age : <input type="text" id="age" name="age" value="20"><br>      
         
         <input type="radio" name="method" value="get" checked="checked">GET ์š”์ฒญ
         <input type="radio" name="method" value="post" >POST ์š”์ฒญ
         <br>
           <!-- "/info", "/days02/info.htm" --> 
         <button type="button">์ „์†ก(submit)</button>
      </form>
   // ํƒญ-2 ์˜ ์ „์†ก๋ฒ„ํŠผ์„ ํด๋ฆญํ•  ๋•Œ...
   $("form button").on("click" , function (){
	   // ์ฒดํฌ๋œ ๋ผ๋””์˜ค ๋ฒ„ํŠผ
	   var method = $("#tabs-2 :radio:checked").val();
	   $("form")
	            .attr({
		                 //             /jspPro
					   "action":  "<%= contextPath %>/info"
					  , "method":	   method
				   })
	           .submit();
   });

servlet

package days02;

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;

/**
 * Servlet implementation class Info
 */
//@WebServlet({ "/info", "/days02/info.htm" })
public class Info extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public Info() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// Info ์„œ๋ธ”๋ฆฟ ์„ GET ๋ฐฉ์‹์œผ๋กœ ์š”์ฒญํ•  ๋•Œ ํ˜ธ์ถœ๋˜๋Š” ๋ฉ”์„œ๋“œ
		response.setContentType("text/html; charset=UTF-8");
		String name = request.getParameter("name");
		int age =  Integer.parseInt(  request.getParameter("age")   );
		
		// ์‘๋‹ต
		PrintWriter out =  response.getWriter();
		out
		   .append("GET ๋ฐฉ์‹ ์š”์ฒญ")
		   .append( request.getContextPath() +"<br>" )
		   .append( "> ์ด๋ฆ„ : " + name +"<br>" )
		   .append( "> ๋‚˜์ด : " + age +"<br>" );
		
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// Info ์„œ๋ธ”๋ฆฟ ์„ POST ๋ฐฉ์‹์œผ๋กœ ์š”์ฒญํ•  ๋•Œ ํ˜ธ์ถœ๋˜๋Š” ๋ฉ”์„œ๋“œ
		// > ์ด๋ฆ„ : íย™ยê¸¸ëยย™  -  ํ•œ๊ธ€ ๊นจ์ง€๋”๋ผ๊ณ ..
		
		// ํ†ฐ์บฃ(8) ์ธ์ฝ”๋”ฉ์„ ์„ค์ •ํ•˜์ง€ ์•Š์œผ๋ฉด -> GET    UTF-8
		//                                                     POST  ISO 8859-1
		// ํ™๊ธธ๋™-> ์š”์ฒญ->  íย™ยê¸¸ëยย™           ->  íย™ยê¸¸ëยย™ 
		// UTF-8            ISO 8859-1        UTF-8
		request.setCharacterEncoding("UTF-8");
		response.setContentType("text/html; charset=UTF-8");
		
		String name = request.getParameter("name");
		int age =  Integer.parseInt(  request.getParameter("age")   );
		
		// ์‘๋‹ต
		PrintWriter out =  response.getWriter();
		out
		   .append("POST ๋ฐฉ์‹ ์š”์ฒญ")
		   .append( request.getContextPath() +"<br>" )
		   .append( "> ์ด๋ฆ„ : " + name +"<br>" )
		   .append( "> ๋‚˜์ด : " + age +"<br>" );
	}

}

[ request ๊ฐ์ฒด]  p 72

   1. ์›น๋ธŒ๋ผ์šฐ์ € -> ์š”์ฒญ -> ์›น์„œ๋ฒ„

                       ์š”์ฒญ ์ •๋ณด ๊ฐ€์ง€๋Š” ๊ฐ์ฒด  request

   2. ํด๋ผ์ด์–ธํŠธ๊ฐ€  ์ „์†กํ•œ    ์ฟ ํ‚ค, ํ—ค๋”, ํŒŒ๋ผ๋ฏธํ„ฐ ์ •๋ณด ์ฝ๊ธฐ ๊ธฐ๋Šฅ

   3. ์„œ๋ฒ„์™€ ๊ด€๋ จ๋œ ์ •๋ณด ์ฝ๊ธฐ     

   

   //    js ์ฟ ํ‚ค : Cookie.js ํŒŒ์ผ ์ƒ์„ฑ,  document.cookie ์†์„ฑ               

 

 

ํด๋ผ์ด์–ธํŠธ + ์„œ๋ฒ„ ๊ด€๋ จ ์ •๋ณด ์ฝ๊ธฐ  ํ‘œ3.3 ( p 73 )

 

 *** 1.  contextPath(์ปจํ…์ŠคํŠธ ๋ฃจํŠธ) : <%= request.getContextPath() %><br>

 *** 2. ํด๋ผ์ด์–ธํŠธ IP ์ฃผ์†Œ : <%= request.getRemoteAddr() %><br>

 *** 3. ์š”์ฒญ ์ „์†ก ๋ฐฉ์‹ : <%= request.getMethod() %><br>

 *** 4. ์š”์ฒญ URL : <%= request.getRequestURL() %><br>

 *** 5. ์š”์ฒญ URI : <%= request.getRequestURI()  %><br>

  • ๋„ค์ด๋ฒ„ ๋ธ”๋Ÿฌ๊ทธ ๊ณต์œ ํ•˜๊ธฐ
  • ๋„ค์ด๋ฒ„ ๋ฐด๋“œ์— ๊ณต์œ ํ•˜๊ธฐ
  • ํŽ˜์ด์Šค๋ถ ๊ณต์œ ํ•˜๊ธฐ
  • ์นด์นด์˜ค์Šคํ† ๋ฆฌ ๊ณต์œ ํ•˜๊ธฐ