I use Liferay portlet bundle 6.2 (Tomcat), I save some variable in portlet preference. It's going on without problem, but if I print the entries with System.out.println
, it doesn't come a output on console. Where comes output with System.out.println
in Liferay? How I can work with System.out.println
in Liferay, is there another solution instead of System.out.println
?
In follow I post the code, where comes
Thank you
public void addEntry(ActionRequest request, ActionResponse response) {
try {
PortletPreferences prefs = request.getPreferences();
String[] guestbookEntries = prefs.getValues("guestbook-entries",
new String[1]);
ArrayList<String> entries = new ArrayList<String>();
if (guestbookEntries != null) {
entries = new ArrayList<String>(Arrays.asList(prefs.getValues(
"guestbook-entries", new String[1])));
}
String userName = ParamUtil.getString(request, "name");
String message = ParamUtil.getString(request, "message");
String customer = ParamUtil.getString(request, "customer");
String entry = userName + "^" + message + "^" + customer;
entries.add(entry);
System.out.println("hallo");
String[] array = entries.toArray(new String[entries.size()]);
prefs.setValues("guestbook-entries", array);
try {
prefs.store();
} catch (IOException ex) {
Logger.getLogger(GuestbookPortlet.class.getName()).log(
Level.SEVERE, null, ex);
} catch (ValidatorException ex) {
Logger.getLogger(GuestbookPortlet.class.getName()).log(
Level.SEVERE, null, ex);
}
} catch (ReadOnlyException ex) {
Logger.getLogger(GuestbookPortlet.class.getName()).log(
Level.SEVERE, null, ex);
}
}