JSP/SERVLET
2020.01.28 / 24:51

aű׿¡¼­ Àμö¸¦ post ¹æ½ÄÀ¸·Î º¸³»´Â ¹æ¹ý

±îÄ¡¼³³¯
Ãßõ ¼ö 228

aű׿¡¼­ Àμö¸¦ post ¹æ½ÄÀ¸·Î º¸³»´Â ¹æ¹ý

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>aÅÂ±× form Àü¼Û</title>
    <script>
    // content, cate, index¸¦ Àμö·Î ¹Þ¾Æ form ű׷ΠÀü¼ÛÇÏ´Â ÇÔ¼ö
    function goPage(content, cate, index = 0) {
      // nameÀÌ pagingÀΠű×
      var f = document.paging;

      // form ű×ÀÇ ÇÏÀ§ ÅÂ±× °ª ¸Å°³ º¯¼ö·Î ´ëÀÔ
      f.content.value = content;
      f.cate.value = cate;
      f.index.value = index;

      // inputű×ÀÇ °ªµéÀ» Àü¼ÛÇÏ´Â ÁÖ¼Ò
      f.action = "./content.do"

      // Àü¼Û ¹æ½Ä : post
      f.method = "post"
      f.submit();
    };
    </script>
  </head>
  <body>
    <!-- ÆäÀÌÁö Àü¼Û Æû -->
    <form name="paging">
    	<input type="hidden" name="content"/>
    	<input type="hidden" name="index"/>
    	<input type="hidden" name="cate"/>
    </form>
    <!-- aű׷ΠÀμö Àü´Þ -->
    <a href="javascript:goPage('look', 'observation', 1);">°ü¶÷</a>
  </body>
</html>