Since you just want to refresh the current page,ajax
is a better choice for you.
For you current design,both forward
and redirect
are okay,but something need to pay attention:
-
if you use
redirect
,you can set parameters via the url -
after
forward
orredirect
,you need to query the exits comments,which means that you had can eitherredirect
to a new url and query data, or query the data beforeforward
.
2
solved Redirect a JSP request to itself after executing in a Servlet