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 7953241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T03:06:15+00:00 2026-06-04T03:06:15+00:00

I have jsp using struts bean tag library: <html> <head> <meta http-equiv=Content-Type content=text/html; charset=UTF-8>

  • 0

I have jsp using struts bean tag library:

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>JSP Page</title>

    <link rel="stylesheet" type="text/css" href="css/stylesheet.css">

</head>
<body>
<p><a class="colorGrey" href="Welcome.do">
    <bean:message key="menu.label" />
</a> &gt;&gt;<bean:message key="menu.link.addnews" /> </p>
<p><br>
</p>

<html:form action="/NewsSave">
<table width="100%" border="0">
<tr>
<td class="colorGrey" width="164" height="35">
    <bean:message key="body.news.title" />  </td>
<td width="577">
    <html:text property="newsTitle"  size="40" value=""/>    </td>

</tr>
<tr>
<td colspan="2">
    <html:errors property="newstitle" />
</td>
</tr>
<tr>
<td class="colorGrey">
    <bean:message key="body.news.date" />   </td>
<td>
    <html:text property="newsDate" size="10" value=""/>    </td>
</tr>


<tr>
<td height="21" colspan="2" valign="top">
    <html:errors property="newsdate" />
</td>
</tr>
<tr>
<td class="colorGrey" height="61" valign="top">
    <bean:message key="body.news.brief" />  </td>
<td valign="top">
    <html:textarea property="brief" cols="40" rows="6" value=""/>
</td>
</tr>

<tr>
<td height="23" colspan="2" valign="top"><html:errors property="brief" /></td>
</tr>
<tr>
<td class="colorGrey" height="100" valign="top">
    <bean:message key="body.news.content" />
</td>
<td valign="top">
    <html:textarea property="content" cols="40" rows="12" value=""/>
</td>
</tr>
<tr>
<td height="23" colspan="2" valign="top">
    <html:errors property="content" />
</td>
</tr>
</table>

<html:submit value="SAVE"/>
</html:form>
<form method="POST" 
action="Link.do?method=newsList"
onsubmit="return confirm('<bean:message key="body.onsubmit.cancel" />')">
<input type="submit" value="CANCEL">
</form>

And I use validator plugin, which means that after receiving incorrect info it gives message bellow text field telling what’s wrong. But problem is that everything disappear after submiting. So it no info in text or text-areatags. I know that it happens because of value="". But I have another page with the same fields for adding info, which should be clear from the beginning. And if I remove value="", the info from this fields will be displayed on that page after forwarding. So

  1. What should I do to clear info from forms after forwarding to
    another page?
  2. How to make info remain after success validation?
  • 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-04T03:06:17+00:00Added an answer on June 4, 2026 at 3:06 am

    As you mentioned, you should remove value=”” as this is setting the fields to empty. If you want to clear the values then you should do this in the Action class in which your Form bean is populated.
    If you are finding that your Form beans are retaining their values between requests then check that they are request scope: the scope attribute of the action element should be “request” in struts.config

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

Sidebar

Related Questions

I have Map type. I want to iterate over it using struts tag library.
I have this line of code in my JSP. (I'm using struts 1.3) <html:form
I am using Struts/JSP for a webapp. I have a page A where I
How can I expose a Java bean to a JSP page by using struts?
I am using Struts 2, JSP and JPA in my project. I have nearly
i want to do arithmetic operation on jsp . I am using struts tag
I have web application developed using JSP and struts. I am just looking out
I am using Struts 2. I have a JSP. It has this code: <span
I am using Struts 2-Spring framework in my assignment. I have defined a bean
I have been trying to display json data in my jsp using struts and

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.