Author Archives: Stanislav_Panteleev

Java.Servlet.How can we notify an object in a session that the session is invalid or expired?

✅ Short answer:You can notify an object in the session about session invalidation or expiration by making the object implement the HttpSessionBindingListener or HttpSessionActivationListener interface. These special interfaces allow session attributes (objects stored inside the session) to get “events” when … Continue reading →

Posted in Без рубрики | Comments Off on Java.Servlet.How can we notify an object in a session that the session is invalid or expired?

Java.Servlet.What is session ?

✅ “Session” in web development means:A way to remember a user’s data between different HTTP requests. Because HTTP is stateless by design: Every request is independent. The server doesn’t remember if two requests come from the same user. So a … Continue reading →

Posted in Без рубрики | Comments Off on Java.Servlet.What is session ?

Java.Servlet.What exactly encodeRedirectURL does ?

✅ First: What is sendRedirect() doing?When you call: the server tells the browser:“Hey browser, make a new request to somepage.jsp!”(using an HTTP 302 Redirect response). BUT: If cookies are disabled, you still want the session (like login information) to continue … Continue reading →

Posted in Без рубрики | Comments Off on Java.Servlet.What exactly encodeRedirectURL does ?

Java.Servlets.What is the purpose and difference between encodeURL() and encodeRedirectURL()?

Alright, let’s dive into it clearly: Both encodeURL() and encodeRedirectURL() are methods from the HttpServletResponse interface in Java Servlets. Purpose of both methods:They help encode session ID information into URLs when the client does not accept cookies. Normally, session tracking … Continue reading →

Posted in Без рубрики | Comments Off on Java.Servlets.What is the purpose and difference between encodeURL() and encodeRedirectURL()?

Java.Servlet.What is URL Rewriting?

🧠 What is URL Rewriting? ✅ URL Rewriting is a technique where you append extra information (like a session ID or user data) into the URL itself,so that the server can track the user even if the client doesn’t support … Continue reading →

Posted in Без рубрики | Comments Off on Java.Servlet.What is URL Rewriting?

Java.Servlet.Can i delete Cookie ?

✅ To delete a cookie: Create a new cookie with the same name as the one you want to delete. Set its Max-Age to 0. (Optional but important) Set the same path as the original cookie (otherwise it might not … Continue reading →

Posted in Без рубрики | Comments Off on Java.Servlet.Can i delete Cookie ?

Java.Servlet.What are the methods for working with cookies provided in servlets?

🧠 In Servlets, you work with cookies using the javax.servlet.http.Cookie class. Here’s the full list of the main methods for working with cookies: 🎯 Methods of the Cookie Class Method Purpose Example getName() Get the cookie name cookie.getName() getValue() Get … Continue reading →

Posted in Без рубрики | Comments Off on Java.Servlet.What are the methods for working with cookies provided in servlets?

Java.Servlet.What are cookies?

✅ Cookies are small pieces of data (key-value pairs) that a server sends to the client’s browser,and the browser stores them and automatically sends them back to the server with each future request to the same server. Think of cookies … Continue reading →

Posted in Без рубрики | Comments Off on Java.Servlet.What are cookies?

Java.Servlet.What are the different methods of session management in servlets?

✅ Session Management means tracking user interactions across multiple HTTP requests. Because: HTTP is stateless by design. Every HTTP request is independent — the server forgets everything about the previous request. So if you want a user to “stay logged … Continue reading →

Posted in Без рубрики | Comments Off on Java.Servlet.What are the different methods of session management in servlets?

Java.Servlets.What happens to symbols when i don’t encode them in URL, give example ?

🧠 What Happens if You Don’t Encode Symbols in a URL? The browser or server may misinterpret your URL. Special symbols have specific meanings in URLs. If they are not properly encoded, they can break the URL structure or cause … Continue reading →

Posted in Без рубрики | Comments Off on Java.Servlets.What happens to symbols when i don’t encode them in URL, give example ?