UrbanPro
true

Learn IT Courses with Free Lessons & Tips

How would you like to attend?

Recommended
Highly Rated Tutors Free Demo Class

IT Courses Q&A: Guides, Training Tips & Resources

✕

Search in

Answered 14 hrs ago Learn Servlet

Ask a Question

Post a Lesson

Balmukund Tiwari

Balmukund Tiwari

Experienced Maths & Physics Mentor with 5+ years, B Tech graduate.

Head First Servlets and JSP (Basham, Sierra, Bates): best for beginners, very visual, and good for exam prep. It’s older, but the fundamentals are unchanged. Murach’s Java Servlets and JSP: clear, practical, with full examples. Good for building real apps. Core Servlets and JavaServer Pages... read more
  • Head First Servlets and JSP (Basham, Sierra, Bates): best for beginners, very visual, and good for exam prep. It’s older, but the fundamentals are unchanged.
  • Murach’s Java Servlets and JSP: clear, practical, with full examples. Good for building real apps.
  • Core Servlets and JavaServer Pages (Marty Hall): detailed reference. Free tutorials are at coreservlets.com.
  • Jakarta EE Tutorial (free, official): up to date for the current spec
read less
Answers 1 Comments
Dislike Bookmark
Answered 2 days ago Learn Servlet

Ask a Question

Post a Lesson

Balmukund Tiwari

Balmukund Tiwari

Experienced Maths & Physics Mentor with 5+ years, B Tech graduate.

Applet Servlet Runs on Client side (browser) Server side (web server/container) Purpose GUI/interactive content in web pages Handle requests, generate dynamic responses Needs Browser/JVM plugin Servlet container (e.g., Tomcat) Main class java.applet.Applet / JApplet HttpServlet Has GUI Yes No... read more
Applet Servlet
Runs on Client side (browser) Server side (web server/container)
Purpose GUI/interactive content in web pages Handle requests, generate dynamic responses
Needs Browser/JVM plugin Servlet container (e.g., Tomcat)
Main class java.applet.Applet / JApplet HttpServlet
Has GUI Yes No (outputs HTML/data)
Lifecycle init, start, stop, destroy init, service, destroy
Security Restricted sandbox Runs with server’s permissions
Status Deprecated (removed from modern browsers) Still widely used
read less
Answers 1 Comments
Dislike Bookmark
Answered 2 days ago Learn Servlet

Ask a Question

Post a Lesson

Balmukund Tiwari

Balmukund Tiwari

Experienced Maths & Physics Mentor with 5+ years, B Tech graduate.

No. Servlet containers are still the foundation of most Java web apps. Still dominant: Tomcat, Jetty and Undertow power Spring Boot, Jakarta EE and many enterprise systems. What changed: they’re now usually embedded in the app (a single runnable JAR) instead of deployed as WAR files to a standalone... read more

No. Servlet containers are still the foundation of most Java web apps.

  • Still dominant: Tomcat, Jetty and Undertow power Spring Boot, Jakarta EE and many enterprise systems.
  • What changed: they’re now usually embedded in the app (a single runnable JAR) instead of deployed as WAR files to a standalone server.
  • Standards continue: the Servlet spec lives on as Jakarta Servlet (jakarta.* namespace).
  • Alternatives growing: Netty-based reactive stacks (WebFlux, Vert.x), and Quarkus/Micronaut for fast-start cloud and native builds. These complement containers rather than replace them.
read less
Answers 1 Comments
Dislike Bookmark
Answered 2 days ago Learn Servlet

Ask a Question

Post a Lesson

Balmukund Tiwari

Balmukund Tiwari

Experienced Maths & Physics Mentor with 5+ years, B Tech graduate.

No, but you rarely write them directly anymore. Still used: Spring MVC, JSF and Jakarta EE are built on the Servlet API, and the spec is actively maintained as Jakarta Servlet. Outdated part: writing raw servlets with XML config and manual HTML output. Frameworks handle that now. Worth learning: for... read more

No, but you rarely write them directly anymore.

  • Still used: Spring MVC, JSF and Jakarta EE are built on the Servlet API, and the spec is actively maintained as Jakarta Servlet.
  • Outdated part: writing raw servlets with XML config and manual HTML output. Frameworks handle that now.
  • Worth learning: for the fundamentals (requests, sessions, filters, lifecycle), not for building new apps from scratch.
read less
Answers 1 Comments
Dislike Bookmark

Ask a Question

Post a Lesson

Balmukund Tiwari

Balmukund Tiwari

Experienced Maths & Physics Mentor with 5+ years, B Tech graduate.

1. System properties and environment variables jsp <%= System.getProperty("os.name") %> <%= System.getenv("JAVA_HOME") %> 2. Files on the server jsp <% String path = application.getRealPath("/data/info.txt"); BufferedReader br = new BufferedReader(new FileReader(path)); %> 3.... read more

1. System properties and environment variables

jsp
<%= System.getProperty("os.name") %>
<%= System.getenv("JAVA_HOME") %>

2. Files on the server

jsp
<%
String path = application.getRealPath("/data/info.txt");
BufferedReader br = new BufferedReader(new FileReader(path));
%>

3. Running an OS command (rarely advisable)

jsp
<% Process p = Runtime.getRuntime().exec("hostname"); %>
read less
Answers 1 Comments
Dislike Bookmark

Ask a Question

Post a Lesson

Balmukund Tiwari

Balmukund Tiwari

Experienced Maths & Physics Mentor with 5+ years, B Tech graduate.

@WebServlet("/certificate")public class CertificateServlet extends HttpServlet { protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { String id = req.getParameter("id"); try (Connection con = DriverManager.getConnection( "jdbc:mysql://localhost:3306/mydb",... read more

@WebServlet("/certificate")
public class CertificateServlet extends HttpServlet {
protected void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
String id = req.getParameter("id");
try (Connection con = DriverManager.getConnection(
"jdbc:mysql://localhost:3306/mydb", "user", "pass");
PreparedStatement ps = con.prepareStatement(
"SELECT student_name, course, issue_date, grade FROM certificates WHERE id = ?")) {
ps.setInt(1, Integer.parseInt(id));
ResultSet rs = ps.executeQuery();
if (rs.next()) {
req.setAttribute("name", rs.getString("student_name"));
req.setAttribute("course", rs.getString("course"));
req.setAttribute("date", rs.getDate("issue_date"));
req.setAttribute("grade", rs.getString("grade"));
req.getRequestDispatcher("certificate.jsp").forward(req, res);
} else {
res.sendError(404, "Certificate not found");
}
} catch (Exception e) {
throw new ServletException(e);
}
}
}

read less
Answers 2 Comments
Dislike Bookmark

Ask a Question

Post a Lesson

Balmukund Tiwari

Balmukund Tiwari

Experienced Maths & Physics Mentor with 5+ years, B Tech graduate.

JSP is Java’s server-side view layer. It generates HTML dynamically. Role: mixes HTML with Java data (via JSTL and Expression Language) to build the page sent to the browser. In MVC: the servlet or controller is the logic, and the JSP is the View. How it works: the container compiles each JSP... read more

JSP is Java’s server-side view layer. It generates HTML dynamically.

  • Role: mixes HTML with Java data (via JSTL and Expression Language) to build the page sent to the browser.
  • In MVC: the servlet or controller is the logic, and the JSP is the View.
  • How it works: the container compiles each JSP into a servlet on first request.
  • Features: includes, custom tags, form handling, session and request data access.
  • Best practice: no Java scriptlets (<% %>). Use JSTL and EL, and keep logic in servlets or classes.
  • Limits: it is server-rendered, so it is not interactive like React or Vue. Real front-end behavior still needs HTML, CSS and JavaScript.
  • Today: still used in legacy and enterprise apps. Newer projects often use Thymeleaf or a JS front end with a REST API.
read less
Answers 1 Comments
Dislike Bookmark

Ask a Question

Post a Lesson

Balmukund Tiwari

Balmukund Tiwari

Experienced Maths & Physics Mentor with 5+ years, B Tech graduate.

Yes, but not within a single browser session. Different browsers, devices or incognito windows: each gets its own JSESSIONID cookie, so the same user can have several sessions at once. This is automatic. Same browser: all tabs share one HttpSession per web app, because they share the cookie. Simulating... read more

Yes, but not within a single browser session.

  • Different browsers, devices or incognito windows: each gets its own JSESSIONID cookie, so the same user can have several sessions at once. This is automatic.
  • Same browser: all tabs share one HttpSession per web app, because they share the cookie.
  • Simulating several sessions in one browser: store separate data under different keys, for example session.setAttribute("cart_" + tabId, cart).
  • Tracking a user’s sessions: keep a Map<String, List<HttpSession>> and update it with an HttpSessionListener or HttpSessionBindingListener.
  • Limiting to one session: on login, find the user’s old session in that map and call invalidate().
read less
Answers 1 Comments
Dislike Bookmark

Ask a Question

Post a Lesson

Balmukund Tiwari

Balmukund Tiwari

Experienced Maths & Physics Mentor with 5+ years, B Tech graduate.

Redirect (new request, URL changes): jsp <% response.sendRedirect("page2.jsp"); %> Forward (server-side, URL stays, request data kept): jsp <jsp:forward page="page2.jsp" /> Link: <a href="page2.jsp">Go</a> Call either before any output, and add return;... read more
  • Redirect (new request, URL changes):
jsp
 <% response.sendRedirect("page2.jsp"); %>
  • Forward (server-side, URL stays, request data kept):
jsp
 <jsp:forward page="page2.jsp" />
  • Link: <a href="page2.jsp">Go</a>

Call either before any output, and add return; after it.

read less
Answers 1 Comments
Dislike Bookmark

Harsh Bisht

Harsh Bisht

Most JavaScript framework names have a simple idea behind them: React → UI reacts to data changes. Angular → Related to Angular/HTML syntax. Vue → Means “view” in French. Mithril → Named after a strong, lightweight fictional metal. Svelte → Means slim/lightweight. Ember... read more

Most JavaScript framework names have a simple idea behind them:

  • React → UI reacts to data changes.
  • Angular → Related to Angular/HTML syntax.
  • Vue → Means “view” in French.
  • Mithril → Named after a strong, lightweight fictional metal.
  • Svelte → Means slim/lightweight.
  • Ember → A small piece of burning coal.
  • Preact → A smaller/lighter React.
  • Backbone → Provides the basic structure of an app.
  • Next.js → The “next” step in React development.
  • Gatsby → Named after The Great Gatsby.
read less
Answers 3 Comments
Dislike Bookmark

Top Contributors

Connect with Expert Tutors & Institutes for IT Courses

Overview

Questions 50.1 k

+ Follow 49,943

About UrbanPro

UrbanPro.com helps you to connect with the best IT Courses in India. Post Your Requirement today and get connected.

x

Ask a Question

Please enter your Question

Please select a Tag

X

Looking for IT Courses Classes?

The best tutors for IT Courses Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn IT Courses with the Best Tutors

The best Tutors for IT Courses Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more