問題の解決にご協力ください。フォームがあります。コードは次のとおりです。
<form action="test" method="Post">
<input type="text" name="text" autofocus >
<input type="submit" value="">
</form>
ファイルの名前を入力すると、その名前がサーブレットに渡されます。サーブレットのコードは次のとおりです。
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");
test.txt のようなファイル名を入力するフォームがありますが、テストのみを入力して、txt を入力することはできませんか? 回答に非常に感謝しています。コードを提供していただければ)拡張子が txt のファイルのみを入力します。必要はありません。