32,939 questions
Score of 2
2 answers
111 views
Error 404 occurs when accessing pages within web-inf in the production environment, however the error does not occur in the development environment
Error 404 occurs when accessing pages within web-inf in the production environment, however the error does not occur in the development environment. The server is Tomcat 9. Java 8.
I simply can't find ...
Score of 2
1 answer
183 views
java.lang.ClassCastException: class com.sun.xml.ws.transport.http.servlet.WSServlet cannot be cast to class javax.servlet.Servlet
I took over some "legacy app" which is a SOAP web service based on WSDL files.
As the app was not updated in years and failed to compile with anything but Java 8, I decided, I should try to ...
Score of 0
0 answers
48 views
Displaying search results with JSP and JS not rendering
I'm currenlty working on a hotel management system, and for user management, the user should be able to search the user accounts by their ID, username, or email.
So I'm having trouble with displaying ...
Score of 0
1 answer
157 views
Implementing remember-me/stay logged in logic in a Servlet
I would like to implement a remember-me functionality in my very plain servlet-based system. No Spring, No Shiro, nothing. I'm mightily struggling to make it work.
On paper, it seems fairly ...
Score of 0
0 answers
146 views
Jetty 12 cannot load ResourceServlet
I'm running a Java 21 web application with a static part under /webapp path. Until Jetty 11, we used the DefaultServlet for this. Now we get a warning that it is recommended to use the ResourceServlet ...
Score of 0
0 answers
92 views
Application migration to Websphere Liberty
I am migrating an application to Liberty. The application is servlet-based and uses JSP files. I have created Dockerfiles, a Helm chart, and Liberty configuration files such as server.xml. My ...
Advice
0
votes
1
replies
56
views
Share variable/object between multiple servlets
Suppose I want to create a simple counter app with three different servlets: one to read the value (GET), one to increment and one to decrement the value (both POST):
readvalue.java:
@WebServlet("...
Advice
0
votes
7
replies
138
views
Image not displaying when running Java Servlet project on server (but works when opened directly in browser)
<img src="images/logo.png">
I created a web project using HTML and Servlets (no JSP).
When I open the HTML file directly using “Open in Browser,” the image displays correctly.
But when ...
Score of 0
0 answers
74 views
Connecting Java backend(Servlets) to Vercel frontend(fetch API). Cors Error
So basically I have put up my backend on Render web Service (on tomcat) and my frontend(Nextjs) is on Vercel. I have put up a Filter for Cors Policy to intercept all policies and as well as handled ...
Score of 0
1 answer
117 views
How to use slf4j-api > 2 in jersey servlet container
I have a Jersey servlet project, where I organize the depencies with maven. It runs in Tomcat.
Update of slf4j-api
Now I am trying to use <artifactId>slf4j-api</artifactId><version>2....
Score of 2
0 answers
93 views
Zombie session after expiring cookies using Java Servlets
I have inherited some JAX-RS code with a logout function that appears to be properly "logging out" the user by redirecting to the login page, invalidating the session, and expiring the ...
Score of 1
1 answer
104 views
How can I capture the full raw HTML content and also set header response value about that content with Servlet Filter
I want to be able to capture HTML content and then set a header about that content using servlet filter.
I Can capture the content but I always get an error that the response has already been ...
Score of 1
1 answer
129 views
How to debug the Tomcat Catalina engine
When I tried doing research on this, everything I found was how to debug an application running under Tomcat. I'm trying to debug Tomcat itself, because something strange is happening that I can't ...
Score of 2
1 answer
341 views
How can I upgrade code that uses Apache Commons FileUpload DiskFileItem for the Jakarta namespace?
I manage a Tomcat/JSP webapp. We are updating our source code to conform to the recent javax -> jakarta namespace change in the Servlet package.
The app uses the Apache Commons FileUpload package, ...
Score of 0
1 answer
234 views
dwr-2024 package throws internal version error
I have an older Java/JSP application that I have to update to Tomcat 10 by May 31, 2025. This change in Tomcat versions covers Java's recent javax -> jakarta API namespace change in the packages ...