This document provides an introduction to Jakarta Struts 1.3, an open source MVC framework for building Java web applications. It discusses the limitations of using the traditional MVC pattern for web applications due to HTTP's stateless nature. Struts implements an MVC2 pattern to address this, using the controller to manage state. The core Struts components like ActionForms, Actions, and ActionMappings are explained. It also covers setting up the Struts controller through configuration files, defining forms and actions, and creating views with JSP and custom tag libraries.
This ppt tells about struts in java. All the methods and brief knowledge of struts. For more info about struts and free projects on it please visit : http://s4al.com/category/study-java/
University of Colorado PhD software engineering student Aaron Schram explains the details of creating a web applications using the Spring MVC framework
This ppt tells about struts in java. All the methods and brief knowledge of struts. For more info about struts and free projects on it please visit : http://s4al.com/category/study-java/
University of Colorado PhD software engineering student Aaron Schram explains the details of creating a web applications using the Spring MVC framework
jQuery Tutorial For Beginners | Developing User Interface (UI) Using jQuery |...Edureka!
( ** Full Stack Masters Training: https://www.edureka.co/masters-program/full-stack-developer-training ** )
This PPT on jQuery will help you understand the basics of jQuery and you will also be able to create your own program using jQuery by the end of this PPT.
Follow us to never miss an update in the future.
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
Spring MVC 3.0 Framework
Objective:
1. Introduce Spring MVC Module
2. Learn about Spring MVC Components (Dispatcher, Handler mapping, Controller, View Resolver, View)
Slides:
1. What Is Spring?
2. Why use Spring?
3. By the way, just what is MVC?
4. MVC Architecture
5. Spring MVC Architecture
7. Spring MVC Components
8. DispatcherServlet
9. DispatcherServlet Architecture.........
.........................................................
Building RESTful applications using Spring MVCIndicThreads
REST is an alternate and simpler approach for implementing WebServices. It is based on the HTTP protocol and hence leverages a lot of existing infrastructures. It uses an uniform interface thus making it easy to build client applications. In this session we will look at the fundamental concepts behind REST (Resource, URI, Stateless Conversation ..) and how to apply it in the context of a real applcation. We will also discuss the pros & cons of RESTful vs Soap based webservices. We will discuss the design of RESTful application and then look at how to implement it using Spring MVC.
jQuery Tutorial For Beginners | Developing User Interface (UI) Using jQuery |...Edureka!
( ** Full Stack Masters Training: https://www.edureka.co/masters-program/full-stack-developer-training ** )
This PPT on jQuery will help you understand the basics of jQuery and you will also be able to create your own program using jQuery by the end of this PPT.
Follow us to never miss an update in the future.
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
Spring MVC 3.0 Framework
Objective:
1. Introduce Spring MVC Module
2. Learn about Spring MVC Components (Dispatcher, Handler mapping, Controller, View Resolver, View)
Slides:
1. What Is Spring?
2. Why use Spring?
3. By the way, just what is MVC?
4. MVC Architecture
5. Spring MVC Architecture
7. Spring MVC Components
8. DispatcherServlet
9. DispatcherServlet Architecture.........
.........................................................
Building RESTful applications using Spring MVCIndicThreads
REST is an alternate and simpler approach for implementing WebServices. It is based on the HTTP protocol and hence leverages a lot of existing infrastructures. It uses an uniform interface thus making it easy to build client applications. In this session we will look at the fundamental concepts behind REST (Resource, URI, Stateless Conversation ..) and how to apply it in the context of a real applcation. We will also discuss the pros & cons of RESTful vs Soap based webservices. We will discuss the design of RESTful application and then look at how to implement it using Spring MVC.
Mvc interview questions – deep dive jinal desaijinaldesailive
Can you describe ASP.NET MVC Request Life Cycle? 1. Receive request, look up Route object in RouteTable collection and create RouteData object. 2. Create RequestContext instance. 3. Create MvcHandler and pass RequestContext to handler. 4. Identify IControllerFactory from RequestContext. 5. Create instance of class that implements ControllerBase. 6. Call MyController.Execute method. 7. The ControllerActionInvoker determines which action to invoke on the controller and executes the action on the controller, which results in calling the model and returning a view.
This presentation is about Spring MVC. Topics covered in this session are:
1. HTTP Servlet
2. What is Spring MVC?
3. MVC Architecture
4. Request Processing Workflow in Spring MVC
5. Spring Web Application Context
6. Spring MVC Configuration
7. Important Annotations
This session will provide a complete tour of using the Spring MVC framework to build Java Portlets. It will include an in-depth review of a sample portlet application developed using the latest features of Spring MVC, including Annotation-based Controllers. If you are writing Portlets and using Spring, this session is for you.
We'll begin by discussing the unique differences and challenges when developing Portlets instead of traditional Servlet webapps. Then we'll talk about the unique approach that Spring MVC takes towards Portlets that fully leverages the Portlet lifecycle, instead of masking it like many other frameworks. We'll take an extensive tour of a sample application so we can see all the unique pieces of the framework in action. Finally we'll conclude with discussion of the upcoming support for the Portlet 2.0 (JSR 286) specification that will be part of Spring 3.0.
Vibrant Technologies is headquarted in Mumbai,India.We are the best Advanced java training provider in Navi Mumbai who provides Live Projects to students.We provide Corporate Training also.We are Best Advanced Java classes in Mumbai according to our students and corporators
A simple presentation to understand what is ASP.net MVC4 and its structure.It covers all important features of MVC4 and razor view engine including screenshots
This set of slides introduces the reader to a subset of the C++ Standard Library called the Standard Template Library (STL). The STL provides a collection of parameterized containers and algorithms, and it is the most successful example of an approach to programming called generic programming. In this presentation, we aim at studying the ideals and concepts of the STL by re-implementing small parts of the library. Specifically, we first show how we can discover requirements on types in order to devise generic algorithms. Then, we focus on how to make algorithms independent of containers through the pivotal abstraction of iterators. To this end, we replicate the standard algorithm for finding the minimum in a sequence (min_element), which we subsequently match with a custom forward iterator over intrusive linked lists of integers. Finally, we see how function objects can be used to customize containers and algorithms alike. This allows us to deepen our understanding of ordering relations, and, in particular, to introduce the concept of strict weak orderings.
This set of slides introduces the reader to the concept of regular types, i.e., user-defined types whose semantics closely resembles that of built-in types. The notion of regular types proved crucial for the development of the C++ Standard Template Library, and it is currently employed in next-gen C++ libraries such as Eric Niebler's range-v3. The presentation serves as a gentle introduction to the topic, and discusses which requirements must be satisfied for a type to be regular. In particular, the concept of equality-preserving copy and assignment is presented, as well as how to define ordering relations that satisfy the requirements of strictness, transitivity and comparability (i.e., that adhere to the trichotomy law).
This set of slides introduces the reader to the concept of resource wrappers, i.e., classes that are responsible for the correct handling of resources of some kind (e.g., memory). In particular, the presentation discusses the design and implementation of a simplified version of std::vector for the specific case of integer elements. In this regard, we first discuss the fundamental role of destructors as a deterministic, general-purpose undo mechanism. Second, we notice that providing an explicit destructor entails the need of a consequent explicit implementation for the copy constructor and copy assignment operator. We conclude with the formulation of the so-called "rule of three".
This set of slides introduces the reader to the basics of memory management in C++ (with elements of C++11 and C++14). Specifically, after presenting the essential idea of memory segmentation, the presentation contrasts automatic and dynamic objects. To this extent the critical issue of memory leaks is introduced. It follows a discussion on the more advanced topics, such as owning and non-owning (i.e., observer) pointers, as well as dynamic arrays and structures.
This set of slides introduces the reader to the concept of operator overloading for user-defined types in C++ (with elements of C++11 and C++14). The exemplary case of the complex class is introduced. It follows a discussion on how to implement mixed-mode arithmetic, which requires mixing member and non-member operator functions. Moreover, the technical tool of friend functions and access functions is discussed.
This set of slides introduces the reader to the concept of multidimensional arrays in C++ (with elements of C++11 and C++14). The true nature of multidimensional arrays is discussed by means of an intermediate type alias. The pheonomenon of array-to-pointer decay and pointer arithmetic is then generalized to arrays of arrays. The presentation proceeds with a discussion on how to pass multidimensional arrays to functions.
This set of slides introduces the reader to the concept of arrays in C++ (with elements of C++11 and C++14). After presenting the array data type, the concept of array-to-pointer decay is introduced. The presentation proceeds with a discussion on how to pass arrays to functions. To this extent, the reader is guided to the use of bounded ranges as the first step towards the use of the Standard Template Library (STL).
An introduction to pointers and references in C++ (with elements of C++11 and C++14). The presentation introduces the readers to the concepts of pointers and references through the pragmatic need of writing a swap function between integers. Generic programming notions (e.g., type constructors) are adopted when useful for the explanation.
Spring MVC - Wiring the different layersIlio Catallo
The presentation focuses on the problem of wiring the different layers of a Spring MVC Web application. More precisely, the presentation explains how to wire the presentation layer (made of Spring MVC controllers) with the service and persistence objects. To this end, the slides first explain how to create the so called back-end (a.k.a. root) container, which will host the persistence and the service objects. Second, the @Repository and @Service annotations are introduced, which permit the framework to auto-discover the application beans. Finally, it is discussed how to wire such beans, through the usage of either the Spring-specific @Autowired annotation or the JEE @Inject annotation.
This set of slides introduces the basic concepts of Java development. First, the difference between Java as the programming language and Java as a platform is stated. Then, the different Java platforms are presented, with a particular interest in Java Standard Edition and Java Enterprise Edition. With respect to the latter, the roles and differences between the many JEE containers are discussed.
How to process request parameters with the Spring MVC framework. Namely, the presentation tackles the three primary concerns when dealing with request parameters: data binding, data buffering and data validation. To this end, the Bean Validation API (JSR-303) is discussed, and the concept of MessageSource for localized error messages is introduced. Moreover, The Post/Redirect/Get (PRG) pattern is presented along with a possible implementation strategy.
An introduction to the basics of the Spring MVC Web framework. The concepts of front controller, controller (handler), model and view are introduced. The whole processing pipeline is discussed, with an in-depth description of the HandlerMapping and ViewResolver strategy interfaces. The alternative representations of the Model (Map, Model and ModelMap) are presented.
This set of slides deals with the problem of building robust Web applications by isolating different areas of concern into different layers. The typical four-layer architecture is presented (consisting of the presentation, service and persistence layer, as well as of the domain model) along with an in-depth discussion on the role and responsibilities of each single layer.
Introduzione al concetto di oggetto nel modello della memoria del C++ e ai suoi possibile tempi di vita (temporaneo, automatico, dinamico, ...). Relazione tra il tempo di vita e la visibilità (scope) di un oggetto. Gestione degli oggetti dinamici per tipi primitivi, strutture e array mediante l'utilizzo di puntatori (raw pointers).
Introduzione agli Array in C++. Argomenti trattati: decadimento a puntatore di un array; conseguenze del meccanismo di decadimento sul passaggio di array a funzioni; array multidimensionali e il concetto di puntatore ad array; come passare array multidimensionali a funzioni; gli iteratori come generalizzazione di un puntatore ad elemento di un array ed una breve scorsa di come usare gli iteratori con gli algoritmi standard (e.g., std::copy) del C++.
Introduzione ai puntatori e ai riferimenti in C++. Viene presentato il problema dello swap, come esempio motivante per l'introduzione della semantica di riferimento. Si procede con l'introduzione del concetto di puntatore, a cui segue una spiegazione dei basilare operatori di referenziazione e dereferenziazione. Il problema dello swap viene risolto mediante puntatori. Si procede con l'introduzione dei riferimenti, come alias di variabili esistenti. Il problema dello swap viene in ultimo risolto mediante riferimenti.
An introduction to the Java Persistence API 2.x (JPA). Namely, this set of slides first introduces the problem of impedance mismatch between the object model and the relation model. Then, the EntityManager's public interface is discussed, together with the parallelism between a persistence context and a L1 cache. The issue of encapsulating the different application's use cases (which are exposed by the service objects) is solved by means of the @Transactional annotation, which provides a declarative way of demarcating the application's transactional boundaries. It follows an in-depth explanation on how to integrate a local, container-managed EntityManager within an existing Spring MVC application, so as to correctly support the propagation of the persistence context throughout the different beans involved in the same transaction. We then turn our attention to the problem of mapping relationships, thus introducing the @OneToMany, @ManyToMany and @OneToOne annotations. The additional topics of how to cascade operations and how to support lazy loading are covered as well. The presentation concludes with a discussion on how to use both the Criteria and Query API (and JPQL) to query the underlying database.
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
Pushing the limits of ePRTC: 100ns holdover for 100 daysAdtran
At WSTS 2024, Alon Stern explored the topic of parametric holdover and explained how recent research findings can be implemented in real-world PNT networks to achieve 100 nanoseconds of accuracy for up to 100 days.
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
The Metaverse and AI: how can decision-makers harness the Metaverse for their...Jen Stirrup
The Metaverse is popularized in science fiction, and now it is becoming closer to being a part of our daily lives through the use of social media and shopping companies. How can businesses survive in a world where Artificial Intelligence is becoming the present as well as the future of technology, and how does the Metaverse fit into business strategy when futurist ideas are developing into reality at accelerated rates? How do we do this when our data isn't up to scratch? How can we move towards success with our data so we are set up for the Metaverse when it arrives?
How can you help your company evolve, adapt, and succeed using Artificial Intelligence and the Metaverse to stay ahead of the competition? What are the potential issues, complications, and benefits that these technologies could bring to us and our organizations? In this session, Jen Stirrup will explain how to start thinking about these technologies as an organisation.
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
Welcome to the first live UiPath Community Day Dubai! Join us for this unique occasion to meet our local and global UiPath Community and leaders. You will get a full view of the MEA region's automation landscape and the AI Powered automation technology capabilities of UiPath. Also, hosted by our local partners Marc Ellis, you will enjoy a half-day packed with industry insights and automation peers networking.
📕 Curious on our agenda? Wait no more!
10:00 Welcome note - UiPath Community in Dubai
Lovely Sinha, UiPath Community Chapter Leader, UiPath MVPx3, Hyper-automation Consultant, First Abu Dhabi Bank
10:20 A UiPath cross-region MEA overview
Ashraf El Zarka, VP and Managing Director MEA, UiPath
10:35: Customer Success Journey
Deepthi Deepak, Head of Intelligent Automation CoE, First Abu Dhabi Bank
11:15 The UiPath approach to GenAI with our three principles: improve accuracy, supercharge productivity, and automate more
Boris Krumrey, Global VP, Automation Innovation, UiPath
12:15 To discover how Marc Ellis leverages tech-driven solutions in recruitment and managed services.
Brendan Lingam, Director of Sales and Business Development, Marc Ellis
Accelerate your Kubernetes clusters with Varnish CachingThijs Feryn
A presentation about the usage and availability of Varnish on Kubernetes. This talk explores the capabilities of Varnish caching and shows how to use the Varnish Helm chart to deploy it to Kubernetes.
This presentation was delivered at K8SUG Singapore. See https://feryn.eu/presentations/accelerate-your-kubernetes-clusters-with-varnish-caching-k8sug-singapore-28-2024 for more details.
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfPeter Spielvogel
Building better applications for business users with SAP Fiori.
• What is SAP Fiori and why it matters to you
• How a better user experience drives measurable business benefits
• How to get started with SAP Fiori today
• How SAP Fiori elements accelerates application development
• How SAP Build Code includes SAP Fiori tools and other generative artificial intelligence capabilities
• How SAP Fiori paves the way for using AI in SAP apps
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
PHP Frameworks: I want to break free (IPC Berlin 2024)Ralf Eggert
In this presentation, we examine the challenges and limitations of relying too heavily on PHP frameworks in web development. We discuss the history of PHP and its frameworks to understand how this dependence has evolved. The focus will be on providing concrete tips and strategies to reduce reliance on these frameworks, based on real-world examples and practical considerations. The goal is to equip developers with the skills and knowledge to create more flexible and future-proof web applications. We'll explore the importance of maintaining autonomy in a rapidly changing tech landscape and how to make informed decisions in PHP development.
This talk is aimed at encouraging a more independent approach to using PHP frameworks, moving towards a more flexible and future-proof approach to PHP development.
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionAggregage
Join Maher Hanafi, VP of Engineering at Betterworks, in this new session where he'll share a practical framework to transform Gen AI prototypes into impactful products! He'll delve into the complexities of data collection and management, model selection and optimization, and ensuring security, scalability, and responsible use.
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfPaige Cruz
Monitoring and observability aren’t traditionally found in software curriculums and many of us cobble this knowledge together from whatever vendor or ecosystem we were first introduced to and whatever is a part of your current company’s observability stack.
While the dev and ops silo continues to crumble….many organizations still relegate monitoring & observability as the purview of ops, infra and SRE teams. This is a mistake - achieving a highly observable system requires collaboration up and down the stack.
I, a former op, would like to extend an invitation to all application developers to join the observability party will share these foundational concepts to build on:
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
Removing Uninteresting Bytes in Software FuzzingAftab Hussain
Imagine a world where software fuzzing, the process of mutating bytes in test seeds to uncover hidden and erroneous program behaviors, becomes faster and more effective. A lot depends on the initial seeds, which can significantly dictate the trajectory of a fuzzing campaign, particularly in terms of how long it takes to uncover interesting behaviour in your code. We introduce DIAR, a technique designed to speedup fuzzing campaigns by pinpointing and eliminating those uninteresting bytes in the seeds. Picture this: instead of wasting valuable resources on meaningless mutations in large, bloated seeds, DIAR removes the unnecessary bytes, streamlining the entire process.
In this work, we equipped AFL, a popular fuzzer, with DIAR and examined two critical Linux libraries -- Libxml's xmllint, a tool for parsing xml documents, and Binutil's readelf, an essential debugging and security analysis command-line tool used to display detailed information about ELF (Executable and Linkable Format). Our preliminary results show that AFL+DIAR does not only discover new paths more quickly but also achieves higher coverage overall. This work thus showcases how starting with lean and optimized seeds can lead to faster, more comprehensive fuzzing campaigns -- and DIAR helps you find such seeds.
- These are slides of the talk given at IEEE International Conference on Software Testing Verification and Validation Workshop, ICSTW 2022.
2. Outline
¤ Model-View-Controller vs. Web applications
¤ From MVC to MVC2
¤ What is Struts?
¤ Struts Architecture
¤ Building web applications with Struts
¤ Setting up the Controller
¤ Writing Views
¤ References
2
4. Model-View-Controller
design pattern
¤ In the late seventies, software architects saw applications
as having three major parts:
¤ The part that manages the data (Model)
¤ The part that creates screens and reports (View)
¤ The part that handles interactions between the user and the
other subsystems (Controller)
¤ MVC turned out to be a good way to design applications
¤ Cocoa (Apple)
¤ Swing (Java)
¤ .NET (Microsoft)
4
6. Model-View-Controller vs.
Web applications
¤ What is the reason not to use the same MVC pattern also
for web applications?
¤ Java developers already have utilities for:
¤ building presentation pages, e.g., JavaServer Pages (View)
¤ handling databases, e.g., JDBC and EJB (Model)
¤ But…
¤ the HTTP protocol imposes limitations on the applicability of
the MVC design pattern
¤ we don’t have any component to act as the Controller
6
7. HTTP limitations
¤ The MVC design pattern requires a push protocol for the
views to be notified by the model
¤ HTTP is a pull protocol: no request implies no response
¤ The MVC design pattern requires a stateful protocol to
keep track of the state of the application
¤ HTTP is stateless
7
8. HTTP limitations: Struts solutions
¤ HTTP is stateless: we can implement the MVC design
pattern on top of the Java Servlet Platform
¤ the platform provides a session context to help track users in
the application
¤ HTTP is a pull protocol: we can increase the Controller
responsibility. It will be responsible for:
¤ state changes
¤ state queries
¤ change notifications
8
9. Model-View-Controller 2
design pattern
¤ The resulting design pattern is sometimes called MVC2 or
Web MVC
¤ Any state query or change notification must pass through
the Controller
¤ The View renders data passed by the Controller rather than
data returned directly from the Model
9
View Controller Model
10. What is Jakarta Struts?
¤ Jakarta Struts is an open source framework
¤ It provides a MVC2-style Controller that helps turn raw
materials like web pages and databases into a coherent
application
¤ The framework is based on a set of enabling
technologies common to every Java web application:
¤ Java Servlets for implementing the Controller
¤ JavaServer Pages for implementing the View
¤ EJB or JDBC for implementing the Model
10
12. Struts Main Components:
ActionForward, ActionForm, Action
¤ Each web application is made of three main
components:
¤ Hyperlinks lead to pages that display data and other
elements, such as text and images
¤ HTML forms are used to submit data to the application
¤ Server-side actions which performs some kind of business
logic on the data
12
13. Struts Main Components:
ActionForward, ActionForm, Action
¤ Struts provides components that programmers can use to
define hyperlinks, forms and custom actions:
¤ Hyperlinks are represented as ActionForward objects
¤ Forms are represented as ActionForm objects
¤ Custom actions are represented as Action objects
13
14. Struts Main Components:
ActionMapping
¤ Struts bundles these details together into an
ActionMapping object
¤ Each ActionMappinghas its own URI
¤ When a specific resource is requested by URI, the
Controller retrieves the corresponding ActionMapping
object
¤ The mapping tells the Controller which Action, ActionForm
and ActionForwards to use
14
15. Struts Main Components:
ActionServlet
¤ The backbone component of the Struts framework is
ActionServlet (i.e., the Struts Controller)
¤ For every request, the ActionServlet:
¤ uses the URI to understand which ActionMapping to use
¤ bundles all the user input into an ActionForm
¤ call the Action in charge of handling the request
¤ reads the ActionForwardcoming from the Action and
forward the request to the JSP page what will render the
result
15
17. Struts main component responsibilities
Class Description
ActionForward A user’s gesture or view selection
ActionForm The data for a state change
ActionMapping The state change event
ActionServlet The part of the Controller that receives
user gestures and stare changes and
issues view selections
Action classes The part of the Controller that interacts
with the model to execute a state
change or query and advises
ActionServlet of the next view to select
17
19. Setting up the Controller:
The big picture
19
struts-
config.xml
web.xml
ActionMapping 1 ActionMapping N
20. Setting up the Controller:
Servlet Container (1/3)
¤ The web.xml deployment descriptor file describes how to
deploy a web application in a servlet container (e.g., Tomcat)
¤ The container reads the deployment descriptor web.xml, which
specifies:
¤ which servlets to load
¤ which requests are sent to which servlet
20
21. Setting up the Controller:
Servlet Container (2/3)
¤ Struts implements the Controller as a servlet
¤ Like all servlets it lives in the servlet container
¤ Conventionally, the container is configured to sent to
ActionServlet any request that matches the pattern
*.do
¤ Remember: Any valid extension or prefix can be used,
.do is simply a popular choice
21
22. Setting up the Controller:
Servlet Container (3/3)
web.xml (snippet)
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
22
¤ Forward any request that matches the pattern *.do to
the servlet named action (i.e., the Struts controller)
23. Struts Controller:
struts-config.xml
¤ The framework uses the struts-config.xml file as a
deployment descriptor
¤ It contains all the ActionMappings definedfor the web
application
¤ At boot time, Struts reads it to create a database of objects
¤ At runtime, Struts refers to the object created with the
configuration file, not the file itself
23
24. Struts Controller:
ActionForm (1/4)
¤ A JavaBean is a reusable software component which
conform to a set of design patterns
¤ The access to the bean’s internal state is provided through
two kinds of methods: accessors and mutators
¤ JavaBeans are used to encapsulate many objects into a
single object
¤ They can be passed around as a single bean object instead
of as multiple individual objects
24
25. Struts Controller:
ActionForm (2/4)
¤ Struts model ActionForms as JavaBeans
¤ The ActionForm has a corresponding property for each field
on the HTML form
¤ The Controller matches the parameters in the HTTP
request with the properties of the ActionForm
¤ When they correspond, the Controller calls the setter
methods and passes the value from the HTTP request
25
26. Struts Controller:
ActionForm (3/4)
LoginForm.java
pubic class LoginForm extends org.apache.struts.action.ActionForm {
private String username;
private String password;
public String getUsername() {return this.username;}
public String getPassword() {return this.password;}
public void setUsername(String username) {this.username =
username;}
public void setPassword(String password) {this.password =
password;}
}
26
¤ An ActionForm is a JavaBean that extends
org.apache.struts.action.ActionForm
27. Struts Controller:
ActionForm (4/4)
Specifying a new ActionForm in struts-config.xml
<form-beans>
<form-bean name=”loginForm"
type=”app.LoginForm"/>
</form-beans>
27
¤ Define a mapping between the actual ActionForm and
its logical name
28. Struts Controller:
ActionForwards
Specifying new ActionForwardsin struts-config.xml
<forward name="success" path="/success.html"/>
<forward name=”failure" path="/success.html"/>
<forward name=”logon" path=”/Logon.do"/>
28
¤ Define a mapping between the resource link and its
logical name
¤ Once defined, throughout the web application it is
possible to reference the resource via its logical name
29. Struts Controller:
Action
¤ Actions are Java classes that extend
org.apache.struts.Action
¤ The Controller populates the ActionForm and then passes it
to the Action
¤ the entry method is perform (Struts 1.0) or execute (Struts 1.1+)
¤ The Action is generally responsible for:
¤ validating input
¤ accessing business information
¤ determining which ActionForward to return to the Controller
29
30. Struts Controller:
Action
LoginAction.java
import javax.servet.http.*;
public class LoginAction extends org.apache.struts.action.Action {
public ActionForward execute(ActionMapping mapping, ActionForm
form,
HttpServletRequest req, HttpServletResponse
res) {
// Extract data from the form
LoginForm lf = (LoginForm) form;
String username = lf.getUsername();
String password = lf.getPassword();
// Apply business logic
UserDirectory ud = UserDirectory.getInstance();
if (ud.isValidPassword(username, password))
return mapping.findForward("success");
return mapping.findForward("failure");
}
} 30
33. Writing Views:
JavaServer Pages (JSP)
¤ JavaServer Pages is a technology that helps Java
developers create dynamically generated web pages
¤ A JSP page is a mix of plain old HTML tags and JSP scripting
elements
¤ JSP pages are translated into servlets at runtime by the JSP
container
33
JSP Scripting Element
<b> This page was accessed at <%= new Date() %></b>
34. Writing Views:
JSP tags
¤ JSP scripting elements require that developers mix Java
code with HTML. This situation leads to:
¤ non-maintainable applications
¤ no opportunity for code reuse
¤ An alternative to scripting elements is to use JSP tags
¤ JSP tags can be used as if they were ordinary HTML tags
¤ Each JSP tag is associated with a Java class
¤ It’s sufficient to insert the same tag on another page to reuse
the same code
¤ If the code changes, all the pages are automatically updated
34
35. Writing Views:
JSP Tag Libraries
¤ A number of prebuilt tag libraries are available for
developers
¤ Example: JSP Standard Tag Library (JSTL)
¤ Each JSP tag library is associated with a Tag Library
Descriptor (TLD)
¤ The TLD file is an XML-style document that defines a tag
library and its individual tags
¤ For each tag, it defines the tag name, its attributes, and the
name of the class that handles tag semantics
35
36. Writing Views:
JSP Tag Libraries
¤ JSP pages are an integral part of the Struts Framework
¤ Struts provides its own set of custom tag libraries
36
Tag library descriptor Purpose
struts-html.tld JSP tag extension for
HTML forms
struts-bean.tld JSP tag extension for
handling JavaBeans
struts-logic.tld JSP tag extension for
testing the values of
properties
37. Writing Views
login.jsp
<%@ taglib uri=”http://struts.apache.org/tags-html" prefix="html" %>
<html>
<head>
<title>Sign in, Please!</title>
</head>
<body>
<html:form action="/login" focus="username">
Username: <html:text property="username"/> <br/>
Password: <html:password property="password"/><br/>
<html:submit/> <html:reset/>
</html:form>
</body>
</html>
37
the taglib directive
makes accessible the
tag library to the JSP
page
JSP tag from the
struts-html tag
library
38. References
¤ Struts 1 In Action, T. N. Husted, C. Dumoulin, G. Franciscus,
D. Winterfeldt, , Manning Publications Co.
¤ JavaBeans, In Wikipedia, The Free
Encyclopedia,http://en.wikipedia.org/w/index.php?title=
JavaBeans&oldid=530069922
¤ JavaServer Pages, In Wikipedia, The Free
Encyclopediahttp://en.wikipedia.org/w/index.php?title=
JavaServer_Pages&oldid=528080552
38