Formatted String Does Not Work When Write To A Portlet

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Akino877
    New Member
    • Nov 2007
    • 37

    #1

    Formatted String Does Not Work When Write To A Portlet

    Hello,

    I have a Java formatted string which looks like the following :

    PrintWriter out = renderResponse. getWriter();
    ...
    String format = "|%1$-30s|%2$-10s|%3$-10s|%4$-10s|%5$-10s";
    out.printf(form at, field1, field2, field3, field4, field5);

    And I can write this formatted string to the sdtout or a file; it works fine. But when I try to write it to a portlet, the formatting does not work. The widths of the fields do not get printed.

    I wonder if someone could please tell me what I am doing wrong/what I need to do to get this to work.

    Thank you so much,

    Akino
Working...