サーブレットについて勉強しています。
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { RequestDispatcher dispatcher = request.getRequestDispatcher("test.jsp"); dispatcher.forward(request, response); return; }
上記のコードについて、returnが書かれているコードとないコードがあるのですが、どちらが良いのでしょうか?
以前、https://teratail.com/questions/764で「returnで終了させた場合は例外処理のfinallyブロック内の処理が実行されます」という回答があったのですが、これと関係があるのでしょうか。
宜しくお願いします。
回答3件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/02/08 04:32