*
The moose likes Servlets and the fly likes 403 Forbidden Error - Will only serve files, not servlets? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "403 Forbidden Error - Will only serve files, not servlets?" Watch "403 Forbidden Error - Will only serve files, not servlets?" New topic
Author

403 Forbidden Error - Will only serve files, not servlets?

Pranit Sonawane
Ranch Hand

Joined: Jul 29, 2011
Posts: 155

Here is my HTML code



And Here is My Servlet Code



Giving me 403 Forbidden error Please help...!!!
Many Thanks!!!
Tim McGuire
Ranch Hand

Joined: Apr 30, 2003
Posts: 820

Look at the other html examples in the tomcat servlets examples directory. Their paths to their servlets are a bit different from yours. What happens if you emulate those paths? (i.e. change the action attribute of your form)
Pranit Sonawane
Ranch Hand

Joined: Jul 29, 2011
Posts: 155

Tim McGuire wrote:Look at the other html examples in the tomcat servlets examples directory. Their paths to their servlets are a bit different from yours. What happens if you emulate those paths? (i.e. change the action attribute of your form)


I understand that sir but unfortunately am using the servlet runner as a server for my servlet programs..!!
Tim McGuire
Ranch Hand

Joined: Apr 30, 2003
Posts: 820

Pranit Sonawane wrote:
Tim McGuire wrote:Look at the other html examples in the tomcat servlets examples directory. Their paths to their servlets are a bit different from yours. What happens if you emulate those paths? (i.e. change the action attribute of your form)


I understand that sir but unfortunately am using the servlet runner as a server for my servlet programs..!!


The same idea still applies. I've never used ServletRunner, but I'm going to guess that it won't like your paths either. 403 errors can be caused by many things, one of which is that the filesystem prevents the server from accessing a directory, in this case maybe the
examples directory.

I will guess that your URL:



should instead be something like
Tim McGuire
Ranch Hand

Joined: Apr 30, 2003
Posts: 820

Pranit Sonawane wrote:
I understand that sir but unfortunately am using the servlet runner as a server for my servlet programs..!!


So, I looked up ServletRunner. That is some ancient stuff. Why are you using that?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: 403 Forbidden Error - Will only serve files, not servlets?