If you load it from the DB and show the text, there's a space

Asked 2 years ago, Updated 2 years ago, 77 views

getBoard.jsp
<form action="updateBoard_proc.jsp" method="post">
            <%-- Search Function --%>
            <table class="tbSign">
                <tr>
                    <td>Title</td>
                    <td><input name="title" type="text" value="<%= board.getTitle()%>" /></td>
                </tr>
                <tr>
                    <td>Content</td>
                    <td><textarea name="content" cols="20" rows="10">
                        <%= board.getContent().trim() %>
                    </textarea></td>
                </tr>
                <tr>
                    <td>Registration Date</td>
                    <td><%= board.getRegDate() %></td>
                </tr>
                <tr>
                    <td>Views</td>
                    <td><%= board.getCnt() %></td>
                </tr>
                <tr>
                    <td><input type="submit" value="correcting the text"></td>
                </tr>
            </table>
            </form>
        <hr>

Can you tell me why? Even with trim(), it's sprayed as it is

spring

2022-09-22 20:31

1 Answers

Looking closely, I used text area...

<textarea name="content" cols="20" rows="10">
<%= board.getContent().trim() %>
 </textarea>

Parts

<textarea name="content" cols="20" rows="10"><%= board.getContent().trim() %></textarea>

Remove any gaps in the text area as shown in .


2022-09-22 20:31

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.