[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" %>
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" %>
댓글
댓글 쓰기