SlideShare a Scribd company logo
IMRAN DAUD
FOUNDATION UNIVERSITY
INSTITUTE OF MANAGEMENT AND
COMPUTER SCIENCES
Imran Daud
FUIMCS
Web Engineering
Struts
What is Struts?
 A framework based on MVC architecture.
Source: java.sun.com
Overview of Struts Application
Creating Struts Application
 Create web Project and select struts as framework.
Action Servlet
Name
Action URL
Pattern
Login.jsp
 Create Login jsp page.
 Add following taglibs i.e. html
 <%@ taglib uri="http://struts.apache.org/tags-html"
prefix="html" %>
 Add form using html
 <html:form action="/login">
 <html:submit value="Login" />
 </html:form>
 Add table using palette and two text fields using html
tag.
success.jsp
 Add bean tag at top of page by using strut bean
taglib.
 Now add following:
ActionForm Bean
 This bean used to persist data between requests.
 When user submits data, it is stored temporarily in
form bean. To be redisplayed in form page in case of
format problem or in success page.
 To add actionForm bean, create new actionForm
bean from strut category and give name
LoginForm.java.
 Add email variable in LoginForm.java bean and add
setter and getter functions.
 After that you can see changes appear in struts-
config.xml file.
Action Class
 When form is received, function of action object is
executed and data is processed. It also decides which
view to forward processed data.
 Create Action Class from wizard from struts category
by giving name LoginAction with following:
Same Path given
in form of login
page
 Associate action class with form bean (LoginForm.java) previously created.
 Delete forward slash from input resource.
 Set scope to Request.
 Deselect the Validate ActionForm Bean option
Validate Form
 Your LoginAction file will look like this:
 It redirects the request for success view.
 But is desirable to validate input before forwarding it to appropriate view.
Validate LoginAction
Adding forward Entries to struts-
config.xml
 In order for the application to match JSP pages with forwarding conditions
returned by LoginAction's execute method, you need to add forward entries to
the struts-config.xml file.
 Open struts-config.xml amd right click anywhere in file.
 select struts and add forward and add following:
Setting welcome page in web.xml
 Goto Page tab og web.xml file and change the
welcome file to login.jsp
 That’s it
Reference
 http://www.csl.mtu.edu/cs2321/
 Netbeans.org
 Roseindia.net
 Jsptut.com
 tutorialspoint.com/jsp
 http://java.sun.com

More Related Content

What's hot

View
ViewView
Action Guide Reg Process
Action Guide Reg ProcessAction Guide Reg Process
Action Guide Reg Process
celeroo
 
CDP Proposal
CDP ProposalCDP Proposal
CDP Proposaltectonar
 
Lab 2: Importing requirements artifacts from a CSV file
Lab 2: Importing requirements artifacts from a CSV file Lab 2: Importing requirements artifacts from a CSV file
Lab 2: Importing requirements artifacts from a CSV file
IBM Rational software
 
Metamorphosis from Forms to Java: A technical lead's perspective, part II
Metamorphosis from Forms to Java:  A technical lead's perspective, part IIMetamorphosis from Forms to Java:  A technical lead's perspective, part II
Metamorphosis from Forms to Java: A technical lead's perspective, part II
Michael Fons
 
The Ultimate Guide to Ad0 e904 adobe workfront core developer certified exper...
The Ultimate Guide to Ad0 e904 adobe workfront core developer certified exper...The Ultimate Guide to Ad0 e904 adobe workfront core developer certified exper...
The Ultimate Guide to Ad0 e904 adobe workfront core developer certified exper...
ParshantiniRoy
 
Oracle Forms Creation
Oracle Forms CreationOracle Forms Creation
Oracle Forms Creation
Sekhar Byna
 
Sharepoint 2013
Sharepoint 2013Sharepoint 2013
Sharepoint 2013
Iqbal Bocus
 

What's hot (11)

View
ViewView
View
 
Ppt ch11
Ppt ch11Ppt ch11
Ppt ch11
 
Les04
Les04Les04
Les04
 
Action Guide Reg Process
Action Guide Reg ProcessAction Guide Reg Process
Action Guide Reg Process
 
CDP Proposal
CDP ProposalCDP Proposal
CDP Proposal
 
Lab 2: Importing requirements artifacts from a CSV file
Lab 2: Importing requirements artifacts from a CSV file Lab 2: Importing requirements artifacts from a CSV file
Lab 2: Importing requirements artifacts from a CSV file
 
Metamorphosis from Forms to Java: A technical lead's perspective, part II
Metamorphosis from Forms to Java:  A technical lead's perspective, part IIMetamorphosis from Forms to Java:  A technical lead's perspective, part II
Metamorphosis from Forms to Java: A technical lead's perspective, part II
 
The Ultimate Guide to Ad0 e904 adobe workfront core developer certified exper...
The Ultimate Guide to Ad0 e904 adobe workfront core developer certified exper...The Ultimate Guide to Ad0 e904 adobe workfront core developer certified exper...
The Ultimate Guide to Ad0 e904 adobe workfront core developer certified exper...
 
Les02
Les02Les02
Les02
 
Oracle Forms Creation
Oracle Forms CreationOracle Forms Creation
Oracle Forms Creation
 
Sharepoint 2013
Sharepoint 2013Sharepoint 2013
Sharepoint 2013
 

Viewers also liked

8. java script
8. java script8. java script
8. java script
AnusAhmad
 
9. java server faces
9. java server faces9. java server faces
9. java server faces
AnusAhmad
 
Pesquisa cnt mda_relatorio sintese - cnt junho2013 - r113 - final
Pesquisa cnt mda_relatorio sintese - cnt junho2013 - r113 - finalPesquisa cnt mda_relatorio sintese - cnt junho2013 - r113 - final
Pesquisa cnt mda_relatorio sintese - cnt junho2013 - r113 - finalFolha de Pernambuco
 
Resource management
Resource managementResource management
Resource managementmbondgulo
 
Paula ardila actividad1_mapc
Paula ardila actividad1_mapcPaula ardila actividad1_mapc
Paula ardila actividad1_mapc
andrea_ardila
 
Vijay Pandit Palam
Vijay Pandit PalamVijay Pandit Palam
Vijay Pandit Palam
Vijay Pandit
 
Trabajo grupal 4⺠e.p. grupo b 12. espaã±a en la edad contemporã¡nea (1)
Trabajo grupal 4⺠e.p. grupo b 12. espaã±a en la edad contemporã¡nea  (1)Trabajo grupal 4⺠e.p. grupo b 12. espaã±a en la edad contemporã¡nea  (1)
Trabajo grupal 4⺠e.p. grupo b 12. espaã±a en la edad contemporã¡nea (1)
Richy Perez
 
1 tg tecnicas de combate al contrabando en fronteras del estado zulia - ruben -
1 tg  tecnicas de combate al contrabando en fronteras del estado zulia - ruben -1 tg  tecnicas de combate al contrabando en fronteras del estado zulia - ruben -
1 tg tecnicas de combate al contrabando en fronteras del estado zulia - ruben -
ruben10637348
 
Rede mundo maior´ apresentação
Rede mundo maior´  apresentaçãoRede mundo maior´  apresentação
Rede mundo maior´ apresentaçãoMagali Bischoff
 
Where to start with power cli
Where to start with power cliWhere to start with power cli
Where to start with power cliChris Halverson
 

Viewers also liked (13)

8. java script
8. java script8. java script
8. java script
 
9. java server faces
9. java server faces9. java server faces
9. java server faces
 
Pesquisa cnt mda_relatorio sintese - cnt junho2013 - r113 - final
Pesquisa cnt mda_relatorio sintese - cnt junho2013 - r113 - finalPesquisa cnt mda_relatorio sintese - cnt junho2013 - r113 - final
Pesquisa cnt mda_relatorio sintese - cnt junho2013 - r113 - final
 
Resource management
Resource managementResource management
Resource management
 
De Eerstelijns Juni 2013
De Eerstelijns Juni 2013De Eerstelijns Juni 2013
De Eerstelijns Juni 2013
 
Paula ardila actividad1_mapc
Paula ardila actividad1_mapcPaula ardila actividad1_mapc
Paula ardila actividad1_mapc
 
Vijay Pandit Palam
Vijay Pandit PalamVijay Pandit Palam
Vijay Pandit Palam
 
Trabajo grupal 4⺠e.p. grupo b 12. espaã±a en la edad contemporã¡nea (1)
Trabajo grupal 4⺠e.p. grupo b 12. espaã±a en la edad contemporã¡nea  (1)Trabajo grupal 4⺠e.p. grupo b 12. espaã±a en la edad contemporã¡nea  (1)
Trabajo grupal 4⺠e.p. grupo b 12. espaã±a en la edad contemporã¡nea (1)
 
1 tg tecnicas de combate al contrabando en fronteras del estado zulia - ruben -
1 tg  tecnicas de combate al contrabando en fronteras del estado zulia - ruben -1 tg  tecnicas de combate al contrabando en fronteras del estado zulia - ruben -
1 tg tecnicas de combate al contrabando en fronteras del estado zulia - ruben -
 
Resolución 030 2015
Resolución 030 2015Resolución 030 2015
Resolución 030 2015
 
Rede mundo maior´ apresentação
Rede mundo maior´  apresentaçãoRede mundo maior´  apresentação
Rede mundo maior´ apresentação
 
Filósofos solares
Filósofos solaresFilósofos solares
Filósofos solares
 
Where to start with power cli
Where to start with power cliWhere to start with power cli
Where to start with power cli
 

Similar to 7. struts

08052917365603
0805291736560308052917365603
08052917365603DSKUMAR G
 
Cis407 a ilab 6 web application development devry university
Cis407 a ilab 6 web application development devry universityCis407 a ilab 6 web application development devry university
Cis407 a ilab 6 web application development devry universitylhkslkdh89009
 
Struts tutorial
Struts tutorialStruts tutorial
Struts tutorial
OPENLANE
 
MVC Training Part 1
MVC Training Part 1MVC Training Part 1
MVC Training Part 1
Lee Englestone
 
Claims based authentication in share point 2010 .new
Claims based authentication in share point 2010 .newClaims based authentication in share point 2010 .new
Claims based authentication in share point 2010 .new
RavikantChaturvedi
 
Cis407 a ilab 3 web application development devry university
Cis407 a ilab 3 web application development devry universityCis407 a ilab 3 web application development devry university
Cis407 a ilab 3 web application development devry universitylhkslkdh89009
 
Parallelminds.asp.net with sp
Parallelminds.asp.net with spParallelminds.asp.net with sp
Parallelminds.asp.net with sp
parallelminder
 
06 asp.net session08
06 asp.net session0806 asp.net session08
06 asp.net session08
Vivek chan
 
Chapter12 (1)
Chapter12 (1)Chapter12 (1)
Chapter12 (1)
Rajalaxmi Pattanaik
 
CTTDNUG ASP.NET MVC
CTTDNUG ASP.NET MVCCTTDNUG ASP.NET MVC
CTTDNUG ASP.NET MVC
Barry Gervin
 
Open microsoft visual studio/tutorialoutlet
Open microsoft visual studio/tutorialoutletOpen microsoft visual studio/tutorialoutlet
Open microsoft visual studio/tutorialoutlet
Mitchinson
 
Oracle ADF 11g Tutorial
Oracle ADF 11g TutorialOracle ADF 11g Tutorial
Oracle ADF 11g Tutorial
Rakesh Gujjarlapudi
 
Introduction To Mvc
Introduction To MvcIntroduction To Mvc
Introduction To Mvc
Volkan Uzun
 
06 asp.net session08
06 asp.net session0806 asp.net session08
06 asp.net session08Mani Chaubey
 

Similar to 7. struts (20)

Jsf
JsfJsf
Jsf
 
08052917365603
0805291736560308052917365603
08052917365603
 
Struts Intro
Struts IntroStruts Intro
Struts Intro
 
Struts Overview
Struts OverviewStruts Overview
Struts Overview
 
Cis407 a ilab 6 web application development devry university
Cis407 a ilab 6 web application development devry universityCis407 a ilab 6 web application development devry university
Cis407 a ilab 6 web application development devry university
 
Struts tutorial
Struts tutorialStruts tutorial
Struts tutorial
 
MVC Training Part 1
MVC Training Part 1MVC Training Part 1
MVC Training Part 1
 
Claims based authentication in share point 2010 .new
Claims based authentication in share point 2010 .newClaims based authentication in share point 2010 .new
Claims based authentication in share point 2010 .new
 
Cis407 a ilab 3 web application development devry university
Cis407 a ilab 3 web application development devry universityCis407 a ilab 3 web application development devry university
Cis407 a ilab 3 web application development devry university
 
Parallelminds.asp.net with sp
Parallelminds.asp.net with spParallelminds.asp.net with sp
Parallelminds.asp.net with sp
 
06 asp.net session08
06 asp.net session0806 asp.net session08
06 asp.net session08
 
Chapter12 (1)
Chapter12 (1)Chapter12 (1)
Chapter12 (1)
 
CTTDNUG ASP.NET MVC
CTTDNUG ASP.NET MVCCTTDNUG ASP.NET MVC
CTTDNUG ASP.NET MVC
 
Open microsoft visual studio/tutorialoutlet
Open microsoft visual studio/tutorialoutletOpen microsoft visual studio/tutorialoutlet
Open microsoft visual studio/tutorialoutlet
 
Oracle ADF 11g Tutorial
Oracle ADF 11g TutorialOracle ADF 11g Tutorial
Oracle ADF 11g Tutorial
 
Struts N E W
Struts N E WStruts N E W
Struts N E W
 
Web forms in ASP.net
Web forms in ASP.netWeb forms in ASP.net
Web forms in ASP.net
 
Jsf intro
Jsf introJsf intro
Jsf intro
 
Introduction To Mvc
Introduction To MvcIntroduction To Mvc
Introduction To Mvc
 
06 asp.net session08
06 asp.net session0806 asp.net session08
06 asp.net session08
 

More from AnusAhmad

[Www.pkbulk.blogspot.com]file and indexing
[Www.pkbulk.blogspot.com]file and indexing[Www.pkbulk.blogspot.com]file and indexing
[Www.pkbulk.blogspot.com]file and indexing
AnusAhmad
 
[Www.pkbulk.blogspot.com]dbms12
[Www.pkbulk.blogspot.com]dbms12[Www.pkbulk.blogspot.com]dbms12
[Www.pkbulk.blogspot.com]dbms12
AnusAhmad
 
[Www.pkbulk.blogspot.com]dbms11
[Www.pkbulk.blogspot.com]dbms11[Www.pkbulk.blogspot.com]dbms11
[Www.pkbulk.blogspot.com]dbms11
AnusAhmad
 
[Www.pkbulk.blogspot.com]dbms10
[Www.pkbulk.blogspot.com]dbms10[Www.pkbulk.blogspot.com]dbms10
[Www.pkbulk.blogspot.com]dbms10
AnusAhmad
 
[Www.pkbulk.blogspot.com]dbms09
[Www.pkbulk.blogspot.com]dbms09[Www.pkbulk.blogspot.com]dbms09
[Www.pkbulk.blogspot.com]dbms09
AnusAhmad
 
[Www.pkbulk.blogspot.com]dbms07
[Www.pkbulk.blogspot.com]dbms07[Www.pkbulk.blogspot.com]dbms07
[Www.pkbulk.blogspot.com]dbms07
AnusAhmad
 
[Www.pkbulk.blogspot.com]dbms06
[Www.pkbulk.blogspot.com]dbms06[Www.pkbulk.blogspot.com]dbms06
[Www.pkbulk.blogspot.com]dbms06
AnusAhmad
 
[Www.pkbulk.blogspot.com]dbms05
[Www.pkbulk.blogspot.com]dbms05[Www.pkbulk.blogspot.com]dbms05
[Www.pkbulk.blogspot.com]dbms05
AnusAhmad
 
[Www.pkbulk.blogspot.com]dbms04
[Www.pkbulk.blogspot.com]dbms04[Www.pkbulk.blogspot.com]dbms04
[Www.pkbulk.blogspot.com]dbms04
AnusAhmad
 
[Www.pkbulk.blogspot.com]dbms03
[Www.pkbulk.blogspot.com]dbms03[Www.pkbulk.blogspot.com]dbms03
[Www.pkbulk.blogspot.com]dbms03
AnusAhmad
 
[Www.pkbulk.blogspot.com]dbms02
[Www.pkbulk.blogspot.com]dbms02[Www.pkbulk.blogspot.com]dbms02
[Www.pkbulk.blogspot.com]dbms02
AnusAhmad
 
[Www.pkbulk.blogspot.com]dbms01
[Www.pkbulk.blogspot.com]dbms01[Www.pkbulk.blogspot.com]dbms01
[Www.pkbulk.blogspot.com]dbms01
AnusAhmad
 
[Www.pkbulk.blogspot.com]dbms13
[Www.pkbulk.blogspot.com]dbms13[Www.pkbulk.blogspot.com]dbms13
[Www.pkbulk.blogspot.com]dbms13
AnusAhmad
 
5. servlets
5. servlets5. servlets
5. servlets
AnusAhmad
 
4. jsp
4. jsp4. jsp
4. jsp
AnusAhmad
 
3. applets
3. applets3. applets
3. applets
AnusAhmad
 
2. http, html
2. http, html2. http, html
2. http, html
AnusAhmad
 
1. intro
1. intro1. intro
1. intro
AnusAhmad
 
6. hibernate
6. hibernate6. hibernate
6. hibernate
AnusAhmad
 

More from AnusAhmad (19)

[Www.pkbulk.blogspot.com]file and indexing
[Www.pkbulk.blogspot.com]file and indexing[Www.pkbulk.blogspot.com]file and indexing
[Www.pkbulk.blogspot.com]file and indexing
 
[Www.pkbulk.blogspot.com]dbms12
[Www.pkbulk.blogspot.com]dbms12[Www.pkbulk.blogspot.com]dbms12
[Www.pkbulk.blogspot.com]dbms12
 
[Www.pkbulk.blogspot.com]dbms11
[Www.pkbulk.blogspot.com]dbms11[Www.pkbulk.blogspot.com]dbms11
[Www.pkbulk.blogspot.com]dbms11
 
[Www.pkbulk.blogspot.com]dbms10
[Www.pkbulk.blogspot.com]dbms10[Www.pkbulk.blogspot.com]dbms10
[Www.pkbulk.blogspot.com]dbms10
 
[Www.pkbulk.blogspot.com]dbms09
[Www.pkbulk.blogspot.com]dbms09[Www.pkbulk.blogspot.com]dbms09
[Www.pkbulk.blogspot.com]dbms09
 
[Www.pkbulk.blogspot.com]dbms07
[Www.pkbulk.blogspot.com]dbms07[Www.pkbulk.blogspot.com]dbms07
[Www.pkbulk.blogspot.com]dbms07
 
[Www.pkbulk.blogspot.com]dbms06
[Www.pkbulk.blogspot.com]dbms06[Www.pkbulk.blogspot.com]dbms06
[Www.pkbulk.blogspot.com]dbms06
 
[Www.pkbulk.blogspot.com]dbms05
[Www.pkbulk.blogspot.com]dbms05[Www.pkbulk.blogspot.com]dbms05
[Www.pkbulk.blogspot.com]dbms05
 
[Www.pkbulk.blogspot.com]dbms04
[Www.pkbulk.blogspot.com]dbms04[Www.pkbulk.blogspot.com]dbms04
[Www.pkbulk.blogspot.com]dbms04
 
[Www.pkbulk.blogspot.com]dbms03
[Www.pkbulk.blogspot.com]dbms03[Www.pkbulk.blogspot.com]dbms03
[Www.pkbulk.blogspot.com]dbms03
 
[Www.pkbulk.blogspot.com]dbms02
[Www.pkbulk.blogspot.com]dbms02[Www.pkbulk.blogspot.com]dbms02
[Www.pkbulk.blogspot.com]dbms02
 
[Www.pkbulk.blogspot.com]dbms01
[Www.pkbulk.blogspot.com]dbms01[Www.pkbulk.blogspot.com]dbms01
[Www.pkbulk.blogspot.com]dbms01
 
[Www.pkbulk.blogspot.com]dbms13
[Www.pkbulk.blogspot.com]dbms13[Www.pkbulk.blogspot.com]dbms13
[Www.pkbulk.blogspot.com]dbms13
 
5. servlets
5. servlets5. servlets
5. servlets
 
4. jsp
4. jsp4. jsp
4. jsp
 
3. applets
3. applets3. applets
3. applets
 
2. http, html
2. http, html2. http, html
2. http, html
 
1. intro
1. intro1. intro
1. intro
 
6. hibernate
6. hibernate6. hibernate
6. hibernate
 

Recently uploaded

Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 

Recently uploaded (20)

Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 

7. struts

  • 1. IMRAN DAUD FOUNDATION UNIVERSITY INSTITUTE OF MANAGEMENT AND COMPUTER SCIENCES Imran Daud FUIMCS Web Engineering Struts
  • 2. What is Struts?  A framework based on MVC architecture. Source: java.sun.com
  • 3. Overview of Struts Application
  • 4. Creating Struts Application  Create web Project and select struts as framework. Action Servlet Name Action URL Pattern
  • 5. Login.jsp  Create Login jsp page.  Add following taglibs i.e. html  <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>  Add form using html  <html:form action="/login">  <html:submit value="Login" />  </html:form>  Add table using palette and two text fields using html tag.
  • 6. success.jsp  Add bean tag at top of page by using strut bean taglib.  Now add following:
  • 7. ActionForm Bean  This bean used to persist data between requests.  When user submits data, it is stored temporarily in form bean. To be redisplayed in form page in case of format problem or in success page.  To add actionForm bean, create new actionForm bean from strut category and give name LoginForm.java.  Add email variable in LoginForm.java bean and add setter and getter functions.  After that you can see changes appear in struts- config.xml file.
  • 8. Action Class  When form is received, function of action object is executed and data is processed. It also decides which view to forward processed data.  Create Action Class from wizard from struts category by giving name LoginAction with following: Same Path given in form of login page
  • 9.  Associate action class with form bean (LoginForm.java) previously created.  Delete forward slash from input resource.  Set scope to Request.  Deselect the Validate ActionForm Bean option
  • 10. Validate Form  Your LoginAction file will look like this:  It redirects the request for success view.  But is desirable to validate input before forwarding it to appropriate view.
  • 12. Adding forward Entries to struts- config.xml  In order for the application to match JSP pages with forwarding conditions returned by LoginAction's execute method, you need to add forward entries to the struts-config.xml file.  Open struts-config.xml amd right click anywhere in file.  select struts and add forward and add following:
  • 13. Setting welcome page in web.xml  Goto Page tab og web.xml file and change the welcome file to login.jsp  That’s it
  • 14. Reference  http://www.csl.mtu.edu/cs2321/  Netbeans.org  Roseindia.net  Jsptut.com  tutorialspoint.com/jsp  http://java.sun.com