UrbanPro
true

Ask a Pro

UrbanPro has lakhs of Expert Tutors and Trainers to answer your Questions.

?

Questions Guidelines

  • Start your question with simple statements like "what", "when", "where", or "how".
  • Ensure your question or answer is not offensive or insensitive - it may be voted down or banned.
  • Please provide as much detail as possible as this will allow our members to better understand and respond to your question.
  • Take some time to categorize your question. This will greatly help other users find the question.

You can add upto 6 Images

How it works?

Trending Discussions

S

Subhash 30/05/2024 in  IT Courses/Java/JSP (Java Server Pages)

What are the methods in Java Server Page (JSP) and Servlets?

0 0

Balmukund replied | 1 day ago

Servlet methods

  • init(): runs once when the servlet is first loaded, for setup.
  • service(): runs for every request and decides which doXxx() method to call.
  • doGet() and doPost(): handle GET and POST requests. There are also doPut(), doDelete(), doHead() and doOptions().
  • destroy(): runs once when the servlet is removed, for cleanup.

JSP methods
A JSP is converted into a servlet, so it has similar methods:

  • jspInit(): runs once at the start.
  • _jspService(): handles each request. The container generates it, so you don’t write it yourself.
  • jspDestroy(): runs once at the end.

S

Satish 13/01/2025 in  IT Courses/Scala Training

Is Scala hard to learn?

0 0

Sadiq replied | 2 days ago

Yes, Scala is considered moderately to very challenging to learn, depending on your background and how deep you go into its advanced paradigms.

Why Scala Has a Learning Curve

• Dual Paradigms: Scala combines Object-Oriented Programming (OOP) and Functional Programming (FP). If you are only used to imperative or standard OOP languages like Java or C++, shifting to concepts like immutability, pure functions, and recursion requires a major mental shift.
• Complex Type System & Features: Features such as implicits, macros, higher-kinded types, and advanced type-level programming can quickly become dense and difficult to read or debug.
• Over-Engineering Risk: Teams sometimes struggle because developers write overly complex, academic code (like monad transformers and custom operators) that the rest of the team finds hard to maintain

D

Dhiraj 6 days ago in  Cambridge IGCSE-Class 9/Computer Science (0478)/Software, Cambridge A Level-Class 12/Computer Science (9618)/Programming, Programming Expert, More... IBPS SO/IBPS SO Professional Paper/IT IT Courses/Computer Course/Software Programming

How Does a Website Remember Your Login Even After You Close and Reopen the Browser?

0 0

Pratishtha replied | 4 days ago

using persistent cookies or long-lived authentication tokens

Sadiq replied | 2 days ago

Websites remember your login after you close and reopen the browser using persistent cookies or long-lived authentication tokens stored on your device.
The web is normally "stateless"—meaning every page load or click is treated like a brand-new visit. To bridge this gap, sites rely on a specific process:

1. The Normal Session vs. "Remember Me"

• Standard Session Cookies: When you log in without checking "Remember Me," the server issues a temporary session cookie. This cookie has no expiration date attached to it, so standard browser behavior is to delete it the moment you close all your browser windows. Once closed, the session dies.
• Persistent Cookies (Remember Me): When you check "Remember Me" (or "Stay Signed In"), the server tells your browser to save a persistent cookie containing a unique, encrypted authentication token or session ID.
• Expiration Date: Unlike session cookies, a persistent cookie includes a set expiration date (such as 30 days or longer). It is saved to your computer's hard drive or storage rather than just active memory.

2. What Happens When You Reopen the Browser

• Sending the Token: When you launch your browser again and navigate back to the website, your browser automatically attaches that saved persistent cookie (containing your login token) to its request.
• Server Verification: The website's server receives the token, looks it up in its database, and confirms it matches an active, authorized user account.
• Restoring Access: Instead of asking for your password again, the server silently restores your logged-in state.

3. Other Storage Methods

• Local Storage: Browsers also feature localStorage via the Web Storage API, which websites can use to keep data across browser restarts. Unlike cookies, data in localStorage isn’t automatically sent to the server with every HTTP request, though a site's JavaScript can read it and use it to re-authenticate or restore app state.
• Refresh Tokens: Modern web apps often use a hybrid token system (such as short-lived Access Tokens paired with long-lived Refresh Tokens) stored securely to balance safety and convenience.

S

Srihari 30/05/2024 in  IT Courses/Java/JSP (Java Server Pages)

What is the future of JavaServer Pages (JSP) in Java Enterprise Edition (Java EE)?

0 0

Balmukund replied | 4 days ago

JSP is still supported but is considered legacy, with little new development.

  • Renamed: Java EE moved to the Eclipse Foundation and became Jakarta EE. JSP is now Jakarta Server Pages, with the package namespace changed from javax.* to jakarta.*. It still ships in Jakarta EE and in servlet containers like Tomcat.
  • Maintained, not growing: It gets compatibility and cleanup updates (for example, removal of old features), but no major new capabilities.
  • Replaced for new projects: Newer Jakarta EE work favours Jakarta Faces (JSF), Jakarta MVC, REST APIs with a JavaScript front end (React, Angular), and template engines like Thymeleaf or Freemarker (often with Spring Boot).
  • Still in use: Many large existing enterprise applications run on JSP, so it will be around for a long time in maintenance work.

In short, JSP won’t disappear soon, but you wouldn’t choose it for a new project. Knowing it is still useful for legacy systems and interviews.

A

Anubhav 30/05/2024 in  IT Courses/Java/JSP (Java Server Pages)

Is it possible to write JSP's in Java? Why are Servlets used within an MVC pattern?

0 0

Balmukund replied | 4 days ago

Yes, JSPs can contain Java (scriptlets <% %>), and they’re compiled into servlets. But embedding Java in them is discouraged; use EL/JSTL instead.

Servlets act as the controller in MVC: they handle requests, call the model (business logic), and forward the result to a JSP (the view). This keeps logic separate from presentation.

Sadiq replied | 2 days ago

Yes, it is absolutely possible to write Java code within a JSP (JavaServer Pages) file. In fact, JSP is built on top of Java technology. 
You can embed Java code into a JSP page using special tags known as scriptlets (<% ... %>), expressions (<%= ... %>), and declarations (<%! ... %>). When a user requests a JSP page, the web server's container automatically translates that JSP file into a regular Java Servlet, compiles it, and executes it to return standard HTML to the browser.

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