Should I use HttpServletRequest.getParameter() or...
I would like to customize Access token based on authorization code which is sent in the token endpoint reqeust.I am doing this as per spring boot Oauth2 documentation.Token customisationSpecifically,...
View ArticleSession data is lost after submitting a form in servlet application
I'm working on a java servlet application on reset password function. The get method basically check a parameter email and check if the email valid. Then set the email as an attribute in the session....
View Articlecvc-elt.1: Cannot find the declaration of element 'web-app'
When I created new dynamic web project in Eclipse, automatically created web.xml showed the following error:cvc-elt.1: Cannot find the declaration of element 'web-app'and a red background on this...
View ArticleI got a java server online, on vercel, how to make request from it?
I have made a java server locally, it works perfectly with mysql db connection, i choosed to deployed it on vercel and make from it requests both from postman and also from the interface of the web app...
View ArticleApache Velocity - Resource not found exception
I have a requirement to generate some automated mails and so I wanted to use velocity for this task.I have copied all velocity jars to the lib folder and created a hello.vm template and placed in...
View ArticleSEC_E_INVALID_TOKEN (0x80090308) - Jetty HTTPS servlet
I am trying to solve an issue with my Jetty servlet running over HTTPS.This is an error in the browser:This is an error in the curl:What I did:I created my Keystore and Truststore as is described here:...
View ArticleHow to set up a Facelets template for a Jakarta Servlet web application (not...
This question was asked on Stack Overflow more than 12 years ago, and the answer was "No". Today, JSP is considered a deprecated technology, and Facelets has replaced it.However, my application is not...
View ArticleJava Servlet Filter Capture Root Path [duplicate]
I am creating a small servlet project to mock an authentication flow. I am performing authentication with a servlet filter sitting in front of a few JSP pages.To map the urlPatterns captured by the...
View ArticleVaadin 23, Blank index.html page when routing any URL
I am trying to run a page using Vaadin 23, but I get index.html on any urlMy project uses:java version=17spring-mvc version=5.3.20apache tomcat version=8.5.85But as a dependency manager on the project...
View Articlejavax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0x7fa2258640:...
I am trying a demo Android app to connect servlet (both local server and aws instance) it gives Handshake failed error. I have tried with volley and http client also. The relevant code and logcat...
View ArticleAccessing ServletContext and HttpSession in @OnMessage of a JSR-356...
I need to get the ServletContext from inside a @ServerEndpoint in order to find Spring ApplicationContext and lookup for a Bean.For the moment my best approach is to bind that bean in the JNDI naming...
View ArticleHttpServletRequest to complete URL
I have an HttpServletRequest object.How do I get the complete and exact URL that caused this call to arrive at my servlet?Or at least as accurately as possible, as there are perhaps things that can be...
View ArticleHow can I get MIME type of an InputStream of a file that is being uploaded?
Simple question: how can I get MIME type (or content type) of an InputStream, without saving file, for a file that a user is uploading to my servlet?
View ArticleEmbedded Jetty with WebAppContext and ServletContextHandler and other Handlers
I an using embedded Jetty server in my java application. I want to use a web application (war file) and a Servlet in embedded jetty server dynamically at the same time. For that I am using...
View ArticleCustom OncePerRequestFilter reads empty request body – why is the body...
I'm developing a Spring Boot application (with Spring Security) and need to add default headers (specifically, Content-Type and Content-Length) to requests targeting the endpoint /api/v1/mpos/set-token...
View ArticleIllegalArgumentException ("getWriter() has already been called for this...
SummaryWe're seeing an intermittent IllegalArgumentException during HTTP response serialization using Spring Boot 3.4.2 on Kubernetes. The exact same image sometimes works perfectly, and other times...
View ArticleServer http://localhost:8081 requires username and password
I am trying to access localhost:8080 but it is showing me I need to enter user name and password.I tried to enter the password that I was playing with but non of those are working. Is there anyway I...
View ArticleMongoDB Java Driver returns all documents instead of matching filter in Java...
I'm building an Expense Tracker web app using Java Servlets and MongoDB. I want to filter expense documents based on user and category (e.g., user: "chir", category: "education").However, when I run...
View Articlejava.lang.IllegalStateException: getReader() has already been called for this...
I want to add logging to my Servlet, so I've created Filter which should display request and go to the Servlet. But unfortunately I've encoutered exception:java.lang.IllegalStateException: getReader()...
View ArticleServlet doesn't go to JSP
When I am my ConfirmServlet at the end of the doPost() it should open my ResultServlet. But instead the link stays /Confirm at the end and I get a blank page. Could anyone help me what's wrong with my...
View ArticledoGet and doPost in Servlets
I've developed an html page that sends information to a servlet. In the servlet, I was using the method service to get that information and perform operations.I've read that other methods that I could...
View ArticleWorking with jsp files not html except login.html which is first page...
I am working with web project using Servlet. When I am redirecting to after login.html form it is not showing .html file but .jsp with same content.Here is my code screenshot and directory structure.As...
View ArticleHow to map one servlet on multiple URL patterns?
I want to use one servlet for many pages. when i try to run the project, an error occurs because the request is full. have tried many options for URL patterns, but nothing comes outright now, i see...
View ArticleShutting down an ExecutorService
In Tomcat, I wrote a ServletContextListener which will start an ExecutorService during startup and terminate it when it is unloaded.I am following the example in the javadoc for ExecutorServicepublic...
View Articledwr-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...
View ArticleBeanAlreadyExistsException - Oracle WebLogic
I deployed an app on my web server and now I am trying to deply another one on the web server and I am getting a BeanAlreadyExistsException. I thought it might be due to the fact that I have two beans...
View ArticleGoogle Recaptcha v3 example demo
Until now, I was working with Google Recaptcha v2, but now I want to update my WebApp using the lastest version (v3).Is it possible to anyone add a fully working Google Recaptcha v3 example for a basic...
View ArticleSend array from one servlet to another servlet and print it?
First of all, I want to send parameters from html to Servlet and it works.Then I create an array from parameters and I want to send that array to another servlet. and just print it in Servlet2.Here is...
View ArticleIssue regarding JSP Forward
In my code I am trying to forward my request by using below line<jsp:forward page = "<%=request.getContextPath()%>/Welcome.do"/>However its giving error...
View Articletycho compiler-plugin cannot compile
When building an OSGI bundle with tycho, the compiler-plugin throws the following error: ...AnswerServlet.java:[307] resp.setCharacterEncoding("UTF-8") ^^^^^^^^^^^^^^^^^^^^^^^^The method...
View Article