Anurag
Anurag

Reputation: 227

Formating the string in jsp page.

I am stuck in one condition. i am using spring with JDBC template. I am displaying an jsp page where i am sending model attribute object and then displaying the content of the respective object.

  String test=request.getAttribute("question").toString();  
    String str2=test.substring(0, 124); 
    String str3=test.substring(125);

here is what i am splinting the whole string. now in jsp tag i want to show both str2 then br and str3 below is my jsp tag

<input type="text"  style="width: 700px;" readonly="true" value="<%=str2 %> " id="subjectTitle"/>

at this point

 value="<%=str2 %> "  

I want to concatinate the str2+ str3 but between dis two i want str3 string should go next line.

please help

Upvotes: 1

Views: 1422

Answers (2)

Hemrajani
Hemrajani

Reputation: 1

Use HTML break tag in between your two expressions to display your answer in next row

Upvotes: 0

Hardik Mishra
Hardik Mishra

Reputation: 14887

You can't. The only HTML form element that's designed to be multi-line is textarea

input type text creates a single-line text input control.Control types created with INPUT

Upvotes: 1

Related Questions