Author Topic: telnet tomcat_ip_server 8080  (Read 3532 times)

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2140
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
telnet tomcat_ip_server 8080
« on: เมษายน 11, 2017, 08:41:19 AM »
ปกติเวลาเราลงใช้งาน tomcat server เพื่อให้รันไฟล์ java . jsp ได้นั้น
เราสามารถเทสจาก command telnet เพื่อเรียกดูไฟล์ jsp ได้ครับผม
เช่นตัวอย่าง tomcat_ip_server : 10.0.0.6 และทำการเรียกไฟล์ hello.jsp ถ้าเจอไฟล์ต้องแสดง status code : 200 ครับ
และปกติเวลาเรียกไฟล์นั้น ควรอัฟโหลดไฟล์ ลงไปที่ DocumentRoot ของ tomcat นะครับ เช่นอาจจะอยู่ที่ /opt/tomcat/webapps/ROOT

#telnet tomcat_ip_server 8080
Trying 10.0.0.6...
Connected to 10.0.0.6.
Escape character is '^]'.
GET /hello.jsp HTTP/1.0

HTTP/1.1 200
Set-Cookie: JSESSIONID=DE70468C5E756303D83Asswqrasdfasdfasd;path=/;HttpOnly
Content-Type: text/html;charset=ISO-8859-1
Content-Length: 449
Date: Tue, 11 Apr 2017 01:36:41 GMT
Connection: close

<html>
  <head>
    <title>Sample Application JSP Page</title>
  </head>

  <body bgcolor=white>

  <table border="0" cellpadding="10">
    <tr>
      <td align=center>
        <img src="images/springsource.png">
      </td>
      <td>
         <h1>Sample Application JSP Page</h1>
      </td>
    </tr>
  </table>

  <br />
  <p>This is the output of a JSP page that is part of the HelloWorld application by Packetlove.</p>

  Hello!

  </body>
</html>
Connection closed by foreign host.