• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with a portlet

 
Gorka Astigarraga
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • 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?
 
Bimal Patel
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic