Generating JSON from POJOs without JAXB
A common format for data exchange between web frontend and backend system is JSON. Most tutorials you find will tell you how to use JAXB (Java API for XML Binding) and its Java annotations for...
View ArticleDefining a simple JSON Envelope for JSON Responses of our REST Services
The browser (or any client) sends HTTP requests to our Glassfish server in order to consume our REST Services. If the server is able to process the request it returns the response data itself and a...
View ArticleImplementing Login, Logout and Register services as RESTful Web Services (REST)
Securing Java EE 6 Web Applications on Glassfish using JAAS by Nabi Zamani May 05th, 2012 subscribe to our tutorials inShare1 Usually when developing complex multi tier applications at some point...
View ArticleCatching all REST Exceptions with an ExceptionMapper
In our REST Services we have used try-catch blocks to catch Exceptions that might occur. But in some cases RuntimeExceptions can be thrown and so far we have no code for handling such exceptions. Our...
View ArticleImplementing the view with Java Server Pages (JSP)
We want to offer a self-registration feature for our web application. Any user should be allowed to register a new account by entering a username and a password. So what we actually need is a very...
View ArticleSecurity Configuration in web.xml and glassfish-web.xml
We will start with the web.xml. The first interesting part is is the configuration of Jersey. As you can see everything that matches the url pattern /services/* is handled by the Jersey Servlet – so...
View ArticleCreating a jdbcRealm
Securing Java EE 6 Web Applications on Glassfish using JAAS by Nabi Zamani May 05th, 2012 subscribe to our tutorials inShare1 Usually when developing complex multi tier applications at some point...
View ArticleRunning the application
When deploying the application to your local Glassfish just call http://localhost:8080/AuthenticationDemo/secure/index.jsp and see what happens (I assume you have deployed to “AuthenticationDemo”, the...
View ArticleDownload Source Code
Instead of creating your Eclipse or NetBeans project according to this tutorial you might prefer to download the preconfigured project I offer. This might save you some time because you can import it...
View ArticleThe Apache Struts web framework
The Apache Struts web framework is a free open-source solution for creating Java web applications. Web applications differ from conventional websites in that web applications can create a dynamic...
View Article