- 浏览: 85274 次
最近访客 更多访客>>
最新评论
-
ww20042005:
这两步就完成了数据库初始化,也太简单了吧!
mysql初始化数据库 -
biaoming:
我也是debian 64的,也想安装qmail,有什么问题希望 ...
在Debian 64bit Sarge版本上安装QMAIL的痛苦之行
Portlet->PortletAdapter
PortletRequest(接口)
PortletResponse(接口)
PortletSession(接口)
Client
基本上新编写的Portlet都是要继承PortletAdapter。PortletAdapter基本上实现所有的接口和方法。与Portlet不同的是,它几乎复写了所有抽象函数。估计设计这样两个抽象类(Portlet和PortletAdapter)是为了不同层次上的继承来设计的。
PortletRequest,PortletResponse,PortletSession没有什么太多的文章,只要在Portlet中正确使用就行了,参考HttpServletRequest,HttpServletResponse。
Client的主要作用是用来探测客户端的类型。
PortletConfig和PortletContext
其中PortletContext比较重要,下面摘录它的描述如下。
The PortletContext provides a mechanism for the portlet to access the services of the portlet container in which it is running. For example, the Context provides access to the PortletLog, servlet context parameters as well as any services hosted by the portal such as Credentials Vault, PersistentConnection and possibly other custom services. The parameters accessed by the PortletContext are the context parameters set in the web.xml. These parameters are common to Chapter 2. Portlet API 89 all portlets deployed in the same web.xml, regardless of their organization into various portlet applications. The PortletContext object is retrieved from the PortletConfig object。
看了描述基本上比较清楚了,唯一比较敢兴趣的是直接去引用呢,还是IBM自己设计了一套更合理的读取方式?
PortletSettings,PortletApplicationSettings看了让人觉得眼花,主要作用是读取和设置在portlet.xml中concrete-portlet元素和concrete-portlet-app元素的属性值。
PortletData(请注意它是一个不需要实例化,一个可以被用户共享,又可以被单独用来存储用户内容的对象)
It provides a quick, secure and effective method of attribute persistence with no JDBC code required.
下面的例子把它解释的比较清楚了。
For example, the HelloWorld portlet uses PortletData to persist the greeting String and the moniker the user wishes to be addressed by. The Administrator installs this portlet, grants edit permissions to the All Authenticated Users group and places it on the Welcome page. The Administrator chooses to edit the portlet and enters “hello there” as the greeting String and “admin” as the moniker. When user JohnSmith logs into the portal page and opens the welcome page, he sees the name admin and the greeting “hello there”. The administrator decides to change the greeting to “Greetings”. Since JohnSmith has not edited the PortletData, he continues to share the PortletData and sees the changes the admin has made. JohnSmith chooses to edit the PortletData to use his name instead of admin. Once he edits the PortletData, he has his own PortletData object. Changes he makes will be seen by no one else. Furthermore, he will no longer see any changes to the PortletData made by the administrator.
PortletLog,PortletException,PortletWindow,User,PortletURI,这些对象差不多从名字就可以判断他们的作用。
Listeners
这些listners用他们的例子来表示是最清楚的。
PortletTitleListener
public void doTitle(PortletRequest request, PortletResponse response) throws PortletException, IOException
{ PrintWriter out = response.getWriter();
String title = getPortletSettings().getTitle( request.getLocale(), request.getClient());
out.print(title + "(" + request.getMode() + ")");
}
PortletPageListener
public class AgendaPortlet extends PortletAdapter implements
PortletPageListener {
........
public void beginPage(PortletRequest request, PortletResponse response)
throws PortletException, IOException {
PrintWriter out = response.getWriter();
out.println("This page contains my agenda.");
}
public void endPage(PortletRequest request, PortletResponse response)
throws PortletException, IOException {
PrintWriter out = response.getWriter();
out.println("End of my agenda.");
}
}
PortletPageListener {
........
public void beginPage(PortletRequest request, PortletResponse response)
throws PortletException, IOException {
PrintWriter out = response.getWriter();
out.println("This page contains my agenda.");
}
public void endPage(PortletRequest request, PortletResponse response)
throws PortletException, IOException {
PrintWriter out = response.getWriter();
out.println("End of my agenda.");
}
}
WindowListener
public void windowMaximized(WindowEvent arg0) throws PortletException {
// Some action can be performed
}
public void windowMinimized(WindowEvent arg0) throws PortletException {
// Some action can be performed
}
public void windowRestored(WindowEvent arg0) throws PortletException {
// Some action can be performed
}
public void windowClosing(WindowEvent arg0) throws PortletException { }
public void windowClosed(WindowEvent arg0) throws PortletException { }
public void windowDetached(WindowEvent arg0) throws PortletException { }
// Some action can be performed
}
public void windowMinimized(WindowEvent arg0) throws PortletException {
// Some action can be performed
}
public void windowRestored(WindowEvent arg0) throws PortletException {
// Some action can be performed
}
public void windowClosing(WindowEvent arg0) throws PortletException { }
public void windowClosed(WindowEvent arg0) throws PortletException { }
public void windowDetached(WindowEvent arg0) throws PortletException { }
发表评论
-
XML的学习笔记(一)
2007-04-02 12:23 1001记得在大学的时候,花了几天的时间看看了XML,可现在再拾起来的 ... -
学习问题[XML学习]
2007-04-02 14:04 8811、一个XML文档可以含有多个dtd文档吗? 答:当然可以完全 ... -
XML的学习笔记(二)
2007-04-02 14:07 737reference to some binary data ... -
Java API for XML Processing
2007-04-05 01:44 1093The Java API for XML Processing ... -
Simple API for XML
2007-04-09 13:27 1064SAX是Simple API for XML的简称。 什么是S ... -
Echoing an XML File with the SAX Parser
2007-04-15 08:34 1020首先要继承ContentHandler类,然后复写几个函数。 ... -
SAX的异常处理。
2007-04-20 14:12 869SAXParseException SAXException ... -
Using the Validating Parser
2007-04-23 14:12 1042首先要明白,Validating Parser是用什么来验证 ... -
Handling Lexical Events
2007-04-25 01:08 790How the LexicalHandler Works ... -
DTDHandler And EntityResolver
2007-04-25 13:43 1096The DTDHandler API In Choosing ... -
Document Object Model
2007-05-01 04:42 931When to Use DOM On the other h ... -
Portal的简单介绍
2007-05-18 03:35 1525什么是Portal? A server to ag ... -
Portal的架构
2007-05-18 07:16 1914Portal的起源 WebSphere Portal find ... -
了解Portlet
2007-05-21 02:38 1068The base building blocks of a P ... -
Portlet的API编程
2007-05-28 09:43 1110Abstract portlet与concrete portl ... -
Portlet Life Circle
2007-05-29 14:51 1270Portlet life circle diagram in ... -
servlet-api的基本类和其接口的介绍
2007-07-16 15:37 1619基本类和接口 一、javax.servlet.Servle ...
相关推荐
JSR168是Java Portlet API...总结起来,JSR168 PORLET标准是Java世界中门户技术的重要基石,它定义了portlet的接口和行为,促进了Web组件的标准化和重用,为构建高度可定制和交互性强的门户网站提供了坚实的技术支持。
Porlet工作流程和Servlet的主要差异在于,Portlet的请求处理有两个独特 的阶段:动作阶段和显示阶段。动作阶段会有“后台”数据改变或动作的代码,这些代码 只会执行一次。显示阶段会产生用户每次刷新时的看到的...
**JSR168与Portlet标准详解...总结,JSR168是Java世界中关于portlet的重要标准,它定义了一套统一的接口和行为,促进了portlet的跨平台复用。通过理解和应用JSR168,开发者可以构建更加灵活、高效的企业级Web门户应用。
这些框架提供了开发、部署和运行Porlet的标准接口和机制,简化了开发流程。 7. **portlet通信** Porlet间的通信可以通过事件模型(Eventing)或渲染参数(Render Parameters)来实现。事件模型允许Porlet之间发送...
"JSR168 PORLET标准手册汉化整理.doc"则是关于JSR168标准的详细解释,可能涵盖了portlet的基本概念、portlet容器的职责、portlet的API接口,以及portlet如何与其他portlet或系统进行交互等内容。理解这个标准对于...
Portlet是一种Java Web组件,遵循portlet规范(如JSR 286或JSR 168),它定义了portlet与门户服务器之间的接口。Portlet可以处理请求、呈现内容,并与其他portlet进行通信。它们通常通过门户框架(如Liferay)来管理...
"Porlet"可能是项目中特定模块的名称,或者是一个自定义术语,可能指的是某种用户界面组件、服务端接口或者特定功能的集合。Porlet可能采用MVC(模型-视图-控制器)架构模式,使得代码结构清晰,便于维护和扩展。 ...
DSAPI是一种专门用于连接Domino服务器和其他应用(如Sun Portal或Oracle Portal)的接口,通过DSAPI可以实现在这些平台之间的SSO。 3. **TAM (Tivoli Access Manager / Tivoli Identity Manager)** TAM提供了一...
- **文件处理**:使用Servlet API的Part接口或者第三方库如Apache Commons FileUpload来解析上传的文件。 - **存储文件**:将接收到的文件保存到服务器的指定位置,可能需要考虑文件命名冲突、大小限制等问题。 -...