Modified redirect logic for user registration in HtmlServlet to avoid sending 302.