0

I have trouble using the break tag to break the text in new line. Here is what I get in my Web-Browser: enter image description here

The text is read from a database table. Heree the entry: enter image description here

And the database entry is created with java. Here the java code:

                StringBuilder sb = new StringBuilder();
                sb.append("in Folgender Stückelung : <br />");
                while (itKassette.hasNext()) {
                    KassetteBefuellungZuweisung kassetteBef = (KassetteBefuellungZuweisung) itKassette.next();
                    int Anzahl = kassetteBef.getAnzahl();
                    double inhaltNennwert = kassetteBef.getWert() / Anzahl;
                    if (Anzahl != 0) {
                        sb.append("<br />Inhalt (Nennwert): " + inhaltNennwert + " Anzahl: " + Anzahl);
                    }
                }

I also tried to figure out what is wrong by looking in the chrome console. Here: enter image description here

But I didnt found anything wrong there so I searches the HTML-Sourcecode form that site and got something suspicious. Here the HTML: enter image description here For any reason the browser convertet the encoding! This is a Struts project and Im pretty new to struts, cant say where or why this happens but hopefully I get a few answeres here. Thanks in advance.

Raul Vasi
  • 88
  • 1
  • 11

2 Answers2

0

In the Java code it may not work if you entered
tabgs. Try '/n' instead of

Try using Tag Builder. TagBuilder is a class that specially designed for creating html tags and their content.

0

This issue is of pre-formmatting.
You can wrap your content with <pre> tag. You should use CSS white-space:pre applied to the appropriate <td>.

Here, is a reference link related to this issue.

Rohit Gaikwad
  • 3,677
  • 3
  • 17
  • 40