13.07.2015 Views

IBM WebSphere Portlet Factory Overview - Lotus

IBM WebSphere Portlet Factory Overview - Lotus

IBM WebSphere Portlet Factory Overview - Lotus

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

I want to use some Java code in myModel.Linked Java ObjectThis builder lets you point at a Java class. Itthen adds the public methods of that classto your WebApp, so you can call them fromany builder input where you specify anaction.In some scenarios, you could also use theMethod builder. This builder lets you easilycreate a simple Method, which can makecalls to display pages, call methods, orexecute service calls.Note that if you need significant amounts ofhand-coded Java, you should write a Javaclass and bring it into the Model with aLinked Java Object builder instead of usingMethod builders. This will make the Modeleasier to manage, and the code assistanceis better in the Eclipse Java editor. Ingeneral, Method builders in your Modelshould only contain small amounts of “glue”code.I want to add error handling to myModel.Error HandlerThis builder catches Java exceptions thatmay occur within the run-time execution of aWeb application’s actions. The errorhandling can be specified on any action,such as a page, method or action list. Youcan also set a general handler for the entireapplication to be used if an action has noerror handler. This type of error handling ismodeled closely after the Java try-catchexception handling and JSP page directive,where each page can set the error page atdesign time. In all of these cases the lowestlevelhandler (catch) is called to handle theexception.I want to add caching to my Model.For example, I am populating anEmployee select list from a database call.Since the list of employees does notchange that frequently, I want to cachethe content when I have received it fromthe database.Cache ControlThis builder caches the output of a specificaction within a Model. Note that this cachingis across users: all users in a given profilewho access that Model will be presentedwith the same cached data. When thiscaching is suitable, it can substantiallyimprove performance.Service Operation and Lookup Tablebuilders also have built-in caching options(this is implemented under the covers withCache Control).<strong>WebSphere</strong> <strong>Portlet</strong> <strong>Factory</strong> V6.0.1 Getting Started Guide - 27 -

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!