Apache Tomcat
About JSP
JSP : Java Server Pages JSP is Server Side Java Stack. HTML内に処理を記述(埋め込み)可能。
file:DebugJSP.jsp
<?xml version="1.0" encoding="UTF-8" ?> <%@ page language="java" %> <%@ page contentType="text/html; charset=UTF-8" %> <%@ page pageEncoding="UTF-8" %> <%@ page import="java.util.*" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml/DTD/xhtml-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Debug</title> </head> <body> Tomcat JSP example
<%@ include file="include.jsp" %> <%! // for declare String strMsg = "DebugMessage"; String getMsg() { return strMsg; } %> <% Calendar cal = new GregorianCalendar(); out.println( cal.get(GregorianCalendar.HOUR_OF_DAY)); out.println(":"): out.println(cal.get(GregorianCalendar.MINUTE)); %> <br> <% out.println(getMsg()); %> <% Map<String, Object> map = new HashMap<String, Object>(); map.put("ID", "001"); map.put("Name", "testuser001"); pageContext.setAttribute("uinfo", map); %> <br> <!-- EL --%gt ${ uinfo.ID }, ${ uinfo.Name } </body> </html>
file:include.jsp
<%@ page contentType="text/html; charset=UTF-8" %> Included<br>
Azure WebApps Java環境にて
Azure WebAppsはデフォルト構成では WindowsOSのため(D:\home\site\webapps\ROOT) ※無償で利用可能!! 色々試せるので利用を推奨