I tried Servlet samples from:
https://github.com/arun-gupta/javaee7-samples/tree/master/servlet
and encountered the following issues:
1). An HttpOnly cookie is set as:
cookie = new Cookie("myHttpOnlyCookieKey", "myHttpOnlyCookieValue");
cookie.setHttpOnly(true);
cookie.setMaxAge(60);
response.addCookie(cookie);
and
document.write(document.cookie);
displays the cookie and its value.
2). event-listeners sample is not getting deployed and throwing the
following exception:
Caused by: java.lang.IllegalArgumentException: UT010012: Listener
class class org.javaee7.servlet.event.listeners.MyHttpSessionBindingListener
must implement at least one listener interface
even though the class is defined as:
@WebListener
public class MyHttpSessionBindingListener implements
HttpSessionBindingListener {
...
}
3). file-upload sample allows to upload a file and writes it to /tmp
directory as:
for (Part part : request.getParts()) {
fileName = part.getSubmittedFileName();
part.write(fileName);
}
part.write() is not throwing any exception but not even writing the file.
4). In order to try servlet-security sample, I was trying to add a new
user in application realm as:
./bin/add-user.sh -g g1-u u1 -p p1 -r ApplicationRealm
but getting:
* Error *
JBAS015281: The user supplied realm name 'ApplicationRealm' does not
match the realm name discovered from the property file(s)
'ManagementRealm'.
Adding a user in the default realm, as expected, did not pass
authentication for the secure page. How should the user be added such
that the credentials can be used in an application ?
Thanks,
Arun
--
Blog:
http://blog.arungupta.me
Twitter:
http://twitter.com/arungupta