WEB/2020_webCamp

JSP : Scripting elements (Tag)

HBean_ 2020. 8. 5. 17:33

<JSP Scripting elements>

  • scriptlet tag <% java source code %> : 자바 소스 코드를 실행할 때 사용, 가장 많이 사용됨

 

  • expression tag <%= statement %> : 변수 또는 함수의 값을 출력할 때 사용, 따라서 out.print() 사용할 필요가 없다.
    • Ex. <%= "Welcome" + request.getParameter("name") %> -> 웹페이지에서  Welcome Kim 이 출력됨

 

  • declaration tag <%! field or method declaration %>: 변수 또는 메소드를 선언한다.
    • scriptlet tag와 차이점 :  method를 선언할 수 있고 declaration tag의 선언은 _jspService() method 밖에 위치한다.

 

 

 

https://www.javatpoint.com/jsp-scriptlet-tag

 

JSP Scriptlet tag - javatpoint

JSP Scriptlet tag with examples of session tracking, implicit objects, el, jstl, mvc, custom tags, file upload, file download, interview questions etc.

www.javatpoint.com