Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Other Java Products and Servers and the fly likes JSR168 Portlet User-Attributes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Other Java Products and Servers
Bookmark "JSR168 Portlet User-Attributes" Watch "JSR168 Portlet User-Attributes" New topic
Author

JSR168 Portlet User-Attributes

Damian Harvey
Greenhorn

Joined: Aug 02, 2001
Posts: 12
I'm not sure if this is the right forum for this. If not could someone point me elsewhere.

I have an issue with a JSR168 Portlet that has 3 attributes defined in the <user-attribute> section of the Portlet.xml. I can't find any information on how to set these values.

Can anyone help me out with this?

Thanks,

Damian.
Mike Farnham
Ranch Hand

Joined: Sep 25, 2001
Posts: 76
Damian,

If they are defined in as Initial Parameters, then you can get them using the getInitParameter() method.

example:
static String LIST_PAGE = "ListPage";
String page = getInitParameter(LIST_PAGE);

portlet.xml excerpt
----
< !-- example of an init parameter<br /> init parameters should be used if there is configuration<br /> used by ALL instances of the portlet on your server <br /> it should not be used for instance-level parameters<br /> -->

<init-param>
<name>ViewPage</name>
<value>/WEB-INF/jsp/view.jsp</value>
</init-param>
<init-param>
<name>ListPage</name>
<value>/WEB-INF/jsp/list.jsp</value>
</init-param>

----

Cheers,
Mike
 
Consider Paul's rocket mass heater.
 
subject: JSR168 Portlet User-Attributes
 
Similar Threads
How to retrieve portlet id within a portlet code?
Welcome to the Portal / Portlets Forum
Get Login User
Calender Portlet using jsr168
Getting Logged in User from JSR 168 Portlet API