How-to articles, tricks, and solutions about JSP

How can I upload files to a server using JSP/Servlet?

To upload files to a server using JSP/Servlet, you can use the following steps:

How do you import classes in JSP?

To import classes in a JSP (JavaServer Page) file, you can use the <%@ page import="package.class" %> directive.

How to solve the “failed to lazily initialize a collection of role” Hibernate exception

The "failed to lazily initialize a collection of role" exception in Hibernate is thrown when you try to access an uninitialized collection from a Hibernate entity when the entity is in a detached state.

Redirect to an external URL from controller action in Spring MVC

To redirect to an external URL from a controller action in Spring MVC, you can use the RedirectView class and return it from the controller action.

The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path

This error typically occurs when you are trying to use the HttpServlet class in a Java project, but the necessary libraries are not included in the project's classpath. To fix this error, you need to add the servlet-api.jar library to your project's class

What is the difference between JSF, Servlet and JSP?

JavaServer Faces (JSF) is a user interface (UI) framework for building web applications.