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

Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
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
PrintWriter out = response.getWriter();
out.println("<body bgcolor=\"white\">");
String title = rb.getString("helloworld.title");
out.println("<title>" + title + "</title>");
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>");
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!