jsp的代碼
??? pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<!-- 定義的java代碼,在service方法中。service方法可以定義什么,該腳本就可以定義什么 -->
?? ?<%
?? ??? ?int i=5;
?? ??? ?System.out.println("中國加油");
?? ??? ?String contextPath=request.getContextPath();
?? ??? ?out.print(contextPath);
?? ?%>
?? ?
<!-- ?? ?用來定義成員變量和成員方法? -->
<!-- 定義的java代碼,在jsp轉(zhuǎn)換后類的成員位置 -->
?? ?<%!
?? ??? ?int i=3;
?? ?%>
<!-- ?? ?定義的java代碼會(huì)輸出到頁面上 -->
?? ?<%= i %>
?? ?<%response.getWriter().write("response............."); %>
</body>
</html>
標(biāo)簽: