SlideShare uma empresa Scribd logo
1 de 25
Introducing Struts 2 JaMU 07.02 – February 24, 2007 Thomas Wiradikusuma (thomas@wiradikusuma.com) Java User Group Indonesia
Struts 2 defined ,[object Object],[object Object],[object Object],[object Object]
Sweet spots ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Architecture ,[object Object],[object Object],[object Object],[object Object],[object Object]
Architecture, cont’d
ActionMapper ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Interceptors <interceptor-stack name=&quot;xaStack&quot;> <interceptor-ref name=&quot;thisWillRunFirstInterceptor&quot;/> <interceptor-ref name=&quot;thisWillRunNextInterceptor&quot;/> <interceptor-ref name=&quot;followedByThisInterceptor&quot;/> <interceptor-ref name=&quot;thisWillRunLastInterceptor&quot;/> </interceptor-stack> thisWillRunFirstInterceptor thisWillRunNextInterceptor followedByThisInterceptor thisWillRunLastInterceptor MyAction1 MyAction2 (chain) MyPreResultListener MyResult (result) thisWillRunLastInterceptor followedByThisInterceptor thisWillRunNextInterceptor thisWillRunFirstInterceptor
Interceptors, cont’d Checks for valid token presence in Action, prevents duplicate form submission. token  Token And many more… Action will only be executed if the user has the correct JAAS role. roles  Roles If the Action implements Preparable, calls its prepare method.  prepare  Prepare Sets the request parameters onto the Action.  params  Parameters Executes the Action in the background and then sends the user off to an intermediate waiting page.  execAndWait  Execute and Wait Adds automatic checkbox handling code that detect an unchecked checkbox and add it as a parameter with a default (usually 'false') value. Uses a specially named hidden field to detect unsubmitted checkboxes.  checkbox  Checkbox Description Name Interceptor
Actions ,[object Object],[object Object]
Results Used for Velocity integration Velocity And many more… Used for Action Chaining Chain Used to stream an InputStream back to the browser (usually for file downloads) Stream Used to redirect to another action mapping Redirect Action Used to redirect to another URL (web resource)  Redirect Used for web resource integration, including JSP integration Dispatcher Usage Result
Type conversion ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Localization ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Configuration files Override the default Velocity configuration /WEB-INF/classes/  Yes velocity.properties Optional configuration files for plug-ins in the same format as struts.xml. Root of a plug-in JAR  Yes struts-plugin.xml  Default macros referenced by velocity.properties /WEB-INF/classes/  Yes struts-default.vm Default configuration provided by Struts /WEB-INF/lib/struts2-core.jar  Yes struts-default.xml Framework properties /WEB-INF/classes/  Yes struts.properties Main configuration, contains result/view types, action mappings, interceptors, and so forth /WEB-INF/classes/  Yes struts.xml Deployment descriptor /WEB-INF/  No web.xml Purpose  Location Optional? File
Taglib <% User user = ActionContext.getContext() %> <form action=&quot;Profile_update.action&quot; method=&quot;post&quot;> <table> <tr> <td> align=&quot;right&quot;><label>First name:</label></td> <td><input type=&quot;text&quot; name=&quot;user.firstname&quot; value=&quot;<%=user.getFirstname() %> /></td> </tr> <tr> <td> <input type=&quot;radio&quot; name=&quot;user.gender&quot; value=&quot;0&quot; id=&quot;user.gender0&quot;  <% if (user.getGender()==0) { %> checked=&quot;checked&quot; %> } %> /> <label for=&quot;user.gender0&quot;>Female</label> ... Without taglib (JSP): <s:actionerror/> <s:form action=&quot;Profile_update&quot; validate=&quot;true&quot;> <s:textfield label=&quot;Username&quot; name=&quot;username&quot;/> <s:password label=&quot;Password&quot; name=&quot;password&quot;/> <s:password label=&quot;(Repeat) Password&quot; name=&quot;password2&quot;/> <s:textfield label=&quot;Full Name&quot; name=&quot;fullName&quot;/> <s:textfield label=&quot;From Address&quot; name=&quot;fromAddress&quot;/> <s:textfield label=&quot;Reply To Address&quot; name=&quot;replyToAddress&quot;/> <s:submit value=&quot;Save&quot; name=&quot;Save&quot;/> <s:submit action=&quot;Register_cancel&quot; value=&quot;Cancel&quot; name=&quot;Cancel&quot; onclick=&quot;form.onsubmit=null&quot;/> </s:form> With taglib (JSP):
Taglib, cont’d ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Servlet/JSP scoped object ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
OGNL ,[object Object],[object Object]
Spring integration ,[object Object]
Testing ,[object Object],[object Object],[object Object]
Struts 1 to Struts 2 Despite the similar name (Struts), migrating from Struts 1 is harder than migrating from WebWork 2. struts.xml struts-config.xml Action or POJO ActionForm Action or POJO Action (singleton) {action}-validation.xml validation.xml Result ActionForward Interceptors RequestProcessor FilterDispatcher ActionServlet Struts 2 Struts 1
WebWork 2 to Struts 2 Pretty much the same, only naming/namespace changes. <s:*/> <ww:*/> struts.xml xwork.xml struts.properties webwork.properties com.opensymphony.xwork2.* com.opensymphony.xwork.* “ struts” “ webwork” org.apache.struts2.* com.opensymphony.webwork.* Struts 2 WebWork 2
Requirements ,[object Object],[object Object],[object Object]
Integration with open source libraries ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Not discussed ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Where to go from here ,[object Object],[object Object],[object Object],[object Object]

Mais conteúdo relacionado

Mais procurados

01 introduction to struts2
01 introduction to struts201 introduction to struts2
01 introduction to struts2Smita B Kumar
 
Struts2
Struts2Struts2
Struts2yuvalb
 
Step by Step Guide for building a simple Struts Application
Step by Step Guide for building a simple Struts ApplicationStep by Step Guide for building a simple Struts Application
Step by Step Guide for building a simple Struts Applicationelliando dias
 
Struts An Open-source Architecture for Web Applications
Struts An Open-source Architecture for Web ApplicationsStruts An Open-source Architecture for Web Applications
Struts An Open-source Architecture for Web Applicationselliando dias
 
Struts2 course chapter 1: Evolution of Web Applications
Struts2 course chapter 1: Evolution of Web ApplicationsStruts2 course chapter 1: Evolution of Web Applications
Struts2 course chapter 1: Evolution of Web ApplicationsJavaEE Trainers
 
Struts Introduction Course
Struts Introduction CourseStruts Introduction Course
Struts Introduction Courseguest764934
 

Mais procurados (20)

Struts Ppt 1
Struts Ppt 1Struts Ppt 1
Struts Ppt 1
 
Struts2 notes
Struts2 notesStruts2 notes
Struts2 notes
 
Struts 1
Struts 1Struts 1
Struts 1
 
01 introduction to struts2
01 introduction to struts201 introduction to struts2
01 introduction to struts2
 
Struts Basics
Struts BasicsStruts Basics
Struts Basics
 
Struts,Jsp,Servlet
Struts,Jsp,ServletStruts,Jsp,Servlet
Struts,Jsp,Servlet
 
Struts2
Struts2Struts2
Struts2
 
Struts ppt 1
Struts ppt 1Struts ppt 1
Struts ppt 1
 
Step by Step Guide for building a simple Struts Application
Step by Step Guide for building a simple Struts ApplicationStep by Step Guide for building a simple Struts Application
Step by Step Guide for building a simple Struts Application
 
Struts An Open-source Architecture for Web Applications
Struts An Open-source Architecture for Web ApplicationsStruts An Open-source Architecture for Web Applications
Struts An Open-source Architecture for Web Applications
 
Struts
StrutsStruts
Struts
 
Struts course material
Struts course materialStruts course material
Struts course material
 
Skillwise Struts.x
Skillwise Struts.xSkillwise Struts.x
Skillwise Struts.x
 
Struts2 course chapter 1: Evolution of Web Applications
Struts2 course chapter 1: Evolution of Web ApplicationsStruts2 course chapter 1: Evolution of Web Applications
Struts2 course chapter 1: Evolution of Web Applications
 
Struts
StrutsStruts
Struts
 
TY.BSc.IT Java QB U1
TY.BSc.IT Java QB U1TY.BSc.IT Java QB U1
TY.BSc.IT Java QB U1
 
TY.BSc.IT Java QB U6
TY.BSc.IT Java QB U6TY.BSc.IT Java QB U6
TY.BSc.IT Java QB U6
 
Struts Introduction Course
Struts Introduction CourseStruts Introduction Course
Struts Introduction Course
 
TY.BSc.IT Java QB U3
TY.BSc.IT Java QB U3TY.BSc.IT Java QB U3
TY.BSc.IT Java QB U3
 
Struts notes
Struts notesStruts notes
Struts notes
 

Destaque

ERP Implementation: Avoiding Common Pitfalls
ERP Implementation: Avoiding Common PitfallsERP Implementation: Avoiding Common Pitfalls
ERP Implementation: Avoiding Common PitfallsKirill Popadyuk
 
Rapid Deployment of ERP solutions using Lean & Agile Methods
Rapid Deployment of ERP solutions using Lean & Agile MethodsRapid Deployment of ERP solutions using Lean & Agile Methods
Rapid Deployment of ERP solutions using Lean & Agile MethodsHusni Roukbi
 
Top 10 Reasons to Choose Oracle ERP Cloud Financials
Top 10 Reasons to Choose Oracle ERP Cloud FinancialsTop 10 Reasons to Choose Oracle ERP Cloud Financials
Top 10 Reasons to Choose Oracle ERP Cloud FinancialsLiz Kensicki
 
12. Managing Risk Factors In Erp Implementation And Design
12. Managing Risk Factors In Erp Implementation And Design12. Managing Risk Factors In Erp Implementation And Design
12. Managing Risk Factors In Erp Implementation And DesignDonovan Mulder
 
Hidden cost of erp customization
Hidden cost of erp customizationHidden cost of erp customization
Hidden cost of erp customizationDrake Brown
 
Risk In Erp Implementation Projects
Risk In Erp Implementation ProjectsRisk In Erp Implementation Projects
Risk In Erp Implementation ProjectsAmarnath Gupta
 
ERP-Case Study- Changes before and after implementing ERP in a company
ERP-Case Study- Changes before and after implementing ERP in a companyERP-Case Study- Changes before and after implementing ERP in a company
ERP-Case Study- Changes before and after implementing ERP in a companyAniket Maithani
 
Air India - ERP Implementation Case Study
Air India - ERP Implementation Case StudyAir India - ERP Implementation Case Study
Air India - ERP Implementation Case StudyArgha Ray
 
Implementing Cloud Financials
Implementing Cloud FinancialsImplementing Cloud Financials
Implementing Cloud FinancialsNERUG
 

Destaque (10)

ERP Implementation: Avoiding Common Pitfalls
ERP Implementation: Avoiding Common PitfallsERP Implementation: Avoiding Common Pitfalls
ERP Implementation: Avoiding Common Pitfalls
 
Rapid Deployment of ERP solutions using Lean & Agile Methods
Rapid Deployment of ERP solutions using Lean & Agile MethodsRapid Deployment of ERP solutions using Lean & Agile Methods
Rapid Deployment of ERP solutions using Lean & Agile Methods
 
Top 10 Reasons to Choose Oracle ERP Cloud Financials
Top 10 Reasons to Choose Oracle ERP Cloud FinancialsTop 10 Reasons to Choose Oracle ERP Cloud Financials
Top 10 Reasons to Choose Oracle ERP Cloud Financials
 
12. Managing Risk Factors In Erp Implementation And Design
12. Managing Risk Factors In Erp Implementation And Design12. Managing Risk Factors In Erp Implementation And Design
12. Managing Risk Factors In Erp Implementation And Design
 
Hidden cost of erp customization
Hidden cost of erp customizationHidden cost of erp customization
Hidden cost of erp customization
 
Lesson Learned Report
Lesson Learned ReportLesson Learned Report
Lesson Learned Report
 
Risk In Erp Implementation Projects
Risk In Erp Implementation ProjectsRisk In Erp Implementation Projects
Risk In Erp Implementation Projects
 
ERP-Case Study- Changes before and after implementing ERP in a company
ERP-Case Study- Changes before and after implementing ERP in a companyERP-Case Study- Changes before and after implementing ERP in a company
ERP-Case Study- Changes before and after implementing ERP in a company
 
Air India - ERP Implementation Case Study
Air India - ERP Implementation Case StudyAir India - ERP Implementation Case Study
Air India - ERP Implementation Case Study
 
Implementing Cloud Financials
Implementing Cloud FinancialsImplementing Cloud Financials
Implementing Cloud Financials
 

Semelhante a Introducing Struts 2

ActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group PresentationActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group Presentationipolevoy
 
Practical catalyst
Practical catalystPractical catalyst
Practical catalystdwm042
 
AJAX Workshop Notes
AJAX Workshop NotesAJAX Workshop Notes
AJAX Workshop NotesPamela Fox
 
Migrating from Struts 1 to Struts 2
Migrating from Struts 1 to Struts 2Migrating from Struts 1 to Struts 2
Migrating from Struts 1 to Struts 2Matt Raible
 
Krazykoder struts2 interceptors
Krazykoder struts2 interceptorsKrazykoder struts2 interceptors
Krazykoder struts2 interceptorsKrazy Koder
 
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)Carles Farré
 
What's Coming in Spring 3.0
What's Coming in Spring 3.0What's Coming in Spring 3.0
What's Coming in Spring 3.0Matt Raible
 
Internet Explorer 8 for Developers by Christian Thilmany
Internet Explorer 8 for Developers by Christian ThilmanyInternet Explorer 8 for Developers by Christian Thilmany
Internet Explorer 8 for Developers by Christian ThilmanyChristian Thilmany
 
Introduction to Spring MVC
Introduction to Spring MVCIntroduction to Spring MVC
Introduction to Spring MVCRichard Paul
 
Introduction to JSF
Introduction toJSFIntroduction toJSF
Introduction to JSFSoftServe
 

Semelhante a Introducing Struts 2 (20)

Retrofitting
RetrofittingRetrofitting
Retrofitting
 
ActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group PresentationActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group Presentation
 
Practical catalyst
Practical catalystPractical catalyst
Practical catalyst
 
AJAX Workshop Notes
AJAX Workshop NotesAJAX Workshop Notes
AJAX Workshop Notes
 
Migrating from Struts 1 to Struts 2
Migrating from Struts 1 to Struts 2Migrating from Struts 1 to Struts 2
Migrating from Struts 1 to Struts 2
 
Struts2.0basic
Struts2.0basicStruts2.0basic
Struts2.0basic
 
Krazykoder struts2 interceptors
Krazykoder struts2 interceptorsKrazykoder struts2 interceptors
Krazykoder struts2 interceptors
 
Android best practices
Android best practicesAndroid best practices
Android best practices
 
Spine.js
Spine.jsSpine.js
Spine.js
 
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
 
Spring Surf 101
Spring Surf 101Spring Surf 101
Spring Surf 101
 
Struts Overview
Struts OverviewStruts Overview
Struts Overview
 
Jsfsunum
JsfsunumJsfsunum
Jsfsunum
 
What's Coming in Spring 3.0
What's Coming in Spring 3.0What's Coming in Spring 3.0
What's Coming in Spring 3.0
 
Internet Explorer 8 for Developers by Christian Thilmany
Internet Explorer 8 for Developers by Christian ThilmanyInternet Explorer 8 for Developers by Christian Thilmany
Internet Explorer 8 for Developers by Christian Thilmany
 
Introduction to Spring MVC
Introduction to Spring MVCIntroduction to Spring MVC
Introduction to Spring MVC
 
Struts2 - 101
Struts2 - 101Struts2 - 101
Struts2 - 101
 
Introduction to JSF
Introduction toJSFIntroduction toJSF
Introduction to JSF
 
Struts2 in a nutshell
Struts2 in a nutshellStruts2 in a nutshell
Struts2 in a nutshell
 
Jsp
JspJsp
Jsp
 

Mais de wiradikusuma

Practical OOP In Java
Practical OOP In JavaPractical OOP In Java
Practical OOP In Javawiradikusuma
 
Open Source And Java
Open Source And JavaOpen Source And Java
Open Source And Javawiradikusuma
 
Open Source is Not An Alternative, It is The Solution
Open Source is Not An Alternative, It is The SolutionOpen Source is Not An Alternative, It is The Solution
Open Source is Not An Alternative, It is The Solutionwiradikusuma
 
Spring 2.1 Exposed
Spring 2.1 ExposedSpring 2.1 Exposed
Spring 2.1 Exposedwiradikusuma
 
A Taste of Java ME
A Taste of Java MEA Taste of Java ME
A Taste of Java MEwiradikusuma
 

Mais de wiradikusuma (9)

Practical OOP In Java
Practical OOP In JavaPractical OOP In Java
Practical OOP In Java
 
Open Source And Java
Open Source And JavaOpen Source And Java
Open Source And Java
 
Open Source is Not An Alternative, It is The Solution
Open Source is Not An Alternative, It is The SolutionOpen Source is Not An Alternative, It is The Solution
Open Source is Not An Alternative, It is The Solution
 
Design Pattern
Design PatternDesign Pattern
Design Pattern
 
Spring 2.1 Exposed
Spring 2.1 ExposedSpring 2.1 Exposed
Spring 2.1 Exposed
 
A Taste of Java ME
A Taste of Java MEA Taste of Java ME
A Taste of Java ME
 
Subversion
SubversionSubversion
Subversion
 
Spring and DWR
Spring and DWRSpring and DWR
Spring and DWR
 
OOP in Java
OOP in JavaOOP in Java
OOP in Java
 

Último

Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusZilliz
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 

Último (20)

Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 

Introducing Struts 2

  • 1. Introducing Struts 2 JaMU 07.02 – February 24, 2007 Thomas Wiradikusuma (thomas@wiradikusuma.com) Java User Group Indonesia
  • 2.
  • 3.
  • 4.
  • 6.
  • 7. Interceptors <interceptor-stack name=&quot;xaStack&quot;> <interceptor-ref name=&quot;thisWillRunFirstInterceptor&quot;/> <interceptor-ref name=&quot;thisWillRunNextInterceptor&quot;/> <interceptor-ref name=&quot;followedByThisInterceptor&quot;/> <interceptor-ref name=&quot;thisWillRunLastInterceptor&quot;/> </interceptor-stack> thisWillRunFirstInterceptor thisWillRunNextInterceptor followedByThisInterceptor thisWillRunLastInterceptor MyAction1 MyAction2 (chain) MyPreResultListener MyResult (result) thisWillRunLastInterceptor followedByThisInterceptor thisWillRunNextInterceptor thisWillRunFirstInterceptor
  • 8. Interceptors, cont’d Checks for valid token presence in Action, prevents duplicate form submission. token Token And many more… Action will only be executed if the user has the correct JAAS role. roles Roles If the Action implements Preparable, calls its prepare method. prepare Prepare Sets the request parameters onto the Action. params Parameters Executes the Action in the background and then sends the user off to an intermediate waiting page. execAndWait Execute and Wait Adds automatic checkbox handling code that detect an unchecked checkbox and add it as a parameter with a default (usually 'false') value. Uses a specially named hidden field to detect unsubmitted checkboxes. checkbox Checkbox Description Name Interceptor
  • 9.
  • 10. Results Used for Velocity integration Velocity And many more… Used for Action Chaining Chain Used to stream an InputStream back to the browser (usually for file downloads) Stream Used to redirect to another action mapping Redirect Action Used to redirect to another URL (web resource) Redirect Used for web resource integration, including JSP integration Dispatcher Usage Result
  • 11.
  • 12.
  • 13. Configuration files Override the default Velocity configuration /WEB-INF/classes/ Yes velocity.properties Optional configuration files for plug-ins in the same format as struts.xml. Root of a plug-in JAR Yes struts-plugin.xml Default macros referenced by velocity.properties /WEB-INF/classes/ Yes struts-default.vm Default configuration provided by Struts /WEB-INF/lib/struts2-core.jar Yes struts-default.xml Framework properties /WEB-INF/classes/ Yes struts.properties Main configuration, contains result/view types, action mappings, interceptors, and so forth /WEB-INF/classes/ Yes struts.xml Deployment descriptor /WEB-INF/ No web.xml Purpose Location Optional? File
  • 14. Taglib <% User user = ActionContext.getContext() %> <form action=&quot;Profile_update.action&quot; method=&quot;post&quot;> <table> <tr> <td> align=&quot;right&quot;><label>First name:</label></td> <td><input type=&quot;text&quot; name=&quot;user.firstname&quot; value=&quot;<%=user.getFirstname() %> /></td> </tr> <tr> <td> <input type=&quot;radio&quot; name=&quot;user.gender&quot; value=&quot;0&quot; id=&quot;user.gender0&quot; <% if (user.getGender()==0) { %> checked=&quot;checked&quot; %> } %> /> <label for=&quot;user.gender0&quot;>Female</label> ... Without taglib (JSP): <s:actionerror/> <s:form action=&quot;Profile_update&quot; validate=&quot;true&quot;> <s:textfield label=&quot;Username&quot; name=&quot;username&quot;/> <s:password label=&quot;Password&quot; name=&quot;password&quot;/> <s:password label=&quot;(Repeat) Password&quot; name=&quot;password2&quot;/> <s:textfield label=&quot;Full Name&quot; name=&quot;fullName&quot;/> <s:textfield label=&quot;From Address&quot; name=&quot;fromAddress&quot;/> <s:textfield label=&quot;Reply To Address&quot; name=&quot;replyToAddress&quot;/> <s:submit value=&quot;Save&quot; name=&quot;Save&quot;/> <s:submit action=&quot;Register_cancel&quot; value=&quot;Cancel&quot; name=&quot;Cancel&quot; onclick=&quot;form.onsubmit=null&quot;/> </s:form> With taglib (JSP):
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20. Struts 1 to Struts 2 Despite the similar name (Struts), migrating from Struts 1 is harder than migrating from WebWork 2. struts.xml struts-config.xml Action or POJO ActionForm Action or POJO Action (singleton) {action}-validation.xml validation.xml Result ActionForward Interceptors RequestProcessor FilterDispatcher ActionServlet Struts 2 Struts 1
  • 21. WebWork 2 to Struts 2 Pretty much the same, only naming/namespace changes. <s:*/> <ww:*/> struts.xml xwork.xml struts.properties webwork.properties com.opensymphony.xwork2.* com.opensymphony.xwork.* “ struts” “ webwork” org.apache.struts2.* com.opensymphony.webwork.* Struts 2 WebWork 2
  • 22.
  • 23.
  • 24.
  • 25.