Results 1 to 5 of 5

Thread: servlet - struts

  1. #1
    Contributing Member
    Join Date
    Sep 2006
    Answers
    962

    servlet - struts

    Can anyone tell me how servet acts as a controller in struts?

    ---------------------
    suresh


  2. #2
    Junior Member
    Join Date
    Jun 2007
    Answers
    20

    Re: servlet - struts

    We define the name & path of the Action Servlet in the Web.xml.Web.xml is the deployment descriptor of the application. Thus,whenever any request has been made by submitting the JSP page control goes to the action servlet.Action Servlet intercepts & process the request by forwarding it to Model. Thus, in this way it acts as a controller.


  3. #3
    Banned
    Join Date
    Oct 2007
    Answers
    5

    Re: servlet - struts

    In web.xml ur specifying the servlet name as

    <servlet>
    <servlet-name>action</servlet-name>
    <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
    <init-param>
    <param-name>config</param-name>
    <param-value>/WEB-INF/struts-config.xml</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>action</servlet-name>
    <url-pattern>*.do</url-pattern>
    </servlet-mapping>

    i.e wtever request comes from the brower , comes to web.xml and maps to org.apache.struts.action.ActionServlet(this is already implemented by apache).This ActionServlet will act as a controller . ActionServlet uses the initialization parameters /WEB-INF/struts-config.xml and send to particular Action


  4. #4
    Junior Member
    Join Date
    May 2008
    Answers
    1

    Re: servlet - struts

    hi.. when request first comes it will handle by the controller(Action Servlet)...
    In struts there is only one controller is called Action Servlet Controller...


  5. #5
    Junior Member
    Join Date
    Aug 2008
    Answers
    15

    Re: servlet - struts

    Hi,
    controller part is developed by servlet components. whenever client make a request,
    front controller used to identify the request and give to the specific request processor which is used to handle request by doing the following..
    protocal handling, form validation, action mapping,....etc
    and give the request to the action and take the response give the response to the view.

    front controller is one servlet component provided by framework.
    request processor (application controller) is one servlet provided by framework.
    action is one servlet developed by us.

    thanks


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact