• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic