Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HTTP Status 403

 
chailin fong
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HTTP Status 403 -- Access to the requested resource has been denied

I am new to JSP. I followed the book (Beginning Java Server Page) example to delpoy chapter examples to Tomcat container.

When I typed:
http://localhost:8080/manager/html, it prompts me to enter user name and password. After entering user name and passwd, I got the above message.

When I checked /tomcat/conf/tomcat-users.xml, both user name and password are matched as I typed. How to solve this error?

Thanks in advance.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64715
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does the user have the manager role?
 
chailin fong
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure. I used tomcat/tomcat for user name and password.

BTW, How to set up manager role?

The following is the tomcat-users.xml file:

<?xml version="1.0" encoding="utf-8" ?>
- <tomcat-users>
<role rolename="tomcat" />
<role rolename="role1" />
<role rolename="manager" />
<role rolename="admin" />
<user username="tomcat" password="tomcat" roles="tomcat" />
<user username="role1" password="tomcat" roles="role1" />
<user username="both" password="tomcat" roles="tomcat,role1" />
</tomcat-users>
 
Michael Ku
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Would you publish the web.xml file? We need to look at how you mapped security in your we app...
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64715
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no user with the role of manager in your user file.
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15216
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by chailin fong:
BTW, How to set up manager role?

Add a user with role="manager" to the file and restart Tomcat.
 
Michael Ku
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can always go to the Tomcat site to find out how to do these things
 
chailin fong
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks. It works now.
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic