Advanced Java for Beginners — Episode 8: JSP, Session Management and MVC Pattern (Updated June 2026)
Here's some context that'll sharpen your focus: TCS announced 12,000 job cuts in July 2025, but in the same quarter, NASSCOM and Deloitte projected demand for 1.25 million AI-capable technology professionals by 2027. The jobs being cut are in repetitive, script-based IT work. The jobs being created are in web application development, data engineering and AI integration — exactly the skills that Advanced Java's server-side layer underpins. Episode 8 covers JSP, session management and MVC — the three concepts that separate someone who can write a Java program from someone who can build a production web application.
- JSP (Java Server Pages) lets you embed Java code directly in HTML pages for dynamic web content generation
- Session management and cookies allow web applications to remember users across multiple HTTP requests
- MVC (Model-View-Controller) pattern separates data logic, business logic and presentation — the industry standard
- Java web developers in Pune earn ₹4–₹8 LPA at entry level; senior Java developers at Infosys and TCS earn ₹10–₹18 LPA
What Is JSP and How Does It Fit Into Java Web Development?
JSP (Java Server Pages) is a server-side technology that lets you write HTML pages with embedded Java code. When a browser requests a JSP page, the web server (Apache Tomcat in our case) compiles the JSP into a Servlet behind the scenes, executes the Java code, and sends back pure HTML to the browser. The browser never sees Java — it only sees the rendered output. This is how dynamic websites work: the page content changes based on user input, database queries or session state. Every major Java enterprise framework — Spring MVC, Struts, Jakarta EE — ultimately generates responses that follow the same request-response cycle that JSP introduced. Understanding JSP is therefore understanding the foundation of Java web architecture, which is what Episode 8 builds.

JSP Directives, Scriptlets and Expression Language — Writing Your First Dynamic Page
JSP has three main constructs. Directives (written as page directive with import attributes) configure the JSP page — import packages, set error pages, specify content type. Scriptlets (code inside angle-percent tags) embed raw Java code that runs when the page is requested. Expressions (inside equals-percent tags) output a single value directly into the HTML output. The good news is that modern JSP development favours Expression Language (EL) and JSTL (JSP Standard Tag Library) over raw scriptlets — EL lets you write clean syntax like dollar-sign curly-brace user.name instead of embedding Java print statements. This approach is far more readable and maintainable, which is why it's the standard in Java projects at TCS, Infosys and Capgemini India.
| Concept | Where It Lives | Storage Location | Typical Use |
|---|---|---|---|
| JSP Page | View layer | Server (compiled) | Dynamic HTML generation |
| Cookie | Client (browser) | Browser file system | Preferences, session ID |
| HTTP Session | Server-side | Server memory / DB | Login state, cart data |
| MVC Model | Business logic | Java classes / DB | Data access, processing |
| MVC Controller | Request handling | Servlet / @Controller | Route requests, call model |
| MVC View | Presentation | JSP / HTML template | User interface rendering |
HTTP Session Management: How Web Apps Remember Who You Are
HTTP is a stateless protocol — every request from a browser is independent, with no memory of previous requests. This creates a problem: how does your web application know that the user who just clicked "Add to Cart" is the same person who logged in 30 seconds ago? The answer is HTTP sessions. When a user logs in, the server creates a Session object and assigns it a unique session ID. This ID is sent to the browser in a cookie. On every subsequent request, the browser sends the cookie back, and the server looks up the Session object to retrieve user-specific data. In Java, you access the session object via request.getSession() in a Servlet or JSP. You can store any Java object in the session: user preferences, shopping cart contents, authentication status.

Cookies vs Sessions — When to Use Each and Why It Matters
Cookies and sessions are related but different. A cookie is a small text file stored on the user's browser — it can store simple key-value pairs like a username or language preference, and it persists between browser sessions if you set an expiry time. A session is stored server-side (in memory or a database), with only the session ID held in a cookie on the browser. Sessions are more secure for sensitive data (the actual data never leaves the server), but they consume server memory and expire when the server restarts unless you configure persistent session storage. Use cookies for non-sensitive preferences (theme, language) and sessions for authentication state and transaction data. This distinction is tested in every Java web developer interview at Pune-based IT companies.
The MVC Pattern in Java — Why Every Enterprise App Uses It
MVC stands for Model-View-Controller and it is the architectural pattern that underpins virtually every Java web application built since 2000. The Model layer represents your data and business logic — Java classes, database access through JDBC or JPA, service methods. The View layer is your presentation layer — JSP files, HTML templates. The Controller layer handles HTTP requests, calls the Model to get or update data, and decides which View to display next — in Java, this is typically a Servlet or a Spring @Controller. What most beginners don't realize is that MVC is not a framework, it is a design principle. Spring MVC implements it, Struts implements it, even plain Servlet-JSP code can follow MVC if you structure it correctly. Every Java project at Wipro, Cognizant and HCL Technologies India follows MVC — understanding it is non-negotiable for a Java web developer role.
Java Web Development Jobs in Pune and Sambhajinagar in 2026
Java web development remains one of the most in-demand skills in Pune's IT corridor. At Hinjewadi IT Park, companies like Infosys, Wipro, Cognizant and L&T Infotech regularly recruit Java developers at ₹4–₹7 LPA for freshers. Mid-level Java engineers with 3–5 years experience in Spring, JSP and REST APIs earn ₹10–₹18 LPA at TCS, Capgemini and Accenture India. In Sambhajinagar, the growing IT sector — supported by the AURIC digital infrastructure — is attracting software companies, with CDAC Sambhajinagar as a key training and placement hub. NASSCOM's 2025 data shows Java is in the top 5 programming languages by job posting volume in Maharashtra. ABC Trainings' Advanced Java course at our Wagholi, Hadapsar, Cidco and Osmanpura centres comes with placement assistance and mock interview preparation.
Get the IT Training Brochure + Fees + Batch Dates on WhatsApp
Free 1:1 counselling. Placement track record. CMYKPY/PMKVY eligibility check.
💬 Get Brochure on WhatsApp📞 Call 7039169629About the author: Amit Kulkarni. 8 yrs leading IT training at ABC Trainings, ex-Infosys.
Visit Our Centers
- Wagholi (Pune): 1st Floor, Laxmi Datta Arcade, Pune-Ahilyanagar Highway. Call 7039169629
- Hadapsar (Pune HQ): 1st Floor, Shree Tower, opp. Vaibhav Theater, Magarpatta. Call 7039169629
- Cidco (Chh. Sambhajinagar): Kalpana Plaza, opp. Eiffel Tower, N-1 Cidco. Call 7039169629
- Osmanpura (Chh. Sambhajinagar): S.S.C Board to Peer Bazar Road, near Jama Masjid. Call 7039169629
- Sangli: Shubham Emphoria, 1st Floor, Above US Polo Assn., Sangli-Miraj Rd, Vishrambag. Weekend batches available. Call 7039169629
FAQs
What is the difference between a Servlet and a JSP in Java?
A Servlet is a pure Java class that handles HTTP requests and generates responses — all output is written in Java code. A JSP is primarily an HTML file with embedded Java code that gets compiled into a Servlet by the server. The difference is the starting point: Servlets are Java-first (good for controllers and business logic), JSP is HTML-first (good for views and presentation). In MVC architecture, Servlets typically act as Controllers and JSPs act as Views.
Is JSP still relevant in 2026 or has it been replaced by frameworks like Spring Boot?
JSP is still widely taught and used in enterprise Java maintenance projects — millions of lines of JSP-based code run in production at Indian banks, government portals and manufacturing ERP systems. However, new projects typically use Thymeleaf or React with Spring Boot REST APIs instead of JSP. Learning JSP still gives you the conceptual foundation (request-response, session, MVC) that all Java web frameworks build on, making the transition to Spring Boot much faster.
How does session timeout work in Java web applications?
Session timeout is configured in the web.xml file using the session-config element with session-timeout set in minutes. The default in Apache Tomcat is 30 minutes of inactivity. After the timeout period with no requests from the client, the server invalidates the session and releases its memory. Users are then redirected to the login page on their next request. You can also manually invalidate a session in code by calling session.invalidate() — this is what the logout button does.
Do I need to know Core Java before learning Advanced Java web development?
Yes — Core Java (OOP, collections, exception handling, I/O) is essential before moving to Advanced Java web concepts. If you are comfortable writing Java classes, implementing interfaces and handling exceptions, you are ready for servlets and JSP. At ABC Trainings, our Advanced Java programme assumes Core Java knowledge. If you are starting from scratch, we recommend our Core Java course first — most students complete both in 4–5 months.




