[JSP] Tag

JSP has tags that are used in HTML script.

Normally it is called "Scriptlet", as may expected, when Java source is embedded in other platform, ~elt is coming after the word and combined.
Applet, Scriptlet, Servlet. Those are good examples.

Anyway, there are some frequently used Tags in JSP.

<% context %>
The normal tag and is called "Scriptlet"
It can be thought as "Java code inside between % codes".
And Scriptlet codes are interpreted, compiled at WAS before the JSP page is responded on Web Browser. That's why Scriptlet code is no where when you look up in HTML Source.

<%! context %>
This is called Declaration. This code is used when you declare any variable, method or anything you need to declare before you use.
<%! int i = 0; %>

<%@ context %>
This is called Directives. You can import Java library by using it, or even can include another JSP page inside the JSP that you are working on. Just like below.

<%@ page import=java.util.Arrays %> / <%@ include file="index.jsp" %>

댓글

이 블로그의 인기 게시물

로컬 Tomcat 서버 실행속도 개선

2019.05.23 - SQLAlchemy 의 객체 상태 관리 (expire, refresh, flush, commit) 에 관한 이해

2020.02.17 Python의 multiprocessing 중 Pool.map(), chunksize에 관한 내용