Conversation Scope

Our next task is to create a new book entry or to edit an existing one. The book editor shall consist of a tab panel offering one page for the books meta data like title, author, publisher, and one page for each language, where you can edit a review. It must be possible to switch between these pages without loosing data. Not very hard to imagine, that we need a backing bean living longer than just one request. Continue reading “Conversation Scope”

Web Development with Java and JSF: Bean Validation

As stated before, Books is an application, maintained by just one author, who should know about the expected data. Thus, there is no user interface with immediate response after each input or lots of hints. Of course, those features are essential for an application for potentially “unknown” users. Later on, when developing Alumni, we will cover those features in detail. However, a validation is useful to prevent the user from entering data which might not fit the database. Continue reading “Web Development with Java and JSF: Bean Validation”

Tutorial web development (with JSF) XV – Security with JDBCRealm

Ok, we secured our JSF web application by using a JSF form. The user information is still stored in a flat text file. But as stated before, your application server provides more. This lesson, we move forward to GlassFish’s JDBCRealm, which allows you to store the user information within the database. Continue reading “Tutorial web development (with JSF) XV – Security with JDBCRealm”

Tutorial web development (with JSF) XIV – Security Part III

Now, after we’ve addressed basic log-in with simple file realm, I want to move on by exchanging the authentication method. Remember, this tutorial is about web development with JavaServer Faces. All I showed for container based security so far, is technology entirely independent from JSF. Same applies to simple form log-in. But, it’s possible to embed this into some JSF techniques. And, further on, using programmatic log-in, this is done by the use of JSF. Continue reading “Tutorial web development (with JSF) XIV – Security Part III”

Tutorial web development (with JSF) XIII – Security Part II

In this part of the security trail, we start with Basic Authentication and fileRealm. For some basic background information, please refer to the former part.

To secure the TinyCalutor, we need to add a security constraint to web.xml. Continue reading “Tutorial web development (with JSF) XIII – Security Part II”

Tutorial web development (with JSF) XII – Security Part I

Sometimes it is crucial to protect an application or data against unauthorized access. Although there is no need to secure my tiny calculator, I’m going to demonstrate the principals of container based security by using this small app. For a description of the project, please refer to Tutorial web development (with JSF) III: Basic arithmetics.

Container provided security is not specific to JSF. It’s part of the HTTP handling and might be used by a simple servlet too. But later on, I’m going to show you, how to integrate this into a JSF application by using programmatic access. But, first of all, some background. Continue reading “Tutorial web development (with JSF) XII – Security Part I”

GlassFish 4 and UTF-8

Do you build web applications with JSF and GlassFish? And do you need to process inputs with characters which are coded with multi-bytes using UTF-8, e.g. German Umlauts? You might have recognized a strange behavior if you use GlassFish 4.

Now, let’s check for the problem by building a simple application. With NetBeans, simply choose New Project, Java Web, Web Application. Add JSF as framework. If you need detailed information how to create a web application with NetBeans, please take a look into my JSF tutorial. Continue reading “GlassFish 4 and UTF-8”

Web Development with JSF

Do you like to read about web development with JSF? Try my tutorial [2]. Even though the examples are explained with NetBeans, you may follow this tutorial using any other IDE.

If you like this tutorial (and want me to continue), please leave a comment.

[1] http://blog.mueller-bruehl.de/tutorial-web-development/

(You may support this web site by flattr me)

Tutorial web development (with JSF) IX – Application “Books”, Part II

In part VII of this tutorial you’ll find some requirements of the book application. The application is live now, and you can find it here [1]. The information about the books and the reviews is stored in a database. JavaServer Faces is well suited for database   driven server applications. Thus, developing web applications with JSF normally includes developing with database techniques. In the context of Java EE 6, this usually would be Java Persistence API (JPA). And often it touches other techniques like Context and Dependency Injection (CDI), Bean Validation and other stuff. The book application will use a couple of this too. Continue reading “Tutorial web development (with JSF) IX – Application “Books”, Part II”