刚刚解压版的apache-tomcat-5.5.23,启动setup.bat后,通过浏览器访问:http://127.0.0.1:8080/manager/html
在登录界面输入用户名 both 和密码 tomcat 后出现下面的错误提示:
HTTP Status 403 - Access to the requested resource has been denied
--------------------------------------------------------------------------------
type Status report
message Access to the requested resource has been denied
description Access to the specified resource (Access to the requested resource has been denied) has been forbidden.
问题原因:
D:\apache-tomcat-5.5.25\conf 目录下的
tomcat-users.xml 文件内容如下:
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<role rolename="tomcat"/>
<role rolename="role1"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="tomcat" password="tomcat" roles="tomcat"/>
<user username="role1" password="tomcat" roles="role1"/>
</tomcat-users>
问题修改:将tomcat-users.xml 文件内容改为
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<role rolename="tomcat"/>
<role rolename="role1"/>
<role rolename="manager"/>
<role rolename="admin"/>
<user username="admin" password="admin" roles="admin,manager"/>
<user username="tomcat" password="tomcat" roles="tomcat"/>
<user username="role1" password="tomcat" roles="role1"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
</tomcat-users>
分享到:
相关推荐
Causes the next filter in the chain to be invoked, or if the calling filter is the last filter in the chain, causes the resource at the end of the chain to be invoked. doFilter(ServletRequest, ...
Added #pragma pack(8/4) to acobject.h to ensure that the structures in this header are always compiled as aligned. The ACPI_OPERAND_OBJECT has been manually optimized to be aligned and will not work ...
They are also the developers who elect the core team, and they have access to closed discussions. The project can be grouped into four distinct separate parts, and most developers will focus their ...
Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://localhost:9000’ is therefore not ...
In earlier revisions, the error status light was cleared after a VsSetWavelength() call failed, so the user did not see the light turn red to alert that an error had occurred. This has been fixed in ...
* This update can not be removed after it is installed.* You will need the original Delphi 7 installation CD available to install this update.* To install this update from the CD, insert the CD, and ...
header('Access-Control-Allow-Headers: X-Requested-With, Content-Type'); ``` 3. **Access-Control-Allow-Credentials**:如果需要在跨域请求中携带Cookie,需要设置`Access-Control-Allow-Credentials`为`...
add_header Access-Control-Allow-Headers 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type'; if ($request_method = 'OPTIONS') { return 204; } ``` ...
response.setHeader("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept"); response.setHeader("Access-Control-Expose-Headers", "Location"); chain.doFilter(req, res); } ...
"method.response.header.Access-Control-Allow-Headers" = "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,x-requested-with'" } } ``` 这段代码首先创建了一个API Gateway REST API和一个资源,然后定义了...
当尝试跨域访问时,通常会遇到以下错误消息:“No 'Access-Control-Allow-Origin' header is present on the requested resource”。 **2. 同源示例** 要确定两个URL是否同源,需要检查它们的三个关键组成部分:...
response.setHeader("Access-Control-Allow-Headers", "Origin, No-Cache, X-Requested-With, If-Modified-Since, Pragma, Last-Modified, Cache-Control, Content-Type"); response.setHeader("Access-Control-...
为了解决跨域访问问题,W3C工作组发布了一个名为**Cross-Origin Resource Sharing (CORS)**的推荐标准。CORS提供了更安全、更灵活的方式来处理跨域数据交换,其核心机制是通过HTTP头部信息来控制哪些资源可以被其他...
CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. 跨域问题 浏览器对于ajax请求的一种安全限制:一个页面发起的ajax请求,只能是于当前页同域名的路径,这能有效的...
header("Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With"); ``` 最后,创建图片缩览图通常是为了优化显示和节省服务器存储空间。在PHP中,我们可以...
response.setHeader("Access-Control-Allow-Headers", "x-requested-with"); if ("OPTIONS".equalsIgnoreCase(request.getMethod())) { response.setStatus(HttpServletResponse.SC_OK); } else { chain....
Response to STATUS ENQUIRY - **定义**:对STATUS ENQUIRY的响应。 - **应用场景**:当网络收到STATUS ENQUIRY消息后返回的状态信息。 - **技术背景**:这用于提供有关网络状态的信息。 #### 22. Normal, ...
response.setHeader("Access-Control-Allow-Headers", "X-Requested-With, Content-Type, Accept, Origin, Authorization"); // 设置允许的自定义头部 response.setHeader("Access-Control-Allow-Credentials", ...