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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T13:38:26+00:00 2026-05-24T13:38:26+00:00

I have been tasked with improving the form validation on a page. The site

  • 0

I have been tasked with improving the form validation on a page.

The site uses .jsp/bean/struts etc. Currently there is a loop at the top of the page to print errors to the screen:

<nested:iterate id="currentError" property="wizard.errors" type="java.lang.String" indexId="counter">
    <tr>
        <td valign="top" class="wizardErrorText" width="2%">
            &gt;
        </td>
        <td class="wizardErrorText">
            <span errorId="">
                <bean:write name="currentError"/>  
            </span>
        </td>
    </tr>
</nested:iterate>

Now when validation fails I have changed the existing method slightly to indicate the id of the field that has failed validation as well as the error message. I have then set up a similar loop to print the id’s of the fields that have failed validation to an area which is read by JavaScript and highlights the fields accordingly.

Rather than having another loop I would like to use the indexId to look up the value in the array and include it in the errorId.

Could anybody advise how to do this please?

I have tried jsp.getProperty and a few other methods but with no luck.

Thanks
Gary

  • 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-05-24T13:38:28+00:00Added an answer on May 24, 2026 at 1:38 pm

    You should be able to something like this:

    <bean:write name="wizard" property="erroredInputs[counter]" />
    

    Or, full example:

    <nested:iterate id="currentError" property="wizard.errors" type="java.lang.String" indexId="counter">
        <tr>
            <td valign="top" class="wizardErrorText" width="2%">
                &gt;
            </td>
            <td class="wizardErrorText">
                <span errorId="<bean:write name="wizard" property="erroredInputs[counter]" />">
                    <bean:write name="currentError"/>  
                </span>
            </td>
        </tr>
    </nested:iterate>
    

    More information can be found here: https://struts.apache.org/1.x/struts-taglib/indexedprops.html

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

Sidebar

Related Questions

I have been tasked with refactoring a project that currently uses an EAV model
I have been tasked with improving the performance of a slow running process which
I have been tasked with improving the current mess that is our JavaScript strategy;
i have been tasked with changing a bit of css for a site that
I have been tasked with updating a drupal site. I have a link like
I have been tasked with optimizing a marketing landing page for speed. It already
I have been tasked with creating pg_dump files for a db on which there
I have been tasked with cleaning up a very messy site, http://www.investravel.com/ , built
I have been tasked with implementing a PKI library in C# for a company
I have been tasked with going through a number of ColdFusion sites that have

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.