NEED HELP !................ ASAP
Hi All,
i wrote HTML file and Servlet file and JSP file...
1. How can i call the Servlet in HTML file ?
2. How can i call the HTML in the Servlet file?
3. How can i call the Servlet in the JSP file?
4. How can i call the JSP in the Servlet file?
need sample code plz ...... it's an very urgent to me. I am waiting for ur replies....
Thanks in Advance..
From
Sree
> Hi All,
> i wrote HTML file and Servlet file and JSP
> file...
> . How can i call the Servlet in HTML file ?
> 2. How can i call the HTML in the Servlet file?
> 3. How can i call the Servlet in the JSP file?
> 4. How can i call the JSP in the Servlet file?
>
> need sample code plz ...... it's an very urgent to
> me. I am waiting for ur replies....
>
> Thanks in Advance..
>
>
> From
> Sree
Hi
suppose html file is index.html ... jsp is main.jsp and servlet is myServlet.java
1) we can call servlet thr html by using hyperlink or submit button just provide servlet path in action .
e.g
<a href="path to servlet" >link name</a>
2)u can call html page bylink
e.g in Myservlet java file .. printwriter object is out then
out.println("<a href='path_to_html_page' >link name</a>");
3) in jsp u can call servlet by using
<jsp:forward> or <jsp:include>
4) in servlet u can call jsp by using
RequestDispatcher
e.g
RequestDispatcher dispatch=request.getRequestDispatcher("/ jspfile_path_starting from webcontext_name");
then just call forward or include method on requestdispatcher object and pass request and response like
dispatch.forword(request,response);
dispatch.include(request,response);
i think u got ur answers for ur queries