4:40 pm - Saturday September 23, 2017

Struts1 vs Struts2

CANDID INDUSTRIAL TRAINING -- CHENNAI
Corporate Training for Experienced Candidate
Struts | Hibernate | Spring | Java / J2EE
SOAP | RestFull | Design Pattern | more...
Ph: +91 72000 69003
137b, 2nd st, shanthi nagar, Chrompet, Chennai -600044

BACK

Struts1 vs Struts2

  • in struts 1 front controller is ActionServletIn struts 2 front controller is FilterDispatcher
  • In struts 1 we have RequestProcessor classIn struts 2 we have Interceptors instead RequestProcessor
  • In struts 1 we have multiple tag libraries like, html, logic, bean..etcIn struts 2 we do not have multiple libraries, instead we have single library which includes all tags
  • In struts 1 the configuration fine name can be [any name].xml and we used to place in web-inf folderIn struts 2 the configuration file must be struts.xml only and this must be in classes folder
  • In struts 1 we have form beans and Action classes separatelyIn struts 2 form bean, Action classes are combinedly given as Action class only
  • In struts 1 properties file must be configured in struts-config.xmlin struts 2 we need to configure our resource bundle(s) in struts.properties file
  • In struts 1 an Action class is a single ton class, so Action class object is not a thread safe, as a programmer we need to make it as thread safe by        applying synchronizationIn struts 2 an Action class object will be created for each request, so it is by default thread safe.
  • In struts 1 we have only jsp as a view technologyIn struts 2 we have support of multiple view technologies like velocity, Freemarker, jasper reports, jsp
  • In struts 1 Action class is having servlet dependency, because in execute() method accepts req, res parameter right ! so.In struts 2 Action class doesn’t have any servlet dependency, because its execute() method doesn’t accepts any parameters, however we can access all servlet objects with dependency injection

BACK

Filed in: Struts 2 Tutorial

Comments are closed.