IOException parsing XML document from ServletContext resource What throws...
XML file is required, as the compiler says, even if it's a REST project. I' d like to intercept the "/login" call, first time on Spring Security dependency and no idea on how to handle this error. It...
View ArticleHttp Servlet request lose params from POST body after read it once
I'm trying to access two http request parameters in a Java Servlet filter, nothing new here, but was surprised to find that the parameters have already been consumed! Because of this, they are not...
View ArticleValues not getting printed outside a for loop
in my program a simple shopping application for my lab exercise, i just calculated the price of items inside a for loop but when i try to print it outside it is not getting printed...pls give me some...
View ArticleHow do I detect the TLS version of an HttpServletRequest?
I am in the process of phasing out support for TLS 1.0 and TLS 1.1 for a web application.I would like to detect users this will impact based on the connections they are making to my servers.I am...
View ArticleAdding image using CRUD java with servlet into mysql database [duplicate]
I am trying to write student registeration project in which student tabel and course tabel have many to many relationship.I've managed to put String and Int date into the table however i cant seem to...
View ArticleCall JavaScript from JSP form tags? [closed]
I have this JSP code<%=xx.getText("SHOP.NR")%>:</th><td><%=web.getFormInputText("NR", "form-control")%>This generates this HTML code in the Browser.<input type="text"...
View ArticleStreaming a POI workbook to the servlet output stream
I build a very large POI workbook, on my web server. Holding the entire workbook in memory , will not scale for multiple concurrent requests. Is there a way i can progressively write the workbook to...
View ArticleFile upload with ServletFileUpload's parseRequest? [duplicate]
I upload the file which I browse with input type="file" in my web App. The issue is I get the FileItem list size as 0 though I can see all uploaded file info under request ->JakartaMutltiPartRequest...
View ArticleORA-12518, TNS:listener could not hand off client connection
I am using ORACLE database in a windows environment and running a JSP/servlet web application in tomcat. After I do some operations with the application it gives me the following error. ORA-12518, TNS:...
View ArticleJava Servlet activejdbc NoClassDefFoundError
I'm trying to use ActiveJDBC inside a HttpServlet - I understand that the DB connection needs to opened on a seperate thread, and can be done through a WebFilter.Unfortunately im snagging at this error...
View ArticleError in tomcat "too many open files"
I have an application running on tomcat and sometimes I have the error below:SEVERE: Socket accept failedjava.net.SocketException: Too many open filesat java.net.PlainSocketImpl.socketAccept(Native...
View Articlejava ee jdbc jstl servlet connection to db
hi guys hope you re doing well please i ve connect a file with class name singletonconnection to my database and it s all working and i created a class to implement some sql querys like selet from and...
View ArticleUtilizing Logging MDC with Virtual Threads
In a typical servlet environment, each request gets its own thread. Adding logging MDC to generate a unique request ID to the request can be achieved with a simple servlet filter.public void...
View ArticleFeign client converts Http Get Request to Post Request
This is my feign client GET Request with Request BodyAnd somehow I think Feign client converts any Get Request with body to POST, because I am receiving 405 Method Not Allowed. But in postman I could...
View ArticleWhat is PrintWriter out = response.getWriter() in a Servlet?
I am new to Servlets.Please, tell me about this line, and its use in the Jersey Framework + RESTful web services.PrintWriter out = response.getWriter();
View ArticleHow to perform clean redirect in spring boot
I'm developing a Spring Boot application that features a POST API. This API accepts a String parameter and generates JSON output. The source of data for the response—either in-memory or from Google...
View ArticlePosting data from a form using Javascript / AJaX to a Tomcat jsp page returns...
Using Javascript to build a form with POST. When the form is submitted using AJaX to a Tomcat jsp page (or a servlet), the jsp page isn't retrieving form data.request.getParameter() is instead...
View ArticleDo I need to call HttpSession.getSession() method everyt time to keep session...
I am reading about HttpSession interface and I am not sure if I understand session expiry correct. Please correct me if I am wrong in this rough case example scenario:The client visits website and on...
View Articlehow to customize HttpServletResponse in springboot for jwt filter response
i have react js and springboot application and i am using jwt token for authorization for that on java restarts i am validating one field called tokenVersion and incase of invalid tokenVersion i am...
View Articlehow to add custom field in the httpServlerResponse for jwt filter
i am have react js and springboot 2.5.x application, for authorization i am using jwt sping security.i have a requirement of when application (java process) restarts need to clear the user session and...
View Article