JSR 286 TUTORIAL PDF

The focus of this tutorial is largely the concept of encoding namespaces using various components from the JSR Portlet 2. More Portlet 2. When a portal page is rendered, the doView method of every portlet on the page is invoked, not just that one portlet with which you might currently be interacting. Dealing with data clashes on the portal server The previous tutorial did a pretty good job of demonstrating the basic concepts and APIs involved in handling web based forms, but a portlet developer with a keen eye would know that there was a troubling little time-bomb hidden in that seemingly innocuous code that was just waiting to explode when the right set of conditions appear at runtime. Our portlet uses the request.

Author:Mikinos Zolodal
Country:Samoa
Language:English (Spanish)
Genre:Personal Growth
Published (Last):2 July 2016
Pages:199
PDF File Size:2.66 Mb
ePub File Size:2.56 Mb
ISBN:875-3-86189-903-2
Downloads:74579
Price:Free* [*Free Regsitration Required]
Uploader:Munris



The focus of this tutorial is largely the concept of encoding namespaces using various components from the JSR Portlet 2. More Portlet 2. When a portal page is rendered, the doView method of every portlet on the page is invoked, not just that one portlet with which you might currently be interacting. Dealing with data clashes on the portal server The previous tutorial did a pretty good job of demonstrating the basic concepts and APIs involved in handling web based forms, but a portlet developer with a keen eye would know that there was a troubling little time-bomb hidden in that seemingly innocuous code that was just waiting to explode when the right set of conditions appear at runtime.

Our portlet uses the request. What if another portlet also uses an HTML form with a textfield named number? Furthermore, our portlet might end up reading the number from another portlet on the page and respond to a submission with which it had no business interacting.

The page that contains our NumberGuesserPortlet might also include a StockSellingPortlet that wants to know the number of shares a user wants to sell. That same page might also have a SpousalBenefitsPortlet that needs to know the number of wives or husbands a user has. If each portlet makes a call to request. This method will return an alpha-numeric character set that uniquely identifies a portlet on a particular page.

All form elements should be encoded using the getNamespace method of the response, and all fields being read in a portlet should assume the field has been namespace encoded. Note : For simplicity, this xxxbook will use examples that exclude the namespace call. This is fine for learning, but is completely unacceptable in development or production. Uniquely identify all of your form data and JavaScripts code by using the getNamespace call to encode their names.

One caveat that you must be aware of is that if you encode a field in a JSP , make sure you use the same encoding scheme when retrieving that field on the server, or else the field you are looking for will come back as a null. The solution is to use a special method in the renderRequest called getContextPath. This returns a path to the root of the portlet application. From there, you can map to resources such as image files in subfolders. So, if you had an image named wiw.

LENNOX NEOSYS PDF

JSR-286 development tutorial: Linking back to the portal with the PortletURL

Each filter interface extends a common base interface named javax. This common base interface contains two methods: init javax. FilterConfig filterConfig and destroy. The init method ensures that every filter has access to a FilterConfig object from which it can obtain its initialization parameters: a reference to the PortletContext that it can use, for example, to load resources needed for filtering tasks. The destroy method signifies the end of service of the filter.

JOVAN JOVANOVIC ZMAJ RIZNICA PDF

JSR-286 development tutorial: An introduction to portlet programming

All portlets implement this interface either directly or, more commonly, by extending a class that implements the interface. Developers should typically extend, directly or indirectly, the GenericPortlet class to implement their portlets. The Portlet provides the additional optional lifecycle interfaces EventPortlet and ResourceServingPortlet that the portlet can implement. Basic four lifecycle methods The init PortletConfig config is called once, immediately after a new portlet instance is created. It can be used to perform startup tasks and is akin to a servlets init method. For example, PortletConfig provides access to initialization parameters.

FRUCTOSEFREIE LEBENSMITTEL LISTE PDF

JSR-286 portlet development tutorial and technology guide

For example, if we wanted the user to guess a magic number between one and ten, we might provide an HTML form that looks something like figure Using HTML forms to obtain input from a user is nothing new to a web developer, but using forms in a portlet environment does presents a few unique and annoying challenges. The idea is that when the portlet is first viewed, it will ask the user to guess a magic number between one and ten, as seen in figure Figure For this example, we will hard code the magic number to be 5.

ATRIAL FIBRILASYON PDF

JSR-286 development tutorial: Data clashes and encoding namespaces

By using portlets as controllers, delegating complex business logic to JavaBeans or even a RESTful or SOAP-based service layer, and using JSPs to generate the user interface, developers are effectively embracing the proven model-view-controller design strategy. In a good model-view-controller type of application, a Java-centric component should never be polluted with lots of lousy HTML. In this regard, good portlet applications are no different. However, portlet applications do present some unusual complications when deferring to a JSP for markup generation. For example, how does a JSP link back to a specific portlet on a page? How does a portlet invoke a JSP?

Related Articles