02_08 JSP内置对象之Web安全性及config对象

一、web安全性

1.放在WEB-INF文件夹上的文件是无法被用户所见,若用户需要访问,则需要通过映射的方式。

<%@ page contentType="text/html" pageEncoding="GBK"%>
<html>
<head>
	<title>include</title>
</head>
<body>
	<h2><%="hello"%></h2>
</body>
</html>

hello.jsp放在虚拟目录的WEB-INF文件夹中

并改WEB-INF/web.xml文件

增加语句:

<servlet>

         <servlet-name>he</servlet-name>

         <jsp-file>/WEB-INF/hello.jsp</jsp-file>

  </servlet>

  <servlet-mapping>

         <servlet-name>he</servlet-name>

         <url-pattern>/hello.mldn</url-pattern>

  </servlet-mapping>

输入地址:http://localhost/newudbful/hello.mldn即可访问。

 

二、config对象



以上内容参考JAVAWEB开发实战经典(名师讲坛)


你可能感兴趣的:(WEB安全性)