Professional Documents
Culture Documents
J2EE Struts Framework: Shishir KR Singh
J2EE Struts Framework: Shishir KR Singh
J2EE Struts Framework: Shishir KR Singh
SHISHIR KR SINGH
CUSAT
What is Framework
Model 1, Model 2
What is Struts
Why we need it
Advantages of Struts
Controller Elements
View Elements
Model Elements
Conclusion
References
In the Model 1,the JSP page is responsible for processing the incoming
request and replying back to client.
It does not have separate controller.
Designers and Developers must work on the same files.
It leads to a significant amount of Java code embedded within the
JSP page.
SHISHIR KR SINGH (CUSAT) J2EE Struts Framework 15th March 2019 4 / 17
Model 2
The Model2 approach combines the use of both Servlets and JSP,
using JSP to generate the presentation layer and servlets to perform
process-intensive tasks.
No proceesing/business logic within the JSP page.
The controller provides a single point of control for security and often
encapsulates incoming data into a form usable by the back-end model.
ActionServlet
I Receive the HttpServletRequest.
I Determine which action to invoke.
I Automatically populate a JavaBean from the request parameters.
I Handles other local issues.
I Dispatch request to RequestProcessor.
RequestProcessor
I Finds ActionMapping.
I Mapping Action to Formbean.
I Creating FormBean object.
I Calling Validator of Formbean.
Java classes.
Middle tier components(EJB, Javabeans,...) - used to represent the
internal state of the system.
Databse access components.
Action Form.
JavaServer Pages(JSP)
HTML
Javascript and Stylesheets
Multimedia files
JavaBeans (part of model used by view component)
JSP custom tags
HTML
I used to create input forms.
I Ex - checkbox, image, submit, text etc.
Bean
I used for accessing JavaBeans and their properties.
I Ex - define, message, write etc.
Logic
I managing conditional generation of output text.
I Ex - empty, lessThan, greaterThan etc.
Tiles
I Each part of webpage can be reused as often as needed throughout the
application.
https://www.slideshare.net/JayaPrakash.m/strutsppt1/4