4 replies
If you have to make a call to the HTML file from your servlet, you would have to use the RequestDispatcher class. You can use either the include() or the forward() method based on your requirement.
Please refer to the Servlet docs for usage information.
Thanks,
Rashmi.
by pra_kie
simply use, response.sendRedirect(request.getContextPath()+"redirectionfile.htm");
-- this one is absolute fragment type redirection
--this one equvalent to
response.sendRedirect( " /redirectionfile.htm " );
or u can use relative fragment,
response.sendRedirect( "redirectionfile.htm" );
by chellaganesh
Hi,
If you want to generate Html output from the servlet, you need to write the Html code to the response object.
PrintWriter out = response.getWriter();
out.println("");
out.println("");
out.println("Hola");
out.println("");
out.println("");
out.println(" HelloWorldEJB Says: ");
out.println(this.hw.hi());
out.println("");
out.println("");
If you want to call a HTML file you need to use the RequestDespatcher object
This discussion is closed to new replies.
Trending Web Development posts
Sort by Trending