Most voted "servlet" questions
Servlets are programs that run on a web server or application server, acting as an intermediate layer between the request coming from a web browser or some other HTTP client and a database or application that runs on the HTTP server.
Learn more…191 questions
Sort by count of
-
1
votes1
answer274
viewsHow to make it load the full Welcome-file url
In web.xml it is mapped like this: <welcome-file-list> <welcome-file>agendamento/index.xhtml</welcome-file> </welcome-file-list> When opening the application in the browser…
-
1
votes2
answers1332
viewsTransfer files. class to the /web-inf folder in Eclipse
I’m developing a web project for a final college job. When creating . jsp files for the application, it gives error because it does not find the class of Servlet. The classes and the files . class…
-
1
votes2
answers202
viewsChange class vector size
I have to use vector public static String vetor[] = new String [15]; in the class... but this class is used in a Servlet. And the size I need the vector is what the user chooses... how can I pass…
-
1
votes2
answers543
viewsJava error SQL query
I am trying to make a webapp in java , however I am beginner , in the login part of the app, I created a routine that receives as parameter an object and performs a search in the database according…
-
1
votes1
answer88
viewsEvents and changes in a JSP?
Hello. I have a jsp being a chat (due to a restriction, I am using Struts 1). In this JSP, I have the following div: <div class="conteudo" id="conteudo" name="conteudo">. I need to, return an…
-
1
votes2
answers387
viewsProblems with if Else in Servlet
I’m messing with jsp. In mine servlet have if and else if and they both send to the same page, only with different values. However, when you enter the if(shows the result) and then when it returns…
-
1
votes0
answers191
viewsError 404 Servlet
I have an error that is the following whenever I access the URL that my Servlet had to answer it presents me error 404, I am trying to access the Servlet by this url: localhost:8080/project/oa Here…
-
1
votes0
answers126
viewsFlush in asynchronous Servlet does not work
I am studying for web certification, and came across a problem while trying to make a chat using long pooling, but precisely in the article:…
-
1
votes1
answer1100
viewshow to convert a request. String parameter to integer
In a program I have to do I arose this difficulty Familia.setSalariodoPai(request.getParameter("salariodoPai")); but this request is returning a String and I would need Integer .Bs that stretch is…
-
1
votes1
answer54
views24x5 process in jar how to convert to . War
I created a jar to calculate forex signals, but I’d like to host it on some cloud server. As I’ve been researching, it will be much easier to convert it to a War. Since my app should run 24x5, I…
-
1
votes0
answers203
viewsSign in when making web service requests
I created a Web Service that brings results in the format JSON in java, but sometimes when the user makes some request to the Web Service the same hangs and interrupts the whole service, I wonder if…
-
1
votes2
answers68
viewsNullpointerexception on a Servlet when using Datavoting method
I’m working with a Servlet however, this giving error java.lang.NullPointerException when I use the object method DataVoting. Follows the code: @Override protected void doGet(HttpServletRequest…
-
1
votes0
answers339
viewsSave image to the application folder (File upload) using EJB+Servlet JSP
Good people? I need an example of how to upload the file using the technologies, EJB+Servlet+JSP... I am working on a project that needs to insert the images dynamically in my application. Hugs!…
-
1
votes1
answer197
viewsURL mapping
When accessing a user’s profile, I pass their user name as a parameter. www.site.com.br/busca?usuario=nomedousuario I would like to access as follows www.site.com.br/nomedousuario Someone has the…
-
1
votes0
answers59
viewsError while running Choose to query JAR file
I created a Servlet that should access a class in java that is in a Jar file in Servlet Buildpath, but it is giving an error, I will leave the prints here for those who can help me take a look.…
-
1
votes1
answer139
viewsServlet recover Object
It is possible to recover populated object in requestParameter? Type coming from Javascript? req.getParameter("objeto"); I have the object Person who possesses Name Telephone in Javascript I send…
-
1
votes1
answer165
viewsFilter passes before login Servlet
Good evening guys, I have a question, I don’t even know if I need to post the code to solve. The filter is being called before the login Servlet, that is, with that the user is never logged in. How…
-
1
votes0
answers33
viewsHow to enable cross-origin on Tomcat?
Basically I need to enable the Cross-Origin in my Tomcat 8.5. I want to know the right way to do this and what the risks are?
-
1
votes2
answers612
viewsHow to make unique record query
I have a JSP that on the same screen I register for consultation. When opening the screen I have basically the fields for the registration below a grid with the list of the bank, so far so good,…
-
1
votes0
answers81
viewsHow to get into Arraylist on a JSP and pass as parameter p/ a Servlet (Link)
This list has the Id_book,Titulolivro,Autorlivro, which is displayed on the page correctly. Only I want to create a link to a Servlet passing the Id_book. How do I do it? Below is the code:…
-
1
votes1
answer255
viewsHow to remove the project name from the Java Servlet URL
I have a question and I’ve searched all over the internet and I haven’t found it, how the hell do I get the name of the project from the url in java? ex: http://localhost:8084/MeuProjeto/login for…
-
1
votes0
answers124
viewsJava Session, Jsessionid changes
I have a web page that requests a Servlet via Ajax. In Servlet I create a Session to keep the employee authenticated and to identify him within the system. However, when I leave the system, I put…
-
1
votes0
answers59
viewsAjax does not pass information to Servlet
I have a problem with the code, Servlet is not called. It only works if I put action="Fileuploader" in the form. Is there an error? Is there any other way? What I need: an array of images, where…
-
1
votes1
answer489
views -
1
votes0
answers249
viewsRedirect Servlet to JSP by passing data
I’m doing a library project, I register Book, Publisher and Parents and then I display them on JSP. When I register the data appear normally in JSP but if I refresh the page they are re-registered.…
-
1
votes3
answers344
viewsDetermine the page where the *.pdf file will open in the browser
I have a code to display a pdf file: @WebServlet(urlPatterns = {"/teste"}) public class abrirPDF extends HttpServlet { byte[] arquivo = null; File file = new File("C:\\testes\\teste.pdf"); protected…
-
1
votes1
answer139
viewsError while publishing Java 7 - Java 7 vs Java 8
I rented a VPS server and when trying to connect my android application with Java EE, I received the following message: type Exception report message app/server/CSelerServer : Unsupported…
-
1
votes2
answers104
viewsSending Servlet attributes to more than one JSP?
I have a Servlet that does the following: L_sessao.setAttribute("Login", usuario); response.sendRedirect("InicioCliente.jsp"); It sends the user name to the Homeclient.jsp page, on this page I can…
-
1
votes2
answers113
viewsHow to limit the amount of addresses a user may have in the database
I have a database, and I have the user table and the address table. I need to validate somehow so that a user can have at most 5 addresses in the registry. I use the Postgresql database and it is an…
-
1
votes1
answer663
views -
1
votes1
answer269
viewsPass variable from daughter page to parent page in jsp
I’m making a simple crud in java using jsp and servlets. And I came across the following situation: I have a layout.jsp which makes the include of another dynamic page, which in this case will be…
-
1
votes0
answers711
viewsexecute CMD command through JAVA
I am having trouble executing a command in CMD through JAVA. This command is executed by a . jar that lies inside a directory "C: Copyutility Copyutility.jar. So I need to enter this directory and…
-
1
votes1
answer720
viewsDisplay specific error! java.sql.Sqlexception'
Hello I am as following code: <c:set var="exception" value="${requestScope['java.sql.SQLException']}"/> <p class="alert alert-danger"><b>Ops!</b> Erro: <br><br>…
-
1
votes1
answer260
viewsJava filter for specific pages
How do I control the access of pages with Java? I have a filter already implemented, which controls whether the user is logged in or not. However, I have a page that I need to check the user’s…
-
1
votes2
answers677
viewsjava.lang.Nullpointerexception JSP Servlet
I’m developing a web application using jsp and Servlet and I want to show all my records from my database and the amount of records in a table, I created a DAO in which I performed the queries in…
-
1
votes1
answer249
viewsServlet giving error 404
I’m trying to create a posting application, I started studying the Java Web now and every time I run Servlet on Apache 8 it appears a 404 error page. my life package app.web4.servlets; import…
-
1
votes0
answers45
views -
1
votes1
answer289
viewsHow do I show an image that is in the database using jsp?
Well, here’s the thing. I’m using JSP, SERVLET and Mysql to insert images into my project, it turns out I just keep the image path in the database, and then call this path to show the image. Then…
-
1
votes2
answers1756
viewsUploading files with Java
Good morning! I was trying to upload files, where I have a web page that makes a request to my Folder. In the form of the page I have an input of type file and another of type text. The encoding…
java java-ee upload file-upload servletasked 6 years, 10 months ago Carlos Rafael de Oliveira Carn 50 -
1
votes0
answers24
viewsError while using Servlet resources
Good evening colleagues, Please, I need your help to understand what’s going wrong, I have the following form: form action="CronogramaNegocio" method="get"> <div class="col-md-3…
-
1
votes0
answers96
viewsDo current versions of Java have packages for Servlet?
On the college computer I used this code to connect Java to the Web. It worked, but at home, I have a more current version of Eclipse and the code behaved differently. It does not recognize the…
-
1
votes0
answers62
viewsDoubt on popular combobox giving setAttribute Java Web - Servlet, jsp
Why are not populating the two combobox? It seems that when I leave two setAttribute, it considers only one... This is the combobox of the filled groups... Java class code in the Command package:…
-
1
votes0
answers44
viewsHow to query database postgres from web java
I want to do a database search from my HTML page by typing the first letters (eg and%) and in the table should appear the list of words starting with the typed letter: My database is Postgresql.…
-
1
votes0
answers54
viewsServlet mapping via annotation @Webservlet is not working
I’m a beginner in Javaweb development. I’m using Java version 11 and Tomcat version 9.0. When using the annotation @WebServlet(urlPatterns) in the classes OiMundoServlet.java and…
-
0
votes1
answer462
viewsImage Servlet for JSF Project "Locking" the Application Server
I have the following code that provides my portal with the images that are in the database @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException,…
-
0
votes1
answer68
viewsHow can I tunnel tcp with java?
The idea is this: Create a classe that keeps an eye on us eventos of socket client and when he receives data to classe redirects to the client that is connected to app. how to do this in java?…
-
0
votes1
answer1240
viewsHow to convert Time type to String?
I have a field horaConsulta and I can’t turn him into String DAO stmt.setTime(4, new java.sql.Time(consulta.getHoraConsulta().getTime())); Servlet Time horaConsulta =…
-
0
votes0
answers409
viewsHow to upload files to my server using Java Servlets
How to upload files to my server using Java Servlets, and after uploading the file return the url the file is in, where the name originates from the date and time the file was uploaded so that no…
-
0
votes1
answer227
viewsWait Servlet finish action, and update screen with js
I pass a value to Servlet, with js, not to redirect the page: var formData = new FormData(); var xhr = new XMLHttpRequest(); xhr.open('POST', 'ServletMessage', true); xhr.send(formData); and write…
-
0
votes2
answers223
viewsJSP information for another JSP
Example: I have a JSP A, which has some information and a button. When you press this button, JSP A sends variables to B (such as id, name...). B would use this information and update the page…