Win a copy of Murach's MySQL this week in the JDBC and Relational Databases forum!
  • 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

outputText i want to split a string whith <br/> or /n dosent work ?

 
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a jsf page with this outputText:


<h:outputText value="#{FundDetailBB.benchMarkName}" id="_idProfileBenchMarkValue"/>


The string is : "test1/ntest2/ntest3"

But the result on my page is:

test1/ntest2/ntest3

All i want is that the text on my page is test1
test2
test3

in 3 lines....


I have also tried with


Any good ideas ?

Frank
 
Ranch Hand
Posts: 244
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
well, probably you were meaning '\n' and NOT '/n'.
Moreover, do you want to get or
test1
test2
test3
?

Obviously, as an html page, the output may be different.
 
Frank Jacobsen
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want on 3 lines

test1
test2
test3

byt i dont work with \BR and not with \N

i tried both !

Frank
 
Frank Jacobsen
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
String benchMark = "Test1\ntest2\ntest";
String benchMark1 = "Test1
ntest
ntest";

Gives me one line on the page, and not 3 lines as i want to ops:


Frank
 
Mirko Bonasorte
Ranch Hand
Posts: 244
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well,

the question is: you see one line on your browser? Or you see one line as html source from your browser?
Moreover, you should try with:


In this case, what do you get?
 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Linebreaks in HTML are to be represented with <br>.
The h:outputText by default escapes HTML/XML.
If you want to display plain HTML using h:outputText, you need to set 'escape' attribute to 'false'.
 
Frank Jacobsen
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ahh, that was the answer that i want, and it works !

Im happy

Frank
 
reply
    Bookmark Topic Watch Topic
  • New Topic