please help solve the problem, there is a form, here is the code:
<form action="test" method="Post">
<input type="text" name="text" autofocus >
<input type="submit" value="">
</form>
I enter the name of the file into it, and then the name is passed to the servlet. Here is a piece of code a servlet:
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException{
request.setCharacterEncoding("UTF-8");
response.setContentType("text/html; charset=UTF-8");
String myName = request.getParameter("text");
I have a form to enter a file name like this: test.txt, and you can enter just a test, no txt? I would be very grateful for the answers, and if you give them a piece of code) I enter only files with the extension txt, without the need