This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Portals and Portlets and the fly likes How to retrieve portlet id within a portlet code? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Portals and Portlets
Bookmark "How to retrieve portlet id within a portlet code?" Watch "How to retrieve portlet id within a portlet code?" New topic

How to retrieve portlet id within a portlet code?

Alka Parveen

Joined: Oct 29, 2007
Posts: 5
I am trying to retrieve a portlet id. Its a jsr 168 portlet with vignette portlal. Can anyone please suggest that except using RenderResponse's getNamespace() method, how to do this. Is there any vignette API for this. Please help in this regard.

Thanks in advance,
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968

Are you talking about the name that appears in the portlet.xml file, or the unique id that the portal assigns to a unique user instance of a portlet?

Either way, I'm not sure if you're going to have too much luck, other than with the encodeNamespace.

Maybe you could tell me what you're trying to do. If it's the name in the portlet.xml file, why not just duplicate it as an init-param and read it by the PortletConfig or even the PortletContext, depending upon the scope you're after. I'm trying to imagine what your problem is - I think assigning an initial parameter to the portlet might solve it.

Here's a nice little CBT tutorial on how the various portlet config objects work: Working with PortletConfig and PortletContext Objects with a JSR168 Resource

Kind regards,

-Cameron McKenzie
Alka Parveen

Joined: Oct 29, 2007
Posts: 5
hey thanks,
Actually i am try to read portlet unique id within portlet code. i am using vignette portal. I know that it is possible through JSR 168 API's RenderResponse but i am asking for any other method which can do this. because most of the time i dont have render parameters in my portlet. so if you know any of vignette portal API or any other method then please share.

Thanks for your help,
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63211

zeba, please check your private messages.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
murali kankanala
Ranch Hand

Joined: Nov 15, 2004
Posts: 110
Hi Friends

Can any one help me how to start learning a portal development, for example i want to know how to work on Vignette Portal.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: How to retrieve portlet id within a portlet code?
It's not a secret anymore!