Uploaded by tutorials168portlets on Jul 14, 2008
http://www.scja.com/jsr168/index.jsp?link=multi11modes
Check out my actual website for the full screen, high resolution video:
http://www.scja.com/jsr168/index.jsp?link=multi11modes
Standard JSR 168 Portlet Modes
Any preliminary look at the portlet API will demonstrate a major similarity between portlets and servlets. Both portlets and servlets handle the request-response cycle, both are Java centric components, and both have access to the J2EE runtime environment. But there are some major differences between portlets and servlets as well.
One of the most significant ways portlets are different from regular servlets is their support for various modes, namely view, edit and help. When it comes to portlet modes, there is no applicable analogy to typical servlet and JSP programming. This tutorial will look at the various modes available to the portlets you create, and how a developer can programmatically take advantage of these modes.
Breaking Away from a Portlet as a Servlet Mentality
Handling a request-response cycle is the most fundamental aspect of portlet programming, but inspecting a request and sending out a response to the client through a portlet is by no means revolutionary. After all, request-response programming is exactly what we do in a Java servlet.
Let?s compare a Portlet to a Servlet: instead of a doView method, a Java Servlet has a doPost or a doGet method. Instead of being passed a PortletRequest or a PortletResponse object, a Java servlet is given an HttpServletRequest and HttpServletResponse object. In many ways, handling the request-response cycle of a portlet is very similar to handling the request-response cycle of a Servlet. In fact, one of the great things about portlets is the fact that they leverage our existing knowledge of the Servlet and JSP APIs.
But what makes a portlet so incredibly sexy is all of the features and services the Portlet API affords us, over and above that of the Servlet API. The most fundamental difference between a Portlet and a Servlet is the various modes in which a Portlet can participate.
A portlet has three standard, and any number of custom, implementable modes, namely: * The View Mode * The Edit Mode * The Help Mode
The most common, and only required mode of a Portlet, is the view mode. When a Portlet is displayed on a page, it is typically displaying its view mode. In fact, the specification requires every portlet to have a doView method so that the portlet can render itself on a portal page.
Optionally, a portlet can provide an implementation of any of the other standard modes, with perhaps the most useful mode being edit, and the most helpful, being help. :)
Please support our site, link to us, buy some books, and remember: Happy Java!
If you get a chance, pick up my Portlet Development Book on amazon.com And check out my Hibernate & JPA development book, WebSphere book, and SCJA Sun Java Certification Guide as well!
http://www.scja.com/associate
http://www.thebookonhibernate.com
Category:
Tags:
- doEdit
- doView
- doHelp
- doConfigure
- PortletMode
- processAction
- Java
- Portlet
- Tutorial
- Sample
- Code
- WebSphere
- Pluto
- 168
License:
Standard YouTube License
-
2 likes, 0 dislikes
8:34
Introduction to Portlet Development: Programming to JSR 168by tutorials168portlets20,076 views
4:47
02. Creating your first Liferay Portletby rohitbrai28,047 views
9:04
PortletSession APPLICATION_SCOPE: 168 Portlets Sharing Databy tutorials168portlets3,659 views
2:41
WebSphere Portal 6.1 Look and Feel Developmentby alden0c11,356 views
9:51
Java Servlet : HTML with Servlet [ part 2]by gogorenger3,060 views
6:52
PortletSession: How to Manage Portal User State Programatically in doViewby tutorials168portlets2,597 views
10:22
Liferay Portal: From Zero to Intranet in 10 Minutesby sez11a34,131 views
9:41
Java Servlet : HTML with Servlet [ part 1]by gogorenger11,438 views
2:00
WPF_01_SampleApplicationby SamiSalkosuo1,620 views
7:56
Using the PreferencesValidator in a JSR168 Portlet: Tutorialby tutorials168portlets1,086 views
6:00
The Best Web2 Demo Ever!by quasifu2,238 views
1:01
How To Get FREE Steam Gamesby BombBangBoom12,002 views
7:21
Part I: Portlet Edit Mode and the NumberGuesserPortletby tutorials168portlets5,772 views
7:18
Java Servlet : Redirect , Forwardby gogorenger1,429 views
6:20
Portlet Encode NameSpace: How to Encode a Portal NameSpaceby tutorials168portlets1,184 views
9:52
JSP Exception Pageby vittayasak727 views
7:33
JSP (Java Server pages) video tutorialby sharman210162,017 views
6:53
Action Processing in a JSR168 Portlet: WindowStates Tutorialby tutorials168portlets2,484 views
8:26
Action Processing Portlet: IRAD & RSA & WebSphere Portal WPSby tutorials168portlets818 views
3:52
Simple Demo showing Portlet communication with a Formby quasifu643 views
- Loading more suggestions...
Link to this comment:
All Comments (0)