How do I reference a servlet programatically in JBuilder 5?

By: Christopher Moeller

Abstract: Using the servlet mapping to reference servlets within your code.

Question:

How do I reference a servlet programatically?

Answer:

You should use the servlet mapping, which relates to the servlet invoker object. It makees it easier to refer to to servlet object, as it is not necessary to hard code path references which may change after deployment.

For example:

<%

RequestDispatcher rd = request.getRequestDispatcher("/servlet/jspservletservlet.Servlet1");
rd.include(request, response);

%>


Server Response from: ETNASC01