Questions tagged [servlets]
Servlet is a Java application programming interface (API) running on the server machine which can intercept the requests made by the client and can generate/send a response accordingly.
33,155
questions
-1
votes
0
answers
15
views
How to set ServletRequestListener as javaagent?
I develop a simple java servlet Web App, and write ServletRequestListener code like this.
This code prints messages when a http request is initialized and destroyed.
package org.example.listener;
...
0
votes
0
answers
22
views
Error under JSP page while Using this line <x:parse xml = "${xmlFile }" var = "File"/>
i am creating a Jsp page and a xml page .
my jsp page is :
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
...
0
votes
0
answers
8
views
Run Smallrye graphql as a servlet inside embedded jetty
I want to extend my existing embedded jetty-server with graphql functionality. After some readings the smallrye implementation seems the best fit for me.
I found the smallrye (https://github.com/...
1
vote
1
answer
30
views
Validating a OTP without storing it anywhere like database and Sessions
I have generated a eight digit random OTP and sent it to mail using servlet. I want to validate the OTP at the next page without storing it anywhere like database and session. How can I do this?
-1
votes
0
answers
17
views
login without js and php
I should log in without using js and / or php, my data is saved in an external file that has the function of DB, I have a .java class with which I save them in a map, for the web part I recall this ...
0
votes
0
answers
16
views
Implementing X509 authentication in Servlet
How to implement mutual X509 authentication in Servlet. Should I change the config in web.xml for the browser to prompt for a certificate request or should I change the server.xml to enable ssl?
0
votes
0
answers
25
views
Where is servlet-api.jar in Glassfish 5.1?
Trying to build a Java web-site, i'm getting errors:
The import javax.servlet cannot be resolved
Some searching implies that in order to import javax.servlet you need a special jar file that comes ...
0
votes
0
answers
22
views
convert servletoutstream to base64.outstream in Servlet
Is there a way to convert the outputstream to base64outputstream, everything works except for the last part in which I don't get anything, neither log nor error, just a blank screen when executed.
It ...
0
votes
1
answer
28
views
How to submit data via Form in a For-Loop?
I have a method that prints a table with values of 7 columns. I wanted the data of the fifth columns to be a link, that when i click on them i get directed to another page, where I have more details ...
0
votes
0
answers
23
views
Should filterChain.doFilter be called even if the request is being forwarded to an error controller?
Should filterChain.doFilter only be called if an exception has not occurred inside contextManager.initialize?
private final ContextManager contextManager = new ContextManager();
@Override
public void ...
-1
votes
0
answers
14
views
Upgrading to Tomcat 10 with SIP 1.1 giving failed build
My application is using Sip api 1.1 with Tomcat 7. I have upgraded tomcat to Tomcat 10 and done all the marathon changes to my application code. Tomcat 10 is using Servlet 5.
But the problem is Sip 1....
0
votes
3
answers
37
views
org.springframework.web.servlet.PageNotFound noHandlerFound getting this
Jun 26, 2022 5:27:51 PM org.springframework.web.servlet.PageNotFound noHandlerFound
WARNING: No mapping found for HTTP request with URI [/hello/] in DispatcherServlet with name 'spring' getting this ...
-1
votes
0
answers
23
views
Why does my program respond incorrectly to HTTP post requests? [closed]
I use some HTTP request tools to make post requests for my services. Some tools' post requests will be responded by doget methods. Why?
@WebServlet("/ReceiveServlet")
public class ...
0
votes
3
answers
37
views
Error Creating Bean Controller and Repository
I've problem with Spring. I have one controller that Autowires a repository but when I try to implements the method save(), I got this exception here. Can someone tell me how to deal with this ...
0
votes
0
answers
28
views
Accessing File from tomcat servlet [duplicate]
Hello im trying to access and use a HTML file in a tomcat servlet from my InteliJ project folder .
I deploy the Intelij Porject with smart-tomcat.
In the project structure I have tried to put the html ...
0
votes
0
answers
30
views
XML Configuration to Java Configuration - Spring Security in Springboot
I'm working on a spring to springboot conversion project. In the existing spring project, I have below secure.xml file which needs to be converted into Java Configuration Class.
<?xml version="...
-1
votes
1
answer
38
views
Can't create a Servlet in eclipse due Path for project must have only one segment
enter image description here
An error has occurred. See error log for more details.
Path for project must have only one segment.
facing issue while adding servlet in eclipse
0
votes
0
answers
22
views
How to display Tree View in JSP
I want to display tree structure in JSP, but don't know how to do it.
I have parent-child categories, this is my recursive query
enter image description here
I tried to do it using depth, wrote this ...
0
votes
1
answer
14
views
using SFTP in JSCH to upload files,I want to know how to display the progress about uploading files
my web page have a button to select the files,when the button clicked,it will send files data to webserver,then webserver will build a SFTP service which is built from JSCH,then the files will be ...
-1
votes
0
answers
19
views
I am working in JSPs. HttpSession attribute value which is set as session.setAttribute(name, object) is giving me another value after one action
In this LoginCommand class, I am saving the "current_page" attribute in the session. If the authentication succeeds "current_page" attribute value changes.
I have a controller that ...
0
votes
0
answers
14
views
Insert Array in Phpmyadmin database
I'm trying to insert a array in my database and I selected 3 values like broccoli,carrots,Cabbage but only broccoli is inserted ang those 2 values are not inserted can someone help me with this thank ...
0
votes
1
answer
31
views
In a Jakarta app, catch Servlet exceptions from a Filter by wrapping the filterChain.doFilter in a try catch
I have a Jakarta based app, that has a number of servlets and a common filter that sits in front of them all.
Some of the servlets may throw an exception and I'd like to handle it inside the filter ...
-1
votes
0
answers
23
views
Intellij Servlet example not working with Tomcat
I'm trying to run the basic hello world example that is automatically crated when you create a new project with the Web Application template in Intellij IDEA Ultimate.
The probleam is that when I try ...
0
votes
0
answers
13
views
Embedded Tomcat backgroundProcessorDelay
The embedded tomcat server uses server.tomcat.background-processor-delay which is by default 10 sec. So by going through the documentation it says that Delay between the invocation of ...
0
votes
1
answer
24
views
How to send 2 array in servlet [duplicate]
I sending a 2 array in my servlet but i don't know how to send my second array in javascript to my servlet I hope someone help me with this thank you.
<label for="pets">Choose your ...
-4
votes
0
answers
31
views
I can't access the images contained in my jee web application [duplicate]
In my jee application, I can't display on my web page (via jsp) the images contained in my "photos" folder. I placed this folder in the root of the application and in the webapp subfolder. ...
-2
votes
0
answers
13
views
Java servlet with html frontend - update html text everytime button is pressed with java? [duplicate]
So im creating java backend with servlets and very basic frontend with html. Im wondering if there is a way where I can update the text on the picture everytime the user clicks on the update button?
...
-2
votes
0
answers
10
views
while uploading files in jsp & servlet my files get uploaded in .metadata/plugin/temp0 path not in project structure under webapp? [duplicate]
enter image description here am not getting uploaded files in desire folder .instead of it I am getting it into default deployment path ..plz tell me how to fix this issue .earlier it was working fine....
1
vote
1
answer
38
views
Servlet gives error that the server did not find current representation for target resource [duplicate]
I am creating a basic demo project for servlet but I keep getting this error whenever I run the project or index.html file. I have mentioned the servlet configurations in the web.xml. Also, I have ...
0
votes
0
answers
7
views
Error Message: At lease one ContentNegotiationStrategy is expected . In Spring 5.3.20 getting error need content negotiation strategy
Doing spring 5.2.7 to 5.3.20 upgrade and getting negotiation strategy missing error
<bean id="contentNegotiationManager"
class="org.springframework.web.accept....
1
vote
0
answers
20
views
JSP/MySQL how to stop a form from accepting entries if a value in a column in mysql is filled
this is my first time ever writing here, Idk if the way I asked is clear...
I have a form with a select with 4 options. These 4 options are saved in a database in MySQL in a single column. I want to ...
0
votes
0
answers
52
views
Require Tomcat configuration to restrict exe's from downloading
I have a web application hosted in Apache Tomcat
I am looking for apache configuration to restrict downloading exe's when I hit the URL
when I hit http://<server_name>/abc/xyz.exe application ...
0
votes
1
answer
42
views
Vaadin 23 cannot import annotation @VaadinServletConfiguration
In the Vaadin 23 documentation, precisely here it show an example which includes the java annotation @VaadinServletConfiguration.
@WebServlet(urlPatterns = "/*", name = "myservlet",...
0
votes
0
answers
35
views
My servlet isn't matching my jsp, how can i do? [duplicate]
i'm tryng to head out this problem but i can't figure it out.
So i have my Servlet and my jsp page, but when i run the server and i click on the link that should trigger the logic for my jsp, just ...
0
votes
0
answers
22
views
android studio (using REST API) login avd not working
now i'm making login activity using REST API.
we get column values from table in sqldeveloper.
but when I click the button(login_btn), it doesn't work.
here is the code below.
This is LoginRequest.
...
0
votes
1
answer
24
views
Command Line Argument servlet.init-parameters.development=true has no effect in Spring Boot Application
I run a Spring-Boot application (v2.7) via Eclipse Run configuration. In the Program arguments section, I pass the parameter
--server.jsp-servlet.init-parameters.development=true
But this doesn't ...
0
votes
0
answers
20
views
Get HTTPRequest in HttpSessionListener
Due to project requirement I have created a HttpSessionListener in my spring based application.
public class SessionListener implements HttpSessionListener {
public void sessionCreated(...
1
vote
1
answer
26
views
Unit Testing for MultiPartEntityBuilder fails with org.apache.http.ContentTooLongException: Content length is unknown
I have a class in my javax servlet application that serves as a proxy and creates multipart form data for POST requests. During regression tests (actual calls to the servlet) the application performs ...
0
votes
0
answers
16
views
Implement Autosuggestion fuctionality inside Ajax call
Hi guys I really need one help in this issue , I am not able to figure out ,any help would be welcome.
So in my Servlet i have this code
String json = gson.toJson(supplierDetails);
System....
-2
votes
0
answers
56
views
Some issues with the JWT token
I have some issues with the JWT token. My application work on java using Apache-Tomcat for a web server. For JWT handling I have found some code on the internet which creates and verify a JWT using a ...
-1
votes
0
answers
18
views
Javascript in jsp is not working in Ecllipse
I need to validate my jsp code using javascript.I use script tag in my program, but onclick does not reach the js code.It simply goes to the next servlet page without validating.Even I tried simply ...
0
votes
0
answers
18
views
How to have body of GET method show up on index.html instead of /Servlet
Hi I know that there are better ways of doing this, but this is an assignment so it has to be in the GET method of my servlet. I have the form set up, but I am wondering how to make the form show up ...
0
votes
1
answer
61
views
Getting exception on connecting Jakarta EE project to H2 database
I'm trying to connect my Jakarta EE 9.1.0 project to H2 database but I get this exception:
org.h2.jdbc.JdbcSQLNonTransientConnectionException: Duplicate property
"USER" [90066-212]
Here is ...
0
votes
1
answer
47
views
'org.h2.server.web.WebServlet' is not assignable to 'javax.servlet.Servlet,jakarta.servlet.Servlet'
I'm using jakarta.jakartaee-api 9.1.0 and H2 2.1.212.
I get this error when I try to add H2 Console Servlet to web.xml file:
'org.h2.server.web.WebServlet' is not assignable to
'javax.servlet.Servlet,...
-1
votes
1
answer
54
views
Java getAttribute() method error in the servlet
I am Facing an issue while trying to get sum element in one servlet from the other by using Request Dispatcher.
But the getAttribute() method in S2.java is giving error while accessing the sum from ...
0
votes
0
answers
15
views
I want to insert the data in foreign key table and also the user.id
I want to insert the data in foreign key table and also insert the user.id to know who user inserted the data like for example I login the account benjie and the user.id is 1 and I want to insert data ...
1
vote
0
answers
27
views
mkdir() doesn't work in Dynamic Web Project
I'm trying to upload files using a servlet, which creates a new directory and insert the file into that. Now I'm trying to create the directory, but the problem is that the path doesn't match. Can you ...
0
votes
0
answers
70
views
Google stop SMTP gateway 2022 May 30th
Google stop SMTP gateway 2022 May 30th ? How to send mail using Gmail api with servlet(java), jsp
Properties properties = new Properties();
properties.put("mail.smtp.host", "...
-1
votes
3
answers
41
views
How to separate these 2 users with their own content or todo list
I'm developing a TODO list like add the data and display in table but when I log in other account I got the same content with other account how to separate the pages with their own content.
Please ...
0
votes
1
answer
54
views
Dynamic Web Project, create object with variables submitted by for with GET method
I am trying to get the values from a form in order to create an object with those values. How would I do this? Also currently when I hit submit I get the http 404 error. I know I'm doing this wrong, I ...