WEB-INF用户是不能访问到的,现在我想自己设置个文件夹,让用户不能访问,该如何实现
解决方案 »
- 使用insert语句向oracle中插入date类型数据报ORA-00917异常
- 为什么request.getPerameter()得不到hidden的值呢?(急)
- 报表导出excel表格的过程中,在展示给用户的页面上动态显示导出的状态,能做吗?
- 请教,怎样用jsp把全选的信息删除?
- JS如何把页面的值传到BEAN?
- 如何在页面中实现搜索功能
- ireport与jsp整合的问题???
- 高分求救,一个关于html的简单问题!!
- 使用struts从JSP输入中文数据乱码的问题
- 有关用JSP做语音聊天室
- mysql 一张表一列数据导入另一张表的一列中
- 很奇怪的问题!!!100分求解!!在线等!!!!!!!!
Tomcat_Homt\conf\tomcat-users.xml 文件内容如下,注意其中的employee和web.xml中的employee是对应的。
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<role rolename="tomcat"/>
<role rolename="employee"/>
<role rolename="buyc"/>
<role rolename="role1"/>
<role rolename="manager"/>
<role rolename="admin"/>
<user username="buyc" password="buyc" roles="buyc,employee"/>
</tomcat-users>
你的Webapp下WEB-INF\web.xml内容
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<description>
ShiFang Soft. OA
</description>
<!-- Security is active on entire directory -->
<security-constraint>
<display-name>Tomcat Server Configuration Security Constraint</display-name>
<web-resource-collection>
<web-resource-name>Protected Area</web-resource-name>
<!-- Define the context-relative URL(s) to be protected -->
<url-pattern>*.jsp</url-pattern>
<url-pattern>*.do</url-pattern>
<url-pattern>*.html</url-pattern>
</web-resource-collection>
<auth-constraint>
<!-- Anyone with one of the listed roles may access this area -->
<role-name>employee</role-name>
</auth-constraint>
</security-constraint>
<!-- Login configuration uses form-based authentication -->
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>Authenticate yourself</realm-name>
</login-config>
<!-- Security roles referenced by this web application -->
<security-role>
<description>
The role that is required to log in to the Administration Application
</description>
<role-name>employee</role-name>
</security-role>
</web-app>