This week's book giveaways are in the Functional Programming and Linux forums.
We're giving away four copies each of Reactive Design Patterns and Learn Linux in a Month of Lunches and have the authors on-line!
See this thread and this one for details.
Win a copy of Reactive Design Patterns this week in the Functional Programming forum
or Learn Linux in a Month of Lunches in the Linux forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

403 error

 
Mahen
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hiiiiiii
i wrote a servlet stored it in C:\jsdk2.1\examples\WEB-INF\servlets\ and compiled it to class file
whenever i try to access it i.e. execute it thru browser
403 forbidden error is thrown
and why two different servletrunner in jsdk2.0 and startserver in jsdk2.1
servlet
X.java
import java.io.*;
import java.text.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class X extends HttpServlet {
ResourceBundle rb = ResourceBundle.getBundle("LocalStrings");
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException
{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<body bgcolor=\"white\">");
out.println("<head>");
String title = rb.getString("helloworld.title");
out.println("<title>" + title + "</title>");
out.println("</head>");
out.println("<body>");
out.println("<a href=\"../servlets/helloworld.html\">");
out.println("<img src=\"../images/code.gif\" height=24 " +
"width=24 align=right border=0 alt=\"view code\"></a>");
out.println("<a href=\"../servlets/index.html\">");
out.println("<img src=\"../images/return.gif\" height=24 " +
"width=24 align=right border=0 alt=\"return\"></a>");
out.println("<h1>" + title + "</h1>");
out.println("</body>");
out.println("</html>");
}
}
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You might want to check the directory permissions(for the directory of your servelet) on your server. This directory might not have execution permission and hence might be giving this error. I know with IIS this used to be a problem, not sure about this one.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!