You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by 风心月影 <fe...@gmail.com> on 2006/01/24 04:31:41 UTC

How to read from portlet.xml

Hello, everyone.
I want to get other one portlet's <init-param> parameter in one portlet.
So I want to know whether in Jetspeed-2 does have the method straight reads
the portlet.xml?

Could someone please elaborate or suggest what can I do for that?

Thanks in advance,

zhenwei

On 1/24/06, Beijing

Re: How to read from portlet.xml

Posted by James Liao <ji...@gmail.com>.
Hi,
You can add a parameter in your portlet.xml like this:
<portlet>
......
  <init-param>
      <name>ViewPage</name>
      <value>/WEB-INF/view/bookmark-view.jsp</value>
  </init-param>
  <init-param>
      <name>EditPage</name>
      <value>/WEB-INF/view/bookmark-edit.jsp</value>
  </init-param>
  <init-param>
      <name>HelpPage</name>
      <value>/WEB-INF/view/bookmark-help.jsp</value>
  </init-param>
......
</portlet>

And read this init parameter with class
javax.portlet.PortletConfig<http://www.bluesunrise.com/portlet-api/javax/portlet/PortletConfig.html>in
your portlet code.
Have a look at this:
http://svn.apache.org/repos/asf/portals/bridges/trunk/common/src/java/org/apache/portals/bridges/common/GenericServletPortlet.java

HTH,

- Jian Liao

On 1/24/06, 风心月影 <fe...@gmail.com> wrote:
>
> 呵呵
> 好的
> 谢谢
>
> 我现在做一个项目,是升级原有的一个基于jetspeed-1的系统。
> 旧系统把好多的逻辑写在了Jsp里面了,所以我们现在决定尽量不修改Jsp,然后修改对应的代码,保证接口不变。
>
> 其中有一个类就是用来读取一个Porlet的参数,在jetspeed-1中,org.apache.jetspeed.xml.api.jetspeedconfig.JetspeedConfig类可以直接读取对应的jetspeed-
> config.jcfg文件里面的参数。现在我想知道在jetspeed-2中是否有同样的类存在。
> 我不想自己去解析portlet.xml文件。
>
> 呵呵,不知道这样说你明白了么?
> jetspeed的资料太少了,也没有时间去阅读它的代码。
> 恩,再次表示感谢!@_@
>
>



--
thanks,
- Jian Liao