Questions tagged [Java servlets] (101)

1
answer

How to know the size of the response body in a Java Servlet Filter?

How to know response size (bytes) after passing through the filters chain? Code of filter:MyFilter.class@WebFilter(mapping includes={"/*"}) public class MyFilter implements Filter { private final Logger logger = Logger.getLogger(getClass().getSimpleName()); @Override public void init(FilterConfig filterConfig) throws Ser...
Trever22 asked March 30th 20 at 01:11
0
answer

I do not understand how it works?

Actually there are files in C:\Users\User\Desktop\Tropic-Island\Tropic-Island\Java\apache_tomcat\apache-tomcat-8.5.23\webapps\ROOT edit.jsp,index2.jsp notfound.jsp,create.jsp I go to localhost:8080/index2.jsp here are its contents <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <!DOCTYPE html> ...
Jamison_Harb asked March 29th 20 at 23:15
1
answer

Multipart/form-data java is not come of the field?

Help solve the problem of obtaining data with Multipart/form-data form: Form:<form method="post" action="UploadServlet" enctype="multipart/form-data"> Select file to upload: <input type="file" name="uploadFile" > First name:<br> <input type="text" name="firstname" value="Mickey"> <br / > L...
yessenia.Hand asked March 21st 20 at 13:31
2
answers

Enum what's wrong?

good day to all is enum public enum gendertype { F, M; } And fields in the database c gender type gender please help me I fill the form <div class="w3-card-4"> <div class="w3-w3 container-center w3-green"> <h2>Add user</h2> </div> <form method="post" class="w3-w3 selection-light-grey w3-...
birdie.Schinner asked March 20th 20 at 11:52
1
answer

Why the modified record is written to the end of the list in the database?

There is a jsp page:<c:forEach items="${usersFromServer}" var = "user"> the <tr> <td class=w3-round-small>${user.firstName}</td> <td>${user.lastName}</td> <td>While no dates</td> <td> <form method="post"> <input type="hidden" name="id" value="${user.firstNam...
Dario22 asked March 20th 20 at 11:29
1
answer

Kaka clicking on the redirect button to the edit form?

There is a page that displays all users and 2 buttons in each row to remove and change, pliz Help as to do so would be pressing any buttons to change under the selected field in the table get out of the edit window I would have made changes and after clicking the button the data left would be in a servlet and would pull the...
Amely.Murazik asked March 20th 20 at 11:20
1
answer

How to redirect from one jsp file to another jsp file, edit the entry, and already from it to redirect to a servlet to modify the data in the database?

there is a jsp file with the form <c:forEach items="${usersFromServer}" var = "user"> the <tr> <td class=w3-round-small>${user.firstName}</td> <td>${user.lastName}</td> <td>While no dates</td> <td><form action = "" method="post"> <input type="hidden" name="i...
irma.Kul asked March 20th 20 at 11:08
0
answer

How to transfer pressing the "remove" file.jsp to servlet for deleting data from the database by id?

UserDaoJdbcImpl there is a class which implements the interface UsersDao c 5 methods: find, findAll ,delete, update. public class UserDaoJdbcImpl implements UsersDao{ private final String SQL_DELETE = "DELETE FROM data_user WHERE id = ?"; public void delet(Integer id) { try { PreparedStatement statement = connection.pr...
bethel.Ri asked March 20th 20 at 11:05
1
answer

I have error "Class servlets.MainServlet is not a Servlet"?

Why not get through to the servlet? Prescribed like all right, but can't get through to the servlet error:type Exception reportmessage Class servlets.MainServlet is not a Servletdescription The server encountered an internal error that prevented it from fulfilling this request.exception javax.servlet.ServletException: Class...
mozelle69 asked March 19th 20 at 10:22
2
answers

How to operate javaRush, Codecademy?

Hello! Interested in this simple(or not so) question: how do the services by type javaRush, Codecademy? I really wanted to order to make for training purposes something similar As I see it now: There is a form where I write the code. When you click on them is sent to the server a POST request that contains this code. Furth...
Calista.Feeney18 asked March 18th 20 at 22:10