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
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue