I have a servlet in test.war (examples.servlet.testServlet) and defined it in the web.xml and mapped to testServlet in the servlet mapping.
- Posted by: Srikumar Gopal
- Posted on: September 12 2002 19:30 EDT
When I access this servlet http:/localhost:7001/testServlet, I get the following error:
From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:
10.4.4 403 Forbidden
The server understood the request, but is refusing to fulfill it. Authorization will not help and the request SHOULD NOT be repeated. If the request method was not HEAD and the server wishes to make public why the request has not been fulfilled, it SHOULD describe the reason for the refusal in the entity. This status code is commonly used when the server does not wish to reveal exactly why the request has been refused, or when no other response is applicable.
Using Weblogic 6.1 apps server.
Not sure what I'm doing wrong. Your help is greatly appreciated.
- Error 403--Forbidden when trying to access the servlet by joseph yi on September 13 2002 15:45 EDT
- Error 403--Forbidden when trying to access the servlet by Santosh Mani on September 16 2002 01:08 EDT
- Error 403--Forbidden when trying to access the servlet by Srikumar Gopal on September 18 2002 16:27 EDT
Code to be executed when a user enters the URL directly or redirects to a servlet URL should be put in the doGet method. Code to be executed on <form> submissions should (but not necessarily) be in the doPost method (depending on if the user should see it in the URL or not).
You probably have a doHead method and that access restrictions on how it's accessed.
Try using doGet and doPost unless you have a specific requirement for doHead...
My understanding is that you need to include the web app context while invoking the servlet, irrespective of the mapping you may have defined.
So the correct url would be: http://hostname/appcontext/servletalias
Thanks for your help.
Adding the context root helped.
On a different note:
Is there a way to call the servlet without mentioning the context root.
Could the URL be this way :
which in turn refers to
I'm using bea weblogic 6.1 and iPlanet w/s 4.1