如何使用portlet比仅使用服务器端包含更好?

时间:2021-04-06 18:49:27

The idea behind portlets is that a website/page can be comprised of a number of applications that are developed individually. They are then fit together on a page by a portal much like a jig-saw puzzle. This allows functionality to be created independently and slotted together at a later date. This has many obvious benefits.

portlet背后的想法是网站/页面可以由许多单独开发的应用程序组成。然后它们通过门户在页面上组合在一起,就像一个曲线锯拼图。这允许独立创建功能并在以后一起插入。这有许多明显的好处。

However. I cannot see how the portlet specification improves upon older ideas like server-side includes, from the point of view of a developer who needs to get something done, as opposed to publish a paper or make a keynote address.

然而。从开发人员需要完成某些工作,而不是发表论文或发表主题演讲的角度来看,我无法看到portlet规范如何改进服务器端包含的旧概念。

The tone might be a bit negative, but my first foray into the world of portlets has left me thoroughly disenchanted.

语调可能有些消极,但我第一次涉足portlet世界时,让我彻底失去理智。

2 个解决方案

#1


From the point of view of the job of just 'including' some dynamic/static content on a web page, you're correct.

从在网页上“包含”一些动态/静态内容的工作来看,你是对的。

However there are a number of conveniences implemented, such as support for personalisation of the portlet (at the portlet/'include' level) and storing this info, a more rigid workflow for configuring what is displayed in the portlet and so on.

但是,实现了许多便利,例如支持portlet的个性化(在portlet /'include'级别)和存储此信息,这是一个更严格的工作流,用于配置portlet中显示的内容等。

Plus obviously there's all the portlet arrangement code that you would have to write otherwise. Some portlet servers do a lot on the client side for arrangement (drag and drop of portlets etc).

显然,除了你必须编写的所有portlet安排代码。一些portlet服务器在客户端做了很多事情来安排(拖放portlet等)。

You may find some of the discussion at the below URL helpful: http://www.ibm.com/developerworks/ibm/library/i-portletintro/

您可以在以下URL中找到一些有用的讨论:http://www.ibm.com/developerworks/ibm/library/i-portletintro/

#2


For sure, the portals create the view essentially by doing lots of server side includes. The portlet specs (JSR-168, 286) just define how to code a portlet so it fits into a portal. They only define things necesary for portlets to co-exist on the same portal page, things that are not a part of J2EE servlet or JSP definitions.

当然,门户网站主要通过执行大量服务器端包含来创建视图。 portlet规范(JSR-168,286)只定义了如何编写portlet以使其适合门户网站。它们只定义了portlet在同一个门户页面上共存所必需的东西,这些东西不是J2EE servlet或JSP定义的一部分。

Without the specs, it would be hardly possible to use portlets from different development teams, or even different vendors on a single portal page.

如果没有规范,几乎不可能在单个门户页面上使用来自不同开发团队,甚至不同供应商的portlet。

Even a single J2EE application with a portal-styled UI can benefit from use of a portlet container - it can help to accomplish many typical UI-related tasks.

即使是具有门户风格UI的单个J2EE应用程序也可以从portlet容器的使用中受益 - 它可以帮助完成许多典型的UI相关任务。

Consider e.g. these features defined by portal specs (just a very few):

考虑例如这些功能由门户规范定义(只有极少数):

  • Portlet lifecycle, isolated from other portlets.
  • Portlet生命周期,与其他portlet隔离。

  • Isolated URL spaces for each portlet
  • 每个portlet的隔离URL空间

  • Portlet modes and window states
  • Portlet模式和窗口状态

  • Portlet session scropes
  • Portlet会话scropes

  • Personalization, portlet preferences. Users configure apperance of their's portal pages by positioning and setting individual portlets.
  • 个性化,portlet首选项。用户通过定位和设置各个portlet来配置其门户页面的外观。

  • Raising / comsuming of events (JSR-286)
  • 提升/消耗事件(JSR-286)

  • ...

The specs are not a rocket science, and also they do not pose a paradigm in UI design or so - to me, the most revolutionary about portals was the idea of a user's desktop brought into web applications.

这些规范不是火箭科学,而且它们也不构成UI设计的范例 - 对我而言,最具革命性的门户网站是将用户桌面引入Web应用程序的想法。

#1


From the point of view of the job of just 'including' some dynamic/static content on a web page, you're correct.

从在网页上“包含”一些动态/静态内容的工作来看,你是对的。

However there are a number of conveniences implemented, such as support for personalisation of the portlet (at the portlet/'include' level) and storing this info, a more rigid workflow for configuring what is displayed in the portlet and so on.

但是,实现了许多便利,例如支持portlet的个性化(在portlet /'include'级别)和存储此信息,这是一个更严格的工作流,用于配置portlet中显示的内容等。

Plus obviously there's all the portlet arrangement code that you would have to write otherwise. Some portlet servers do a lot on the client side for arrangement (drag and drop of portlets etc).

显然,除了你必须编写的所有portlet安排代码。一些portlet服务器在客户端做了很多事情来安排(拖放portlet等)。

You may find some of the discussion at the below URL helpful: http://www.ibm.com/developerworks/ibm/library/i-portletintro/

您可以在以下URL中找到一些有用的讨论:http://www.ibm.com/developerworks/ibm/library/i-portletintro/

#2


For sure, the portals create the view essentially by doing lots of server side includes. The portlet specs (JSR-168, 286) just define how to code a portlet so it fits into a portal. They only define things necesary for portlets to co-exist on the same portal page, things that are not a part of J2EE servlet or JSP definitions.

当然,门户网站主要通过执行大量服务器端包含来创建视图。 portlet规范(JSR-168,286)只定义了如何编写portlet以使其适合门户网站。它们只定义了portlet在同一个门户页面上共存所必需的东西,这些东西不是J2EE servlet或JSP定义的一部分。

Without the specs, it would be hardly possible to use portlets from different development teams, or even different vendors on a single portal page.

如果没有规范,几乎不可能在单个门户页面上使用来自不同开发团队,甚至不同供应商的portlet。

Even a single J2EE application with a portal-styled UI can benefit from use of a portlet container - it can help to accomplish many typical UI-related tasks.

即使是具有门户风格UI的单个J2EE应用程序也可以从portlet容器的使用中受益 - 它可以帮助完成许多典型的UI相关任务。

Consider e.g. these features defined by portal specs (just a very few):

考虑例如这些功能由门户规范定义(只有极少数):

  • Portlet lifecycle, isolated from other portlets.
  • Portlet生命周期,与其他portlet隔离。

  • Isolated URL spaces for each portlet
  • 每个portlet的隔离URL空间

  • Portlet modes and window states
  • Portlet模式和窗口状态

  • Portlet session scropes
  • Portlet会话scropes

  • Personalization, portlet preferences. Users configure apperance of their's portal pages by positioning and setting individual portlets.
  • 个性化,portlet首选项。用户通过定位和设置各个portlet来配置其门户页面的外观。

  • Raising / comsuming of events (JSR-286)
  • 提升/消耗事件(JSR-286)

  • ...

The specs are not a rocket science, and also they do not pose a paradigm in UI design or so - to me, the most revolutionary about portals was the idea of a user's desktop brought into web applications.

这些规范不是火箭科学,而且它们也不构成UI设计的范例 - 对我而言,最具革命性的门户网站是将用户桌面引入Web应用程序的想法。