top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration

Facebook Login
Site Registration

How can I use a servlet to generate a site using frames?

0 votes
52 views
How can I use a servlet to generate a site using frames?
posted Nov 18, 2015 by Dominic

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

In general, look at each frame as a unique document capable of sending its own requests and receiving its own responses. You can create a top servlet (say, FrameServlet) that upon invocation creates the frame layout you desire and sets the SRC parameters for the frame tags to be another servlet, a static page or any other legal value for SRC.

---------------------- SAMPLE ----------------------

          public void doGet(HttpServletRequest request,
          HttpServletResponse response) throws ServletException, IOException {
          response.setContentType("text/html");
          PrintWriter out = new PrintWriter (response.getWriter());

          out.println("");
          out.println("Your Title");

          // definingthe three rows of Frames for the main page
          // top : frm_1
          // middle : frm_2
          // bottom : frm_3

          out.println("");
          out.println("");
          out.println("");
          out.println("");
          out.println("");

          out.println("");
          out.println("");
          out.close();
          -------------------------- END ------------------------------------------

Where MenuServlet and DummyServlet provide content and behavior for the frames generated by FrameServlet.

answer Nov 19, 2015 by Karthick.c
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...