Download as pdf or txt
Download as pdf or txt
You are on page 1of 71

JSP- Java Server Pages

E. Swathi, CSE, CBIT


JSP Basics
➢ Introduction to JSP
➢ Directives
➢ Scripting Elements
➢ Standard Objects
➢ Design Strategies.

E. Swathi, CSE, CBIT


Introduction to JSP (Java Server Pages)
➢ JSP stands for Java Server Pages.
➢ JSP is another server side technology which does all the processing at
server. Creates dynamic web applications.
➢ Any html file can be converted into the JSP by changing extension .html to
.jsp
➢ JSP is used to present data to the end user.
➢ JSP Embed java code in html.

E. Swathi, CSE, CBIT


Drawbacks in servlets
1. Suppose your project has 100 servlets we required to configure 100
sevlets in web.xml file means we required to configure sevlet-
name,servlet-class and url-pattern
2. Any changes in servlet program requires recompilation and redeployment
3. To develop servlets developer should know the java code.
4. Presenting data with the servlets to user is very slow.
5. Difficult to maintain and code.

E. Swathi, CSE, CBIT


Difference between servlets and jsp

Servlets JSP
1. Process request of the end user ( 1. Presents data to the end
business logic layer) user(Presentation layer)

2. Any changes in servlet code required to 2. Any changes in jsp code handled by
recomple and re deploy web container no need of re complilation
and re-deployment
3. It requires .class files and web.xml 3. .class files and web.xml are not required
4. Slow process 4. Faster than servlets
5. HTML code inside Java code(java with 5. Java code inside HTML(html with java)
html)

E. Swathi, CSE, CBIT


E. Swathi, CSE, CBIT
Steps required for a JSP request:

1. The user goes to a JSP page (ending with .jsp). The web browser makes the
request via the Internet.

2. The JSP request gets sent to the Web server.

3. The Web server recognizes that the file required is special (.jsp), therefore passes
the JSP file to the JSP Servlet Engine.

4. If the JSP file has been called the first time, the JSP file is parsed, otherwise go to
step 7.
5. The next step is to generate a special Servlet from the JSP file. All the HTML
required is converted to println statements.
6. The Servlet source code is compiled into a class.
7. The Servlet is instantiated, calling the init and service methods.
8. HTML from the Servlet output is sent via the Internet.
9. HTML results are displayed on the user’s web browser.

E. Swathi, CSE, CBIT


E. Swathi, CSE, CBIT
Jsp life cycle
JSP life cycle

• there are three methods automatically called when a JSP is requested and
terminated.
• 1. jspInt()
• 2. jspDestroy()
• 3. _jspService().

• jspInt() and jspDestroy() both are same as init() and destroy() methods in
servlets.
• Service() method is automatically called and retrieves a connection to
HTTP.
1. JSPs are essential an HTML page with special JSP tags embedded.
These JSP tags can contain Java code.

2. The JSP file extension is .jsp rather than .htm or .html. The JSP engine
parses the .jsp and creates a Java servlet source file.

3. It then compiles the source file into a class file.

4. This is done the first time and this why the JSP is probably slower the
first time it is accessed. Any time after this the special compiled
servlet is executed and is therefore returns faster.
JSP Scripting elements
• Java server pages are written by embedding java code inside html.
• Scripting elements are used to write java code inside the html.
• JSP Scripting elements are written inside <% %> tags.
• These code inside <% %> tags are processed by the JSP engine during
translation of the JSP page.
• Any other text in the JSP page is considered as HTML code or plain text.
• Five different types of Scripting elements
Scripting elements Symbols
comments <%-- --%>
directive <%@ %>
declaration <%! %>
scriptlet <% %>
expression <%= %>

E. Swathi, CSE, CBIT


1. Comment tag- <%-- --%>
this tag used to describe the functionality of the
statement.
<%-- this program is JSP program --%>
these tags never visible on browser whereas
html tag is visible on browser.

E. Swathi, CSE, CBIT


Scriptlet Tag
used to execute java code in jsp
- syntax is <% java code %>
Example
<html>
<head>
<title>Welcome JSP</title>
</head>
<body
<% out.println(“Welcome to JSP Technologies”); %>
</body>
</html>

E. Swathi, CSE, CBIT


Write a JSP code to print the user name enter in the text field
1. index.html 2. welcome.jsp
welcome.jsp
Index.html
<html>
<html>
<body>
<body>
<h2>
<form action="welcome.jsp“>
<%
<input type="text" name="uname“/>
String name=request.getParameter("uname");
<input type="submit" value="go“/><br/>
out.print("welcome to "+name);
</form>
%>
</body>
</h2>
</html>
</body>
</html>

E. Swathi, CSE, CBIT


Declaration tag
- Declare variables and methods used in java code and later in JSP
- <%! declaration; %>
example

<%! int i = 0; %>


<%! int a, b, c; %>
<%! Circle a = new Circle(2.0); %>
Expression tag
- This tag allows the developer to embed any Java expression that is evaluated
and is short for out.println().
- used to print the variable values and methods
-A semicolon ( ; ) does not appear at the end of the code inside the tag.
- For example, if we have a variable count=10;
- And we want it to be displayed in a jsp file, normally we will write the
following
- <% out.println(count); %>

• Instead of the above we can write the following


• <%= count %>
Example of expression tag
<html>
<body>
<%=“welcome to jsp”%>
</body>
</html>
Jsp tag that prints the user name
Directive tags
• Directive tags <%@ directive … %>)
- Tells the web container that how to translate jsp page into
corresponding servlet .
- <%@ directive attribute="value" %>
- specifies the attributes of the page like what type of content
is produced by page.
- page buffering requirements
- declaration of other resources used by the page
- how possible runtime errors should be handle
three type of directives
1. page directive- import packages, session tracking, error
page
2. Include directive- define files required during translation
3. Taglib directive- defines tag library, and custom tag used
in the page.

E. Swathi, CSE, CBIT


1. Page directive
- defines attributes required for the current jsp page like import packages,
session tracking, error page.
- <%@ page attribute="value" %>

i). import: Import all the classes in a java package into the current JSP
page. This allows the JSP page to use other java classes.

<%@ page import = “java.util.*” %>


ii). language : Which language the file uses.
<%@ page language = “java” %>

iii). contentType – content type of response tells to browser


<%@ page contentType = “text/html” %>
iv). errorPage- defines the url of the page that reports the runtime exceptions of the
page. <%@ page errorPage="error.jsp" %>
v) session- specifies whether the jsp page participated in Http session or not.
<%@ page session=“true" %>
vi) isErrorPage : is current jsp page represents another error page.
Include directive
• Used to includes required files during translation phase.

• Tells the container that merge the external files like text file, jsp file or html
in the current jsp page.

• <%@ include file="relative url" >

//welcome.jsp
<html> <head>
<title>Welcome Page</title>
</head>
<body>
<%@ include file="header.jsp" %>
Welcome, User //header.jsp
</body> </html> <html>
<body>
<img src="header.jpg" alt="This is Header image" / >
</body> </html>
Taglib directive
• Tag library is set of user defined tags.
• JSP API allows you to define custom tags they look like html or xml tags.
• Taglib declares that your JSP page uses a set of custom tags, identifies the
location of the custom tags.
• <%@ taglib uri="uri" prefix="prefixOfTag" >
- uri attribute specifies the location of the custom tag.
- prefix- markup or short name.
Example on taglib directive
• In this example we are using the tag currentDate. To use this tag specify the
taglib so the container get information about this tag.
Standard actions
• Standard actions are well known tags that effect runtime behaviour of the
jsp and the response sent back to the client
• Predefined tags in jsp
Action tag Meaning
<jsp:useBean> Instantiate a JavaBean or locates existing
bean instance.
<jsp:useBean id="beanId" />
<jsp:getProperty> Get properties of java bean
<jsp:useBean id="beanId" ... /> ...
<jsp:getProperty name="beanId"
property="someProperty" .../>
<jsp:setProperty> sets the value of property in bean object.
<jsp:include> Includes another resources in current page at
runtime
<jsp:plugin> Embeds other components such as applets
<jsp:forward> Forwards request to another jsp
<jsp:param> sets the parameter value. It is used in
forward and include mostly.
E. Swathi, CSE, CBIT
<jsp:include> Example
includeAction.jsp
<html>
<head> //welcome.jsp
<html>
<title>include Action test</title>
<body>
<body> <h2>
<h1>include action example</h1> <% out.print("welcome to CBIT");
<h2>include directive</h2> %>
<%@ include file="welcome.jsp"%> </h2>
</body>
<h2> using include action</h2>
</html>
<jsp:include page="welcome.jsp"/>
</body>
</html>
Go to foloder includeAction

E. Swathi, CSE, CBIT


Implicit objects/predefined variables.

• JSP Implicit objects are java objects


that the JSP container makes the
developer to use in the JSP page.

• These objects are directly called


without being explicitly declared.

E. Swathi, CSE, CBIT


• They are nine implicit objects
request implicit object
➢ instance of a
javax.servlet.http.HttpServletRequest object. Firstpage.html
<html>
<body>
➢ when a client request a page JSP engine create
<form action=“welcome.jsp”>
a new object to represent the request.
<input type=“text” name=“uname”>
<input type= “submit” value=“go”></br>
</form>
</body>
</html>

welcome.jsp
<html>
<body>
<%
String name= request.getParameter(“uname”);
out.println(“welcome to”+name);
%>
</body>
</html>
response implicit object
• instance of javax.servlet.http.HttpServletResponse object.
• Server creates an object to represent the response to the
client.
Firstpage.html
<html>
<body>
<form action=“welcome.jsp”>
<input type=“text” name=“uname”>
<input type= “submit” value=“go”></br>
</form>
</body> welcome.jsp
</html> <html>
<body>
<%
response.sendRedirect(http://www.google.com);
%>
</body>
</html>
out implicit object
➢ instance of a javax.servlet.jsp.JspWriter object.

➢ Send content in response to client.

➢ JspWriter same as the PrintWriter class

➢ JspWriter has extra methods regarding buffering.

➢ This is instantiated depends on the whether the page is


buffered or not.

example
<html>
<body>
<% out.print(“ today is”+java.util.Calander.getInstance().getTime());
%>
session
➢ used to track client across multiple client requests.

➢ instance of javax.servlet.http.HttpSession

➢ Whenever we request a JSP page, container automatically


creates a session for the JSP in the service method.

➢ session management is heavy process, don’t want to create


session object for the jsp page we can use page directive with
session attribute.

➢ <%@ page session="false" %>


➢ <%=session.getId() %>
Methods of session object
• setAttribute(String, object)
• getAttribute(String name)
• removeAttribute(String name)
• getAttributeNames()
• getCreationTime()
• getId()
• isNew()
• invalidate()
• getMaxInactiveInterval()
• getLastAccessedTime()
application
• instance of a javax.servlet.ServletContext object.

• Created when jsp page is initialized and removed when jsp page
is terminated(jspDestroy()) method.

• Used to get information from configuration file (web.xml)


<context-param>

• Access information about their environment

• With this object you can count the number of times a site is
visited.
<%=application.getInitParameter("User") %>
<%@ page import="java.io.*,java.util.*" %>
application example
<html>
<head>
<title>Applcation object in JSP</title>
</head>
<body>
<%
Integer hitsCount = (Integer)application.getAttribute("hitCounter");
if( hitsCount ==null || hitsCount == 0 ){
/* First visit */
out.println("Welcome to my website!");
hitsCount = 1;
}else{
/* return visit */
out.println("Welcome back to my website!");
hitsCount += 1;
}
application.setAttribute("hitCounter", hitsCount);
%>
<center>
<p>Total number of visits: <%= hitsCount%></p>
</center></body></html>
config
• get the JSP init params configured in deployment descriptor(web.xml).
• Instance of javax. servlet.ServletConfig
exception
Index.html
process.jsp
<form action="process.jsp">
<%@ page errorPage="error.jsp" %>
No1:<input type="text" name="n1"
<%
/><br/><br/>
No2:<input type="text" name="n2"
String num1=request.getParameter("n1");
/><br/><br/>
String
<input type="submit" value="divide"/>
num2=request.getParameter("n2");
</form>
int a=Integer.parseInt(num1);
int b=Integer.parseInt(num2);
int c=a/b;
Error.jsp
out.print("division of numbers is: "+c);
<%@ page isErrorPage="true" %>
%>
<h3>Sorry an exception occured!</h3>
erroPage- used to define error page
Exception is: <%= exception %> if error occurred in the current page
it will be redirected to the error page.
Go to Exception folder isErrorPage- declares the current page is
the error.
Page object
➢ JSP page implicit object is instance of java.lang.Object class

➢ represents the current JSP page. Like this object

➢ page object provide reference to the generated servlet class.

➢ Rarely used as it consumes large memory.


pageContext Object

• instance of javax.servlet.jsp.PageContext Represents entire jsp


page.
• Access information about the page like whether page uses page
buffering, error page URL etc.

• to get and set attributes with different scopes and to forward


request to other resources

• Reference to other implicit objects.


• Object findAttribute (String AttributeName): This method searches for
the specified attribute in all four levels in the following order – Page,
Request, Session and Application. It returns NULL when no attribute found
at any of the level.
• Object getAttribute (String AttributeName, int Scope)
• void removeAttribute(String AttributeName, int Scope)
• void setAttribute(String AttributeName, Object AttributeValue, int
Scope)
JSP Custom Tags
• Custom tags are used to create user defined tags in jsp
• Advantages
1. Eliminates much use of sriptlet tags
2. Separates business logic from jsp
3. Re- usability- a custom tag can be used in many files
Syntax
<prefix: tagname attr1=“value1” attr2= “value2”/>
To create Custom tags the following files are needed
1. TagHandler class : specifies what our custom tag will do and
extends TagSupport clas and overrides methods doStartTag()
2. Tld file: defines information about the tag and taghandler class
3. Jsp file: where custom tags are used.

E. Swathi, CSE, CBIT


Flow of custom tags in jsp
Tag handler class
• A tag handler class should
implement Tag/IterationTag/ BodyTag interface or it can also
extend TagSupport/BodyTagSupport/SimpleTagSupport class.
All the classes that support custom tags are present
inside javax.servlet.jsp.tagext.
• To execute your custom tags set CLASSPATH for jsp-api.jar

E. Swathi, CSE, CBIT


Anatomy of tag extensions
• The javax.servlet.jsp.tagext.Tag Interface
- provides interaction between jsp engine and tag handler. Used when the no body
content of the custom tag.
- doStartTag() throws JspException
- doEndTag() throws JspException
- EVAL_BODY_INCLUDE evaluates the tags body content and any sub tages.
- SKIP_BODY skips the tag content.
The javax.servlet.jsp.tagext.BodyTag Interface
evaluate the tag body content
doAfterBody() throws JspException
EVAL_BODY_AGAIN evaluates the tags body and child tags again.

The javax.servlet.jsp.tagext.Iteration Interface


we can use this interface to iterate the body content of any tag.

E. Swathi, CSE, CBIT


Jsp custom tags API
• The javax.servlet.jsp.tagext package contains classes and
interfaces for JSP custom tag API. The JspTag is the root
interface in the Custom Tag hierarchy.

E. Swathi, CSE, CBIT


• There are four field in Tag interface

Field Name Description


public static int it evaluates the body content.
EVAL_BODY_INCLUDE

public static int EVAL_PAGE it evaluates the JSP page content after the custom
tag.

public static int SKIP_BODY it skips the body content of the tag.

public static int SKIP_PAGE it skips the JSP page content after the custom tag.

E. Swathi, CSE, CBIT


• To create jsp custom tags we need to follow following steps
1. Jsp file : jsp file which uses the custom tags
ex: <%@ taglib uri="WEB-INF/mytags.tld" prefix="m" %>
Current Date and Time is: <m:today/>
2. Taglib descriptor: gives the information about the tag and its
taghandler class name.
3. TagHandler class: defines what custom tag will do.

E. Swathi, CSE, CBIT


Writing custom tag to print the today date
// PrintDate.javaimport javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.TagSupport;

public class PrintDate extends TagSupport{

public int doStartTag() throws JspException {


JspWriter out=pageContext.getOut();
try{
out.print(java.util.Calendar.getInstance().getTime());
}catch(Exception e){e.printStackTrace();}

return SKIP_BODY;
}

E. Swathi, CSE, CBIT


// mytags.tld
<taglib>
<tlib-version>1.0</tlib-version>
<jsp-version>1.2</jsp-version>
<short-name>date</short-name>
<uri>mytags</uri>
<description>A simple tab library for the examples</description>

<tag>
<name>today</name>
<tag-class>PrintDate</tag-class>
</tag>
</taglib>

E. Swathi, CSE, CBIT


// web.xml
<web-app>

<jsp-config>
<taglib>
<taglib-uri>mytags</taglib-uri>
<taglib-location>/WEB-INF/mytags.tld</taglib-location>
</taglib>
</jsp-config>
</web-app>

index.jsp
<%@ taglib uri="mytags" prefix=“date" %>
Today is: <date:today></date:today>

E. Swathi, CSE, CBIT


Adding attributes to custom tags
// index.jsp
<%@ taglib uri="WEB-INF/mytags.tld" prefix="m" %>
Cube of 4 is: <m:cube number="4"></m:cube>

//mytags.tld
<taglib>
<tlib-version>1.0</tlib-version>
<jsp-version>1.2</jsp-version>
<short-name>m</short-name>
<uri>mytags</uri>
<description>A simple tab library for the examples</description>
<tag>
<name>cube</name>
<tag-class>cCubeNumber</tag-class>
<attribute>
<name>number</name>
<required>true</required>
</attribute>
</tag>
</taglib> E. Swathi, CSE, CBIT
// CubeNumber.java
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.TagSupport;

public class CubeNumber extends TagSupport{


private int number;

public void setNumber(int number) {


this.number = number;
}

public int doStartTag() throws JspException {


JspWriter out=pageContext.getOut();
try{
out.print(number*number*number);
}catch(Exception e){e.printStackTrace();}

return SKIP_BODY;
}
} E. Swathi, CSE, CBIT
Model 1 and Model 2 (MVC) Architecture

• Before developing the web applications, we need to have idea about design
models. There are two types of programming models (design models)
• Model 1 Architecture
• Model 2 (MVC) Architecture
• Model 1 Architecture
• Servlet and JSP are the main technologies to develop the web applications.
• Servlet was considered superior to CGI. Servlet technology doesn't create
process, rather it creates thread to handle request. The advantage of
creating thread over process is that it doesn't allocate separate memory area.
Thus many subsequent requests can be easily handled by servlet.
• Problem in Servlet technology Servlet needs to recompile if any
designing code is modified. It doesn't provide separation of concern.
Presentation and Business logic are mixed up.

E. Swathi, CSE, CBIT


E. Swathi, CSE, CBIT
Flow of model1 architechture
• Browser sends request for the JSP page
• JSP accesses Java Bean and invokes business logic
• Java Bean connects to the database and get/save data
• Response is sent to the browser which is generated by JSP

Advantage of Model 1 Architecture


• Easy and Quick to develop web application

• Disadvantage of Model 1 Architecture


• Navigation control is decentralized since every page contains the logic to
determine the next page. If JSP page name is changed that is referred by other pages,
we need to change it in all the pages that leads to the maintenance problem.
• Time consuming You need to spend more time to develop custom tags in JSP. So
that we don't need to use scriptlet tag.
• Hard to extend It is better for small applications but not for large applications.
E. Swathi, CSE, CBIT
Model 2 (MVC) Architecture

E. Swathi, CSE, CBIT


Advantage of Model 2 (MVC)
Architecture
• Navigation control is centralized Now only controller contains the logic
to determine the next page.
• Easy to maintain
• Easy to extend
• Easy to test
• Better separation of concerns

Disadvantage of Model 2 (MVC) Architecture


• We need to write the controller code self. If we change the controller code,
we need to recompile the class and redeploy the application.

E. Swathi, CSE, CBIT


Solution of Model 2 Architecture: Configurable MVC Components

• It uses the declarative approach for defining view components, request


mapping etc. It resolves the problem of Model 2 architecture. The Struts
framework provides the configurable MVC support. In struts 2, we define
all the action classes and view components in struts.xml file.

E. Swathi, CSE, CBIT


Jsp design strategies
• Though jsp pages are a good way of presenting dynamic content, but they
don’t solve all the problems of developing maintainable web application.
• If jsp page contains excessive amount of java content with lot of scriptlets,
they will pose maintainance problem to both java developers and page
designers.
• Jsp pages complement servlets but not the replacement.
• Strengths and weakness of jsp and servlets.
1) jsp pages are much better than servlets at displaying markup.
2) Jsp are best suited to use as view components.
3) Servlet is better choice if display is dependent on processing first.

E. Swathi, CSE, CBIT


Jsp 2 design strategies
1)Page centric: JSP model 1 design: request are directly made to the jsp page
that produces the response.

2) Controller or dispatcher design: jsp model2 design: request is initially made


to a jsp or a servlet which acts as a controller.

E. Swathi, CSE, CBIT


Page centric or client-server designs

E. Swathi, CSE, CBIT


Page view

E. Swathi, CSE, CBIT


• The basic approach involves direct request invocations to jsp page made up
of embedded java code (scriptlets) and markup tags that dynamically
generate output for substitution within html.
• It is easy and development process is fast . But big tradeoff is the level of
sophistication. As scale of system grows, the limitations of this approach
surface.
• Page view architecture is handy for prototyping as it gives quick results.
During learning stage developers use this approach.
• Utilizing a mediating Jsp or servlet or javabeans components allows us to
separate developer roles more clearly.

E. Swathi, CSE, CBIT


Page-view with Bean

E. Swathi, CSE, CBIT


• This is the refinement of the page view architecture.
• The javacode representing the business logic and simple data storage
implementation has migrated from the JSP to the JavaBean worker. This
leaves jsp with limited java code.
• Bean has been created which software developer can own(less technical
individual could be provided with property sheets for javabean workers) ,
so its functionality may be refined and modified without the need for
changes to the html or markup in the jsp source page.
• Cleaner abstractions is created in our system by replacing implementation
with intent.

E. Swathi, CSE, CBIT


Front controller pattern
• Though the improvement is there in page view with bean , still jsp pages
need to perform ( or atleast initiate) request processing and to present
content.
• Some jsp pages may need to manipulate session, application-wide
resources, or state before the response can be generated. Others may need
to examine request values to check whether to redirect the request. Simply
mapping request properties onto a bean is not a universal solution ,
especially if redirection is required.
• So the well know elegant solution for this is JSP Model2 architecture,
called as Front Controller pattern.
• This is an attempt to apply MVC architecture(sucessful oo architectural
patterns) to web applications.

E. Swathi, CSE, CBIT


• MVC divides the components needed to build a user interface into 3 kinds
of object.
1) A model data or application object.
2) View objects to perform screen presentation of application
3) A controller object to react to user input.
Front controller pattern for java web application involves having one controller
servlet or JSP as a single point of entry into a whole application or group
of pages.
This entry point produces no output but processes the request, optionally
manipulates session and application state, and redirects requests to the
appropriate JSp view or a sub-controller that knows how to handle a
subset of all requests to the application.
Front controller architecture is one of the most valuable approaches to building
maintainable jsp systems.

E. Swathi, CSE, CBIT


• Sytems tend to be more flexible and extensible than those using page
centric approach . Better separation of presentation and content is there.
Implementing a Front controller architecture(simple implementation)
1) One controller servlet to handle all incoming requests and delegate
processing to request handler helper classes.
2) One request handler helper class to do the processing for each type of
request.(defined by the URL)
3) A number of page or model beans to provide model data for jsp views.
4) Some view jsp pages
Complex application- session object is requried

E. Swathi, CSE, CBIT


Controller servlet

• One instance of applications controller servlet, which will handle all


incoming requests. We can map all application URLs onto the controller
servlet in a WAR’s web.xml file.
• Controller servlet won’t know how to handle each individual request. Its
main responsibility will be to decide which request handler helper class
should handle each request and delegate request processing to it.
• Delegating request processing to helper classes and using mappings will
mean that the controller servlet will be generic. With different mappings ,
same controller servlet could be used for many applications.

E. Swathi, CSE, CBIT


Request Handlers

Each request handler will perform the following steps


1) Examine the parameters of incoming requests.
2) Update the application state if necessary
3) Obtain any necessary data to display and make it available to views in the
form of session or request attributes. (jsp pages will access these using
<jsp:useBean> actions)
4) Choose a jsp view to which the controller will forward the response.

E. Swathi, CSE, CBIT


Page beans

• These will be simple java objects , constructed by request handlers and set
as attributes in the request to make them accessible to view jsp pages using
<jsp:useBean> tag.
• Page beans won’t do markup generation or execute any logic. They will be
treated as read only objects by JSP views and will provide the model data
the views require.

E. Swathi, CSE, CBIT


E. Swathi, CSE, CBIT
References

• https://way2java.com/java-general/introduction-to-2-tier-and-
3-tier-architecture/
• https://way2java.com/
• https://www.studytonight.com/servlet/servlet-
api.phphttps://www.javatpoint.com/custom-tags

E. Swathi, CSE, CBIT

You might also like