- Home
- Products
- Integration
- Tutorial
- Barcode FAQ
- Purchase
- Company
java barcode reader The next method, decodeScope(), returns the scope of a portlet session attribute. in Java
The next method, decodeScope(), returns the scope of a portlet session attribute. QR Code JIS X 0510 Creator In Java Using Barcode generator for Java Control to generate, create Quick Response Code image in Java applications. www.OnBarcode.comQR Code JIS X 0510 Reader In Java Using Barcode recognizer for Java Control to read, scan read, scan image in Java applications. www.OnBarcode.compublic static int decodeScope(String name) Barcode Encoder In Java Using Barcode printer for Java Control to generate, create Barcode image in Java applications. www.OnBarcode.comBarcode Encoder In Java Using Barcode generator for Java Control to generate, create Barcode image in Java applications. www.OnBarcode.comThe value returned is either PortletSession.PORTLET_SCOPE or PortletSession.APPLICATION_SCOPE. Both of these methods look at the name of the attribute to determine if it starts with the portlet scope namespace, which is javax.portlet.p . Encode Code 39 In Java Using Barcode maker for Java Control to generate, create Code 39 Full ASCII image in Java applications. www.OnBarcode.comDraw GTIN - 12 In Java Using Barcode creation for Java Control to generate, create UPCA image in Java applications. www.OnBarcode.comDownload at
Print GTIN - 13 In Java Using Barcode creation for Java Control to generate, create EAN-13 image in Java applications. www.OnBarcode.comNW-7 Generator In Java Using Barcode encoder for Java Control to generate, create Monarch image in Java applications. www.OnBarcode.com 4
Print Quick Response Code In Visual C#.NET Using Barcode generation for Visual Studio .NET Control to generate, create QR Code JIS X 0510 image in VS .NET applications. www.OnBarcode.comQuick Response Code Drawer In Visual Basic .NET Using Barcode printer for .NET Control to generate, create QR image in .NET framework applications. www.OnBarcode.comSessions and Interportlet Communication
Recognize Barcode In Visual C# Using Barcode Control SDK for Visual Studio .NET Control to generate, create, read, scan barcode image in Visual Studio .NET applications. www.OnBarcode.comPrinting USS-128 In .NET Using Barcode maker for Reporting Service Control to generate, create GTIN - 128 image in Reporting Service applications. www.OnBarcode.comPortlets communicate with other portlets in the same portlet application through the user s portlet session. In the initial version of the portlet API, this is the only available interportlet communication functionality. Portal vendors may offer a proprietary way to pass messages or events between portlets. Future versions of the portlet API will probably provide a standard for communication. If we have one portlet that has a list of employees, and another portlet that displays their insurance information, the portlets will share a reference to the current employee in the session. Both portlets must be in the same portlet application to share the session. We will create a simple content browser tool that consists of two portlets. One will display a set of topics, and the other will display content. When the user clicks on a link in the topic browser, the portal page will refresh, the portal sends an action request to the topic portlet, and then the portal sends render requests to all of the portlets on the page. The topic portlet reads the id parameter from the action URL when the portlet processes the action request. The portlet then places the id parameter in the portlet session as the contentId parameter in the application scope. We named them differently here to make it clear that the parameter on the action request is distinct from the parameter on the portlet session. The render request and the other portlets in the portlet application do not have access to the action request parameters. There are three key points to remember for interportlet communication using sessions: The portlet places the parameters in the session s application scope. Be sure not to enable caching for the portlets. Changes to the portlet session must occur during an action request to guarantee that the updates propagate to every portlet during the render request. There is no guarantee that the portlets render in any particular order. Synchronization is not required, because only one action request will be processed for each user at one time. Our TopicPortlet class shows how to add a parameter to the session in the processAction() method to communicate with another portlet. We also use the createActionURL() method on the response to create action URLs for our content. Barcode Encoder In Java Using Barcode generator for BIRT Control to generate, create Barcode image in Eclipse BIRT applications. www.OnBarcode.comPDF-417 2d Barcode Creation In Visual Studio .NET Using Barcode generation for .NET Control to generate, create PDF417 image in .NET applications. www.OnBarcode.compackage com.portalbook.portlets.content; import java.io.IOException; import java.io.Writer; import java.util.ArrayList; Create Matrix Barcode In Visual Studio .NET Using Barcode maker for Visual Studio .NET Control to generate, create Matrix 2D Barcode image in Visual Studio .NET applications. www.OnBarcode.comBarcode Generator In None Using Barcode generator for Office Excel Control to generate, create Barcode image in Microsoft Excel applications. www.OnBarcode.comDownload at
Creating Code-128 In None Using Barcode creation for Online Control to generate, create Code128 image in Online applications. www.OnBarcode.comCode 3/9 Maker In Visual Studio .NET Using Barcode creation for ASP.NET Control to generate, create Code 39 image in ASP.NET applications. www.OnBarcode.comPortlet Concepts
Barcode Recognizer In Visual Studio .NET Using Barcode Control SDK for ASP.NET Control to generate, create, read, scan barcode image in ASP.NET applications. www.OnBarcode.comPrint Barcode In Visual Basic .NET Using Barcode generator for Visual Studio .NET Control to generate, create Barcode image in .NET applications. www.OnBarcode.comimport java.util.Iterator; import java.util.List; import javax.portlet.ActionRequest; import javax.portlet.ActionResponse; import javax.portlet.GenericPortlet; import javax.portlet.PortletException; import javax.portlet.PortletSession; import javax.portlet.PortletURL; import javax.portlet.RenderRequest; import javax.portlet.RenderResponse; public class TopicPortlet extends GenericPortlet { List topics = new ArrayList(); public void init() { topics.add("xerces"); topics.add("lucene"); topics.add("xalan"); topics.add("jdom"); } public void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException { response.setContentType("text/html"); Writer writer = response.getWriter(); Iterator iter = topics.iterator(); while (iter.hasNext()) { String key = (String) iter.next(); PortletURL actionURL = response.createActionURL(); actionURL.setParameter("id", key); writer.write("<a href='" + actionURL.toString() + "'>"); writer.write(key + "</a><br>"); } } Download at
4
public void processAction(ActionRequest request, ActionResponse response) throws PortletException, IOException { PortletSession session = request.getPortletSession(true); String id = request.getParameter("id"); session.setAttribute("contentId", id, PortletSession.APPLICATION_SCOPE); } } The ContentPortlet class checks the session for a parameter named contentId in the application scope. If the portlet finds the content ID, it displays the appropriate content. There is no processAction() method on this class it expects that the new content piece will come from the session through the topic browser. If this portlet ran on its own, it would have no way of changing its content. package com.portalbook.portlets.content; import java.io.IOException; import java.io.Writer; import java.util.HashMap; import javax.portlet.GenericPortlet; import javax.portlet.PortletException; import javax.portlet.PortletSession; import javax.portlet.RenderRequest; import javax.portlet.RenderResponse; public class ContentPortlet extends GenericPortlet { private HashMap contentMap = new HashMap(); public void init() { contentMap.put("xerces", "Xerces is an open source XML Parser."); contentMap.put("lucene", "Lucene is a Java search engine."); contentMap.put("xalan", "Xalan is an open source XSLT engine."); contentMap.put("jdom", "JDOM is an open source Java XML parser."); } public void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException {
|
|