Information About JSP, Servlets, Struts
Information About JSP, Servlets, Struts
Made by:
ALKESH KHARE
Contents
1 Introduction to JSP
1.1 Advantages
1.2 Disadvantages
1.3 JSP Example
1.3.1 Program for addition in JSP
1.3.2 JSP Program using Request Dispatcher
2 Introduction to Servlet
2.1 Advantages
2.2 Disadvantages
2.3 Servlet Example
2.3.1 Program for addition in Servlet
3 JSP & Servlet works in MVC Format
4 Introduction to Struts
4.1 Advantages
4.2 Disadvantages
4.3 Struts Example
4.3.1 Program for inserting data in Database
JavaServer Pages
Advantages of JSP
Disadvantages of JSP
JSP Example
We can be choose any smarter way of coding.
I choose NetBeans IDE 8.0.1 for making JSP
Programs. It provide a Software
Development Platform.
-Before preparing any jsp servlet program.
Many things we have to keep in mind that
which application server or web server we
are using(for example that I am using
application server of glassfish)
#addition.jsp
Output
Output:
#newjsp.jsp
Output
Output
Servlet
Aservletis aJavaprogramming
language class that is used to extend the
capabilities of servers that host
applications accessed by means of a
request-response programming model.
Althoughservletscan respond to any
type of request, they are commonly used
to extend the applications hosted by web
servers.
Advantages of Servlet
Disadvantages of Servlets
Servlet Example:
Program for addition in Servlet
#addition.java
(Servlet)
Output:
Output:
Struts
Strutsis the most popular framework for
developingJavabased web
applications.Strutsis being developed
as an open source project started by
Apache Software
Foundation .Strutsframework is based
on Model View Controller (MVC)
architecture.
Advantages of Struts
Disadvantages of struts
Harder to understand
Harder to benchmark and optimize
Rigid Approach.
The flip side of the benefit that Struts encourages a consistent approach to MVC is
that Struts makes it difficult (but by no means impossible) to use other approaches.
Set Server
#Insertbook.jsp
#Insertsuccess.jsp
#error.jsp
For creating
bookaction.java
For creating
bookaction.java
#bookaction.java
#bookaction.java
#bookaction.java
#bookaction.java
#bookactionform.java
#bookactionform.java
(for creating bookactionform(Strutsactionfrom) we have
to follow same procedure like bookaction(Strutsaction))
#bookactionform.java
#bookactionform.java
#ApplicationResource.propertie
s
#struts-config.xml
Output
Output
Conclusion
THANK-YOU