Skip to Main Content
Java EE 7 Recipes: A Problem-Solution Approach
book

Java EE 7 Recipes: A Problem-Solution Approach

by Josh Juneau
May 2013
Intermediate to advanced content levelIntermediate to advanced
748 pages
20h 58m
English
Apress
Content preview from Java EE 7 Recipes: A Problem-Solution Approach

6-10. Invoking a Managed Bean Action on Render

Problem

You want to invoke an application-specific action when a JSF view is rendered.

Solution

Add an f:metadata tag to the head of your view, and then embed a viewAction component within it, specifying the action method you want to invoke. This technique can be handy for executing back-end code prior to loading a page. As such, this technique can also be used to replace the f:event tag in order to create a bookmarkable URL. In this example, the Acme Bookstore author bio page has been updated so that it can be directly linked to, passing in an author’s last name as a view parameter via the URL. The viewAction component is executed before the view is rendered, invoking the business logic to search ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Beginning Java EE 7

Beginning Java EE 7

Antonio Goncalves
Beginning EJB 3: Java EE 7 Edition

Beginning EJB 3: Java EE 7 Edition

Jonathan Wetherbee, Chirag Rathod, Raghu Kodali, Peter Zadrozny

Publisher Resources

ISBN: 9781430244257Purchase book