help to make such a thing (in the previous answer, I was told that I was poorly explained, and now try to explain poponyatneee) I have a form, just a form, the code it is:
<form action="searchf" method="Post">
<input type="text" name="text" autofocus >
<input type="submit" value="">
</form>
The user enters into this form different file names, such as: index.txt, hello.html (files with duplicate names not, and basically it will txt files). Next, the servlet takes string that the user enters:
String myName = request.getParameter("text");
Continue program called input files looking for the files in the folder, but the fact is that it is necessary to enter index.html program to find the file in the folder, not just index, here's help to enter the extension was not necessarily trying to do so :
String myNamee = request.getParameter("text");
String myName = myNamee.replaceFirst("[.][^.]+$", "");
It did not work (I will be glad to any replies
Eric Scot