Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSR168 Portlet User-Attributes

 
Damian Harvey
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic