Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8612107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T04:32:44+00:00 2026-06-12T04:32:44+00:00

Here is my problem : in my database, I got a VACHAR2 of length

  • 0

Here is my problem : in my database, I got a VACHAR2 of length 2000. Let’s call it the “commentReception”.

It is mapped to a String in my Struts bean.

The jspx (that handles both consult and update, within the form) looks that way :

<s:if test="%{consultAction}">
  <s:textarea name="dto.commentReception" readonly="true" cssClass="textAreaValue readonly" />
</s:if>
<s:else>
  <s:textarea name="dto.commentReception" readonly="false" cssClass="textAreaValue" />
</s:else>

When I submit the form, the bean is filled correctly, meaning without any \r\n at the end, and I get only one line, even in the database : no newlines.

But when I switch to consultAction, or let’s say re-edit the form (not consultAction) another time, I get my string with an extra 2 newlines. That’s really annoying and I don’t know if it comes from Struts or from the tag. (with me probably missing a tag attribute?)

Of course, if I submit the form again, the comment string will be stored in the database with the newlines. So it will add two more new lines every saving of my comment…

Do you know where my problem comes from? Thanks already.

Edit : the generated form

<textarea class="textAreaValue" id="saveControleReception_dto_commentReceiption" rows="" cols="" name="dto.commentReceiption">commentaire contrôle avant reception.

</textarea>

You can see there are some newlines, but they are not taken into account in my bean. But they are somehow when I reload it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T04:32:45+00:00Added an answer on June 12, 2026 at 4:32 am

    So, it seems that the struts tag is adding by default two \r\n to the String upon loading the bean. That must be some kind of bug. So here is my solution :

    <s:if test="%{consultAction}">
      <textarea readonly="true" class="textAreaValue readonly"><s:property value="dto.commentReceiption"/></textarea>
    </s:if>
    <s:else>
      <textarea class="textAreaValue" name="dto.commentReceiption"><s:property value="dto.commentReceiption"/></textarea>
    </s:else>
    

    I used the html tag instead of Strut’s, and the property tag… If someone has a better answer (there must be), I’m still listening 😉

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

got a few problem here and hoping that you could help me out. Let
I got a bit of a problem here. My database stores unix timestamps as
enter code here My problem is this: in this database the junction table contains
I have a problem here I can't solve. I have a database of houses
Here is my problem: I export a database A_DB using export function of Phppgadmin.
Database is OracleXE and here is the problem: data gets entered in tables UPS
date here my problem: String datetime = 2012-03-24 23:20:51; I know that that string
I've got a weird problem here. I've been trying to find out whats wrong
Bit of a strange problem here... I've got an update query that isn't working,
I have problem with encoding data in Oracle database. I want to xor string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.