Added URI fields and added cookie authentication
This commit is contained in:
parent
99c67eaaba
commit
8e56ff406a
16 changed files with 133 additions and 71 deletions
|
|
@ -64,4 +64,19 @@ public abstract class ZalleryServlet extends HttpServlet {
|
|||
if (dispatcher != null)
|
||||
dispatcher.forward(request, response);
|
||||
}
|
||||
|
||||
public void redirect(String url, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||
if (url.startsWith("http"))
|
||||
response.sendRedirect(url);
|
||||
else {
|
||||
if (!url.startsWith("/"))
|
||||
url = "/" + url;
|
||||
|
||||
String path = request.getRequestURI();
|
||||
if (!path.endsWith("/"))
|
||||
path = path.substring(0, path.lastIndexOf("/"));
|
||||
|
||||
response.sendRedirect(path + url);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue