0

I have a textarea as shown below in my jsp page:

<textarea readonly name="input" style="width:600px; height:70px;"> 
                      <c:forEach items="${serviceForm.claim.remarks}" var="remarkElement"> 
                        ${remarkElement.data} 
                    </c:forEach> 
 </textarea>

I want the data to be displayed like this in the textarea:

data1

data2

data2

However it is being displayed with empty spaces in front of data1,data2 and data3. Thus the data displayed is indented to the right because of the spaces.

When i check the data in my java code there are no spaces to in front of data1,data2...

I am pretty sure it something to do with the for each loop in textarea.

Any idea how i can remove those spaces please?

user1999453
  • 1,297
  • 4
  • 29
  • 65

1 Answers1

1

You have whitespace in your markup. Try:

<textarea readonly name="input" style="width:600px; height:70px;"> 
<c:forEach items="${serviceForm.claim.remarks}" var="remarkElement">
${remarkElement.data}
</c:forEach> 
</textarea>
rgthree
  • 7,217
  • 17
  • 21
  • Thanks a lot for the response i manage to solve my issue by this post:http://stackoverflow.com/questions/8627902/new-line-in-text-area just in case if someone come across this. – user1999453 Nov 08 '13 at 18:14