Hey!

You are on correct track with the doGet responding with the HTML
with an HTML form, which POSTs parameters back to the Controller Servlet.

Now just just get those parameters in the Controler Servlet and decide on
your next process (i.e., Java Bean). Or, get a Servlet Context,
a Request Dispatcher and just forward to your next JSP or HTML.

I suggest you get a book on Servlets, go to Sun website and see this
list's archive for many many examples of Model View Control methodology
for servlets.

Sans adieu,
Danny Rubis

"Clais René" wrote:

> Hello everybody,
>
> I am develloping a converter to transform a mainframe application in a Webbased
> technology using Oracle8i platform.
> My  idea was to use the following scheme:
>
> My Servlet is always componed with the doGet and the doPost methods
> the doGet prepare the HTML page
> this HTML page contains a form
> using the 'SUBMIT' option the page call the same Servlet but using the doPost
> method,
> this one validate the datas and call a new Servlet with the same principle.
>
> Now my problem and the Servlets codes:
>
> rap01 method doGet builds a HTML RAM0100 which calls rap01.doPost which  calls
> rap02 doGet
> rap02 method doGet builds a HTML RAM0200 which calls rap02.doPost which calls
> rap01 doGet.
>
> When I do that, I get a loop in the Apache Server
>
> I have tested that with 3 and more Servlets, when I call a Servlet back it is
> looping ...
> otherwise it works great.
>
> Why ?
> Who can help me.
> Thank you
> René Clais
>
>  ----------------------------------------------------------------first Servlet
> rap01------------------------------------
> import java.io.*;
> import javax.servlet.*;
> import javax.servlet.http.*;
> import java.util.*;
> public class rap01 extends HttpServlet
> {
> String screen;
> RAM0100 map = new RAM0100();
> rap02 nextprocess = new rap02();
>
> public void doGet(  HttpServletRequest requete,
>                               HttpServletResponse reponse)
>                               throws IOException, ServletException
>      {
>           reponse.setContentType("text/html");
>           PrintWriter pw = reponse.getWriter();
>
>           screen=map.dohtml();  // prepare HTML page
>
>           pw.println(screen);   // send HTML page
>
>      }
>
> public  void doPost(     HttpServletRequest requete,
>                               HttpServletResponse reponse)
>                               throws IOException, ServletException
>      {
>
>           // coming back from the page
>           nextprocess.doGet(requete,reponse);
>
>      }
>
> }
>
> ----------------------------------------------------------------second Servlet
> rap02------------------------------------
> import java.io.*;
> import javax.servlet.*;
> import javax.servlet.http.*;
> import java.util.*;
> public class rap02 extends HttpServlet
> {
> String screen;
> RAM0200 map = new RAM0200();
> rap01 nextprocess = new rap01();
>
> public void doGet(  HttpServletRequest requete,
>                               HttpServletResponse reponse)
>                               throws IOException, ServletException
>      {
>           reponse.setContentType("text/html");
>           PrintWriter pw = reponse.getWriter();
>
>           screen=map.dohtml();  // prepare HTML page
>
>           pw.println(screen);   // send HTML page
>
>      }
>
> public  void doPost(     HttpServletRequest requete,
>                               HttpServletResponse reponse)
>                               throws IOException, ServletException
>      {
>
>           // coming back from the page
>           nextprocess.doGet(requete,reponse);
>
>      }
>
> }
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
  • Loop Clais Ren�
    • Danny Rubis

Reply via email to