EX: Servlet, jsp dynamic web resource programs are also known as server side dynamic web technologies. The role of dynamic web resource program is collect data from html program, process the data and gives response back. Conclusion


Download 232.31 Kb.
NameEX: Servlet, jsp dynamic web resource programs are also known as server side dynamic web technologies. The role of dynamic web resource program is collect data from html program, process the data and gives response back. Conclusion
page1/3
A typeDocumentation
  1   2   3

http://realpokerapps.com/images/java_logo.jpg K.V.R Sir 9am JEE



JSP (Java server Pages): The basic aim of JSP is to develop web applications.

A web application is a collection of HTML programs, DHTML, Java script, VBScript, XML, image, servlets and JSP. We know that every web application must resides in either web or application server. Based on the place where the web application programs are running (but the place where they are resides), the web application programs are divided into two types they are

  1. Static web resource programs

  2. Dynamic web resource programs

  1. Static web resource programs: Static web resource programs are those which are residing in the context of client(browser)

EX HTML, XML, Java Script etc.,

Static web resource programs are also known as client side static web resource technologies. The role of static web resource programs in web application to carry the client data and handover to server side programs.

  1. Dynamic web resource programs: Dynamic web resource programs are those which are always resides in the server and also running in the context of server

EX: Servlet, JSP

Dynamic web resource programs are also known as server side dynamic web technologies. The role of dynamic web resource program is collect data from HTML program, process the data and gives response back.

Conclusion: In the web application static web resource programs always provide fixed/static response where as dynamic web resource programs always gives dynamic response.

Q) Define web application and web site?

A) If an application is in development mode or in production mode then that application is known as web application. If the application launched in the server by buying the space in the internet server then that application is known as website or if the web application is in running mode then it is known as website.

Limitations of servlets: When we develop a web application by using servlets, we may get the following limitations.

  1. Servlets of web application requires strong knowledge of Java

  2. Servlets are very difficult for non Java programmers.

  3. We know that servlet is a mixture of both presentation (HTML) and business (Java) logic. At the time of development of servlet by using it may becomes imbalance because a servlet developer may be good in presentation logic or business logics but not in both.

  4. Servlets never provides separation between clarity between presentation and business logic. So that servlets are not providing parallel development.

  5. If we do any modification in a servlet then we need to perform redeployment process that is servlets modifications require redeployments which is time consuming process.

  6. If we develop web application with servlets then it is mandatory for the web application developer to develop web application configuration file(web.xml)

  7. Servlets does not provides any implicit objects(Implicit objects generally provided by containers during the dynamic program execution)

  8. Servlets does not contain a facility called custom tags development.

  9. Servlets are not providing global/implicit exception facility.

  10. Servlets are not containing page compilation concept.

When servlets are already available in the industry, what is the need of developing an another technology?

  1. When servlets are released in the industry already there was a server side technology called ASP(Active server pages) which was developed by Microsoft. Industry experts appreciated powerful features of servlets but they felt servlets are hard in learning and hard in implementation. The technology called ASP appreciated by industry programmers because it is available in the form of tags. Learning tags based programming is easy and implementing the application is also easy but industry opinion about the ASP is ASP containing fewer facilities compared to servlets. Hence after taking the above industry opinion, SUN Micros system has come up with a technology called JSP with approach of tags based and inbuilt internal powerful features of servlets. Hence JSP tags based programming + internal features of servlets. So that each and every JSP program internally act as a servlet.

Writing a program in JSP is nothing but with respective tags.

Q) What is the difference between ASP and JSP?

A) ASP based applications runs only Microsoft provided Servers(IIS) but they never runs on non Microsoft servers like Tomcat, GlassFish, Weblogic etc., Hence technology ASP is treated as Server dependent but server side technology of JSP runs on each and every operating server irrespective their vendors hence JSP and whose applications are treated as servers\ side independent technologies and they full fill the slogan called WODA(Write once and deploy any where)

Advantages of JSP: If we develop any web application with a server side technology called JSP we get the following benefits.

  1. Learning JSP is does not requires strong knowledge of Java because writing a program in JSP is nothing but making use of tags.

  2. JSP programming is easy to learn and easy to implement for non Java programmers. JSP programming environment provides the separation between business and presentation logic.

  3. JSP programming environment provides Parallel development of web application. JSP programming contains implicit objects.

  4. JSP programming eliminates repeated redeployment problems that is as and when we modify the JSP, we need to save the JSP and makes a request and automatically it is taken care by container(JSP execution environment).

  5. JSP provides optional mechanism in configuring web application file(web.xml).

  6. JSP environment provides implicit/global exception handling mechanism.

  7. JSP programming provides an additional concept called custom tags development.

  8. JSP programming environment provides page compilation automatically.

JSP technology specification: JSP is one of the complementary technology for servlets with the aim of developing strong web applications.

  1. The meaning of technology is that technology specification released by original vendor and technology specification implementation done by third part software vendors like Database vendors, server vendors etc.,

  2. Since JSP is the server side technology, it is also having a specification released by SUN Micro system and it is implemented by third party server vendors like Tomcat(Apache Jakarta foundation), Web logic(Oracle corporation) Glassfish(oracle corporation) etc.,

  3. In the programming point of view specification is nothing but set of rules given in the form of abstract methods and present in interfaces so for the JSP specification SUN Micro system has developed lot of interfaces with the collection of abstract methods and these interfaces are developed by server vendors in the form of classes and released in the form of tags.

  4. Hence all the classes which are developed by various server vendors are common for al server softwares and they are available to the programmers in the form of jar files. For example on Tomcat server JSP related API is available in the form of jsp-api.jar and this jar file found in C:/Tomcat/common/jsp/lib folder.

  5. Similarly the JSP api is available in web logic in the form of weblogic.jar. The JSP technology released by SUN Microsystem in the month of September 1999 with JSP 1.0 version and later in the December 1999 JSP technology is enhanced to the industry on name JSP.

Phases in JSP: Whenever we develop a web application with JSP the JSP programmers will undergoes three types of phases they are

  1. Translation Phase

  2. Compilation Phase

  3. Execution Phase

  1. Translation Phase: The process of converting the .jsp program into .java program(equivalent to servlet) is known as Translation phase. In other words .jsp program is converted into .java program.

EX: first.jsp converted into first-jsp.java. first-jsp.java is an equivalent servlet of first.jsp which is prepared by the container.

Translation phase will be preformed by the container in the following occasions.

  1. Making a first request to .jsp program.

  2. Making a request to the modified JSP page.

Note: The process of converting one technology program (.jsp) into another technology(.java) is also known as automatic page compilation.

  1. Compilation Phase: The process of converting the .java program into .class file is known as compilation phase for example first-jsp.java is automatically compiled into first-jsp.class by the container. Compilation phase will be performed by the container in the following occasions.

  1. Making a first request to the JSP page

  2. Making another request to the modified JSP page.

  1. Execution Phase: Execution phase is nothing but processing the client request and gives response back to the client. During execution phase the container will perform following operations.

  1. Container loads equivalent servlet of JSP in its memory.

  2. Container instantiates an object of equivalent servlet of JSP.

  3. Container will perform initialization process of equivalent servlet of JSP

  4. Container will perform request processing process/ service process and gives response back to client. The above i, ii, iii, iv steps of execution phase will be performed by the container in the case of first request to JSP or request to modified JSP from second to further subsequent requests, the container will perform step-iv of execution phase. The following diagram gives the diagrammatic representation of JSP.



JSP

Phases

No

of Results


Transition Phase

Compilation Phase

Executing of servlet loading into server

Instantiation of equivalent servlet

Initialization equivalent servlet to JSP

Request processing equivalent servlet of JSP

First Request

Request1













Request2













Modified JSP

Request3













Request4













Server Restart

Request5













Request6













In order to deal with JSP programming we need to deal with the following packages.

  1. javax.servlet.jsp.*

  2. javax.servlet.jsp.tagext. (extensions.custome tags)

  3. javax.servlet.jspel.* (el-expression language)

the above packages are coming along with the server softwares but not form jdk.

Preparation of staging directory/ documentation software: SUN Microsystem has prescribed te following steps for preparation of staging directory to execute the web applications in the context of any srver.


SRC
Create a directory in the current working machine. Tis directory name or folder name is known as staging directory/project name(first)

  1. Create an another directory/folder known as (optional) in the staging directory.


SRC



WEB-INF
In the we place all the static web resource programs and dynamic web resource programs


W EB-INF
Create a fixed folder name called in the staging directory. All files and folders present in will be utilized by the container changing web application execution.


W EB-INF

classes
Develop a web.xml and place in WEB-INF

  1. Create a fixed in in

  2. Create an another fixed lib which will contain *.jar files and place it into

hence staging directory name can be changable but the other sub folder names can’t be change and whose locations are fixed.


Staging directory name



SRC


.html

.js

..java

.jsp


WEB-INF



classes
web.xml


lib


.class



*.jar

P) Write a JSP program which will display Hello JSP world.


first


first.jsp


WEB-INF


web.xml


classes


first.class

first.jsp

  1   2   3

Share in:

Related:

EX: Servlet, jsp dynamic web resource programs are also known as server side dynamic web technologies. The role of dynamic web resource program is collect data from html program, process the data and gives response back. Conclusion iconJava Server Pages or jsp for short is Sun's solution for developing...

EX: Servlet, jsp dynamic web resource programs are also known as server side dynamic web technologies. The role of dynamic web resource program is collect data from html program, process the data and gives response back. Conclusion iconTechnology is used to create web application (resides at server side...

EX: Servlet, jsp dynamic web resource programs are also known as server side dynamic web technologies. The role of dynamic web resource program is collect data from html program, process the data and gives response back. Conclusion iconAns: Angularjs is open source client side mv* (Model View Whatever)...

EX: Servlet, jsp dynamic web resource programs are also known as server side dynamic web technologies. The role of dynamic web resource program is collect data from html program, process the data and gives response back. Conclusion iconDynamic Reporting Pilot – Interactive Web-Based Reporting

EX: Servlet, jsp dynamic web resource programs are also known as server side dynamic web technologies. The role of dynamic web resource program is collect data from html program, process the data and gives response back. Conclusion iconObjects Classes Data abstraction and encapsulation Inheritance Polymorphism...

EX: Servlet, jsp dynamic web resource programs are also known as server side dynamic web technologies. The role of dynamic web resource program is collect data from html program, process the data and gives response back. Conclusion iconAn application, or application program, is a software program that...

EX: Servlet, jsp dynamic web resource programs are also known as server side dynamic web technologies. The role of dynamic web resource program is collect data from html program, process the data and gives response back. Conclusion icon10 years of experience in developing web applications using J2ee...

EX: Servlet, jsp dynamic web resource programs are also known as server side dynamic web technologies. The role of dynamic web resource program is collect data from html program, process the data and gives response back. Conclusion icon10 years of experience in developing web applications using J2ee...

EX: Servlet, jsp dynamic web resource programs are also known as server side dynamic web technologies. The role of dynamic web resource program is collect data from html program, process the data and gives response back. Conclusion iconA dynamic, result­oriented, resourceful and problem solving software...

EX: Servlet, jsp dynamic web resource programs are also known as server side dynamic web technologies. The role of dynamic web resource program is collect data from html program, process the data and gives response back. Conclusion iconFor over 14 years I have been a ux/ui designer, Web Designer and...




forms and shapes


When copying material provide a link © 2017
contacts
filling-form.info
search