Answered Questions

  • why servlet is used as controller ?not JSP? i want complete Explation?

    In struts servlet control the application and we know that a jsp compiled into a servlet first. The only problem with the servlet is that it needs to write out.println call per HTML line. But as a controller in struts servlets do not force the programmers to write out.println, that is the part of JSP which acts as View.So if the controller would be JSP the translation (JSP compiled to a servlet)step...

    Ajay

    • Sep 3rd, 2014

    To maintain the control flow huge amount of code is required.Writing huge code in jsp is against jsp technology.
    So Jsp is not recommended to use as a controller

    anil

    • Nov 19th, 2012

    Servlets are meant to carry out the dynamic work. If we put Servlet to View rather than as controller, it holds so many server resources, unnecessary creation of Request and Response objects that makes the Server to have unnecessary burden.

  • in struts why we use jsp as view( presentation)? what happen if we use servlet as view?

    Nitin

    • Jun 22nd, 2006

    There is no specific reason for that, using JSP we can create presenatation part easily & effectively there r no complication like in Servlet...& JSP is also converted to servlet at last so no probs.... hope answer is usefullNitin