Added URI fields and added cookie authentication

This commit is contained in:
Ziver Koc 2018-07-27 15:29:00 +02:00
parent 99c67eaaba
commit 8e56ff406a
16 changed files with 133 additions and 71 deletions

View file

@ -76,24 +76,4 @@ public class Zallery extends HttpServlet{
}
}
public static String getCookieValue(Cookie[] cookies, String name) {
if( cookies == null )
return null;
for(Cookie cookie : cookies) {
if ( name.equals(cookie.getName()) )
return cookie.getValue();
}
return null;
}
// /mywebapp/servlet/MyServlet/a/b;c=123?d=789
public static String getUrl(HttpServletRequest req) {
String reqUri = req.getRequestURI().toString();
String queryString = req.getQueryString(); // d=789
if (queryString != null) {
reqUri += "?"+queryString;
}
return reqUri;
}
}