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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T13:43:24+00:00 2026-06-10T13:43:24+00:00

I ‘m dynamically loading spring checkbox tags according to changes in select tag. But

  • 0

I ‘m dynamically loading spring checkbox tags according to changes in select tag. But it generates error like :

2012-08-31 09:27:14.829 org.springframework.web.servlet.tags.RequestContextAwareTag doStartTag: Neither BindingResult nor plain target object for bean name 'stockList' available as request attribute
W 2012-08-31 09:27:14.831 /stocks
java.lang.IllegalStateException: Neither BindingResult nor plain target object for bean name 'stockList' available as request attribute
C 2012-08-31 09:27:14.832 Uncaught exception from servlet
java.lang.IllegalStateException: Neither BindingResult nor plain target object for bean name 'stockList' available as request attribute

in my app engine server log.

My code is given below

<link rel="stylesheet"
    href="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.css" />
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script
    src="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.js"></script>
<script type="text/javascript">
    function loadStocks() {
        var exchange = $("#stockExchange").val();
        var a;
        if (exchange = "BO") {
            a = "<form:checkbox path='stockList' value='INFY' label='Infosys' />"
                    + "<form:checkbox path='stockList' value='HINDALCO' label='HINDALCO' />"
                    + "<form:checkbox path='stockList' value='TTM' label='Tata Motors' />";
        } else if (exchange == "NS") {
            a = "<form:checkbox path='stockList' value='INFY' label='Infosys' />";
        }
        $("#kit").html(a);
    }
</script>
</head>
<body>
    <div data-role="page">
        <div data-role="content">
            <form:form method="POST" commandName="search">
                <ul data-role="listview">
                    <li data-role="fieldcontain">
                        <div id="kit">
                            <form:select path="stockExchange" onchange="loadStocks()"
                                id="stockExchange">
                                <form:option value="">Select Stock Exchange</form:option>
                                <form:option value="BO">BSE</form:option>
                                <form:option value="NS">NSE</form:option>
                            </form:select>
                        </div>
                    </li>

                    <li data-role="fieldcontain"><label>Select Stocks</label>
                        <div id="kit">
                            <form:checkbox path="stockList" value="INFY" label="Infosys" />
                            <form:checkbox path="stockList" value="HINDALCO" label="HINDALCO" />
                            <form:checkbox path="stockList" value="TTM" label="Tata Motors" />
                            <form:checkbox path="stockList" label="RELIANCE IND."
                                value="RELIANCE" />
                        </div></li>

                    <li data-role="fieldcontain"><input type="submit"
                        value="Submit" /></li>
                </ul>
            </form:form>
        </div>
        <!-- /content -->

    </div>
    <!-- /page -->

</body>
  • 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-10T13:43:25+00:00Added an answer on June 10, 2026 at 1:43 pm

    This javascript function won’t work this way. Look to HTML source code in your browser and you will notice that is different than JSP’s. The <form:xxxx/> tags are spring tags to generate HTML quickly and make property binding easier. So, for example:

    <form:checkbox path="stockList" value="INFY" label="Infosys" />
    

    will be transformed aproximately to this plain HTML:

    <input type="checkbox" id="stockList" name="stockList" value="INFY" label="Infosys" />
    

    As your javascript function is in client-side, spring tags won’t be transformed, so you will have to use plain html in your Javascript function. Something like that:

    function loadStocks() {
        var exchange = $("#stockExchange").val();
        var a;
        if (exchange = "BO") {
            a = "<input type='checkbox' id='stockList1' name='stockList' value='INFY' label='Infosys' />"
                    + "<input type='checkbox' id='stockList2' name='stockList' value='HINDALCO' label='HINDALCO' />"
                    + "<input type='checkbox' id='stockList3' name='stockList' value='TTM' label='Tata Motors' />";
        } else if (exchange == "NS") {
            a = "<input type='checkbox' id='stockList' name='stockList' value='INFY' label='Infosys' />";
        }
        $("#kit").html(a);
    }
    

    Hope I’ve explained myself well.

    P.S.: Why id of inputs are stockList1, stockList2 and stockList3? Answer and related info here, check it out, will help you.

    EDIT:

    Another solution, maybe easier, is to create a hidden div in your JSP with the inputs needed in JS function and let spring to transform it. Later, in your JS function you can clone these inputs generated by Spring with JQuery. This way avoids you to create plain HTML understandable by Spring.

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

Sidebar

Related Questions

I would like to count the length of a string with PHP. The string
I've got a string that has curly quotes in it. I'd like to replace
This is how I get the tags of a body of text. var tags
I would like to run a str_replace or preg_replace which looks for certain words
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
Hi if i run my project its indicate this logcat error...how to solve this
I need to clean up various Word 'smart' characters in user input, including but
I have just tried to save a simple *.rtf file with some websites and
I was writing code for dragging mechanism which invokes to wait for small period
I downloaded PostgreSQL from the official website and ran the .dmg installer. After that

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.