Here is a quick-start JSP tutorial for beginners. Before you read this tutorial, I suggest you to have a per-requisite knowledge of servlets in Java.
In this tutorial you are going to learn:
In this tutorial you are going to learn:
- Scriptlets, Declarations and Expressions
- JSP Directives
- XML Tags
- Working with JSP beans
- Custom tags
Introduction to JSP
JSP stands for Java Server Pages. It is a tag based approach that mixes both the HTML and the java servlet code. The reasons why we should use JSP will be the strongest foundation for you.
- You do not need to write servlet classes anymore. They are replaced by JSP.
- Tag based approach is more cleaner and programmer friendly.
- HTML mixed with servlet code will provide all logic at one place.
- You NEED NOT COMPILE servlets, RESTART server. Because the server automatically checks if a JSP page is modified upon each request. If modified, jasper container translates JSP to servlet (.java) file, compiles it and then loads it automatically.
- Simplified data processing with beans approach.
1. Scriptlets, Declarations and Expressions
The very basics of JSP you need to start coding with.
- Using scriptlets in JSP
- Mixing HTML code with JSP
- Using declarations with example
- JSP Expressions with example
2. JSP Directives
3. XML Tags
A clean, tag based approach for JSP.
- Using <jsp:scriptlet> tag
- <jsp:declaration> tag example
- <jsp:include> tag with example
- Using <jsp:forward> tag
4. JSP Beans
How JSP simplifies data processing with MVC using beans?
5. Custom tags
Create custom tags to improve re-usability.