Spring MVC with JSP (Java server Page). Spring-Ep:11 #springmvc #jsp #scripting #implicit #bengali



Spring MVC with JSP (Java server Page). Spring-Ep:11 #springmvc #jsp #scripting #implicit #bengali

Spring MVC with JSP (Java server Page).  Spring-Ep:11 #springmvc #jsp #scripting #implicit #bengali

Hi,
Hope you are all doing great. Let’s learn together.

Timeline
Previous video’s topic discussion — 02:42
JSP Theory — 17:46
JSP Life Cycle — 21:42
Scriptlet tag, Expression tag, Declaration Tag — 23:21
JSP Implicit Objects — 42:13
Implicit object ‘out’ — 43:43
Implicit object ‘request’ — 43:53
Implicit object ‘response’ — 58:08
Implicit object ‘config’ — 01:00:45
Implicit object ‘application’ — 01:07:21
Implicit object ‘session’ — 01:09:11
Implicit object ‘pageContext’ — 01:22:55
Implicit object ‘page’ — 01:28:13

Note:
Spring is a lightweight framework.It was developed by Rod Johnson in 2003. Spring framework makes the easy development of JavaEE application.

Video Links:
Core Java Playlist:
https://youtube.com/playlist?list=PL0LQjbMWLlS3AVp2LglGSvfV6ieUSsNMp

Spring Playlist:
https://www.youtube.com/playlist?list=PL0LQjbMWLlS3tXLVZBuLmsMJ9dU6JNtGD

Spring Video List:
Model-View-Controller(MVC), Spring MVC. — https://youtu.be/ZPVvmX_yntA
JDBCTemplate, RowMapper,ResultSetExtractor,BeanPropertyRowMapper Spring — https://youtu.be/NsytsxHTUro
Spring JDBCTemplate, JDBC, Statement and PreparedStatement — https://youtu.be/jkc3RzTxzXE
What if we remove @Configuration annotation in Spring? — https://youtu.be/lmQ0sy74QkA
@Configuration, @Bean, @Component, @ComponentScan in Spring. — https://youtu.be/OXFVdoxX4SE
Autowiring, Autowiring Modes – byName, byType & constructor. — https://youtu.be/0catrd8gf98

Document Link –
Spring MVC
https://docs.google.com/document/d/16Y9BpBOi__4fYHU7rUFO2PlPbU-zMgBP06YkeXKZ3As/edit?usp=sharing

JSP
https://docs.google.com/document/d/1GY0A18xdphq3JfToue23lPkRKvuXsLBGcvJpN9Ja2yk/edit?usp=sharing

Like, Comment, Share, and Subscribe.
Thank you again.

STS Link:
https://spring.io/tools

Eclips Download
https://www.eclipse.org/downloads/packages/

Tomcat Download
https://tomcat.apache.org/download-90.cgi

JDK Link:
https://www.oracle.com/java/technologies/downloads/

To download spring jars
https://repo.spring.io/ui/native/release/org/springframework/spring

MYSql Connector JAR
https://mvnrepository.com/artifact/mysql/mysql-connector-java/8.0.28

MYSql Installer
https://dev.mysql.com/downloads/installer/

JSP
JSP technology is used to create web applications just like Servlet technology.
It is an extension of Servlet because it provides more functionality than servlet such as expression language, JSTL, etc.
A JSP page consists of HTML tags and JSP tags.

A JSP page services requests as a servlet. Thus, the life cycle and many of the capabilities of JSP pages (in particular the dynamic aspects) are determined by Java Servlet technology.

Java Servlet Technology
As soon as the web began to be used for delivering services, service providers recognized the need for dynamic content. Applets, one of the earliest attempts toward this goal, focused on using the client platform to deliver dynamic user experiences. At the same time, developers also investigated using the server platform for this purpose. Initially, Common Gateway Interface (CGI) scripts were the main technology used to generate dynamic content. Although widely used, CGI scripting technology has a number of shortcomings, including platform dependence and lack of scalability. To address these limitations, Java Servlet technology was created as a portable way to provide dynamic, user-oriented content.

Scripting elements
In JSP, java code can be written inside the JSP page using the scriptlet tag. Let’s see what are the scripting elements first.

JSP scriptlet tag
A scriptlet tag is used to execute java source code in JSP. Syntax is as follows:

JSP expression tag
The code placed within JSP expression tag is written to the output stream of the response. So you need not write out.print() to write data. It is mainly used to print the values of variable or method.
Syntax of JSP expression tag

Note: Do not end your statement with semicolon in case of expression tag.

JSP Declaration Tag
The JSP declaration tag is used to declare fields and methods.
The code written inside the jsp declaration tag is placed outside the service() method of auto generated servlet.
So it doesn’t get memory at each request.
Syntax of JSP declaration tag

JSP Implicit Objects
There are 9 jsp implicit objects. These objects are created by the web container that is available to all the jsp pages.
Object
Type
out
JspWriter – out.print(“Hello World”)
request
HttpServletRequest – request.getContextPath()
response
HttpServletResponse – response.sendRedirect(“https://www.google.com/”)
config
ServletConfig – config.getInitParameter(“paramName”)
application
ServletContext – application.getInitParameter(“paramname”)
session
HttpSession – session.setAttribute(“xyx”, “Hello World”);
String sessionAttribute = (String)session.getAttribute(“xyx”);
out.print(sessionAttribute);
pageContext
PageContext – set, get or remove the attribute from different scope like – page,session,application, etc.
exception
Throwable –
page – Object

Comments are closed.