This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of Darcy DeClute's Scrum Master Certification Guide: The Definitive Resource for Passing the CSM and PSM Exams and have Darcy DeClute on-line!
See this thread for details.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
Bartenders:

Problem with a portlet

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have this portlet code:

public void doView(RenderRequest request, RenderResponse response)
throws PortletException, IOException
{
try
{
System.out.println("showText doView()...");
response.setContentType("text/html");
Writer writer = response.getWriter();
PortletPreferences prefs = request.getPreferences();
String text = prefs.getValue("text", null);
if(text == null)
text = "no text";
writer.write(text);
System.out.println("showText end doView()...");
}
catch(Exception e)
{
System.out.println("Error in doView process: " + e.getMessage());
}
}

how can I do to request.getPreferences() read another portlet-preferences.xml file changing the path?
 
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Gorka,

I have few questions with regards to your problem. 1. How could you set portlet preferences in a file other than portlet.xml? 2. Why would you like to get it read from other xml file?

Coming back to your problem, as far as the portlet standards (JSR-168) goes, you have to specify all portlet related configuration in portlet.xml file only, including portlet preferences.
 
Gorka Astigarraga
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Biman

I'm using eXo platform to use this portlets. This portlet only reads \portal\WEB-INF\conf\portal\group\platform\users\portlet-preferences.xml file.
I want to have this file in \portal\WEB-INF\conf\portal\user\userX\portlet-preferences.xml and I don't know how.

I think changing the path would solve the problem.

Thanks for the post
 
Getting married means "We're in love, so let's tell the police!" - and invite this tiny ad to the wedding:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic