EL 표현식의 페이지Context 억제된 객체 호출

3087 단어 context
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'PageContext.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
       <table border="1" align="center" >
           <tr>
               <td>PageContext </td>
               <td> </td>
               <td> </td>
           </tr>
           <tr>
               <td>\${pageContext.request.queryString }</td>
               <td> </td>
               <td>${pageContext.request.queryString }</td>
           </tr>
           <tr>
               <td>\${pageContext.request.requestURL }</td>
               <td> , </td>
               <td>${pageContext.request.requestURL }</td>
           </tr>
           <tr>
               <td>\${pageContext.request.contextPath }</td>
               <td>web </td>
               <td>${pageContext.request.contextPath }</td>
           </tr>
           <tr>
               <td>\${pageContext.request.method }</td>
               <td> http (get post)</td>
               <td>${pageContext.request.method }</td>
           </tr>
           <tr>
               <td>\${pageContext.request.remoteAddr }</td>
               <td> IP </td>
               <td>${pageContext.request.remoteAddr }</td>
           </tr>
           <tr>
               <td>\${pageContext.session.id }</td>
               <td> session id </td>
               <td>${pageContext.session.id }</td>
           </tr>
           
       </table>
  </body>
</html>

좋은 웹페이지 즐겨찾기