Migrating Beer Expert Struts 1 application

(from the Head First Servlets and JSP Book)

used resources:

  1. Edit web.xml. Front Controller is not a servlet anymore. Now it is a filter. Delete the servlet definition and add following lines:
  2. Move the file struts.xml to the folder resources. Delete form-beans and action-mappings definitions and define interceptors:

    and actions:
  3. implement the interceptors. MyConfigInterceptor makes the action request aware:
  4. Then delete the Form bean, since the Action class will take the bean function and refactor the action class. In Struts 2 method execute has no arguments and the action interceptor MyConfigInterceptor makes the action aware of the ServletRequest.
Everything else stays the same. Click here to download the working example.