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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:55:20+00:00 2026-05-16T15:55:20+00:00

I got the checkbox working, but I can’t remember what modification I have done

  • 0

I got the checkbox working, but I can’t remember what modification I have done to my code. it’s never working again. it keeps saying:

org.springframework.web.servlet.tags.form.Checkbox Tag - 
java.lang.NullPointerException
at org.springframework.web.servlet.tags.form.Selected ValueComparator.exhaustiveCompare(SelectedValueCom parator.java:157)

the java looks like this:

public class ServiceRequest implements Serializable {
 ......
    private GenericAddress serviceAddress;
    private String problemDescription;
    private String referenceNumber;   
    private String[] optionExchangeList = new String[10];
        ......

the jsp code looks like this:

<INPUT TYPE="checkbox" NAME="addPrima" onclick="showHideDiv(this,'exchangeOfOption')">
   <spring:message code="serviceRequest.label.ExchangeOfOption"/><br />
   <div id="exchangeOfOption" style="display:none; margin-left : 15px;" >
    <spring:message code="serviceRequest.label.OnsiteExchangeOfDevice"/> <form:checkbox path="serviceRequest.optionExchangeList" value="Duplex"/><br />
                <spring:message code="serviceRequest.label.Drawer"/> <form:checkbox path="serviceRequest.optionExchangeList" value="Drawer"/><br />
                <spring:message code="serviceRequest.label.Feeder"/> <form:checkbox path="serviceRequest.optionExchangeList" value="Feeder"/><br />
                <spring:message code="serviceRequest.label.MaintenanceKit"/> <form:checkbox path="serviceRequest.optionExchangeList" value="Maintenance Kit"/><br />
                <spring:message code="serviceRequest.label.Other"/> <form:checkbox path="serviceRequest.optionExchangeList" value="Other"/>
            </div>  

it worked before. I even use optionExchangeList.toString() to look at the result. it was the names for the one I checked. (it’s impossible huh? should be something like @afaswe) .
and for now. I have to initialize the optionExchangeList as something like:

private String[] optionExchangeList = new String[]{"Duplex","Drawer"};

and for Duplex and Drawer, they stayed checked in the browser. but for the rest field. they stayed unchecked, and even if I check them, they don’t appear in the optionExchangeList if I print them out in the action method using something like:

for (String s:serviceRequest.optionExchangeList){
 System.out.println(s+"\n");
}

the list stayed the same regardless the Checkbox status.

Did I just have a dream??? or did I meet a ghost??? I am going crazy.
HELP!!!!

  • 1 1 Answer
  • 2 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-16T15:55:21+00:00Added an answer on May 16, 2026 at 3:55 pm

    when I about to use another approach, the light shed on me. to keep it short and clear.
    define your String list with something like

    private String[] optionExchangeList = new String[]{};
    

    no more Exception. it just works.

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

Sidebar

Related Questions

I've got the code below working but I can't figure out how to get
I am working on an app that have this code on a view file
I've got some strange behaviour happening I can't work out. I've written some code
I've got a table with checkbox-style cells, and I can't figure out how to
So I've got code that looks like this: <input class=messageCheckbox type=checkbox value=3 name=mailId[]> <input
I want to check if a checkbox just got unchecked, when a user clicks
I've got a php array (obtained through checkbox values in a form - as
I've got a DataGrid with 6 columns: ComboBox;ComboBox;CheckBox;CheckBox;CheckBox;TextBox I'm trying to populate this DataGrid
javascript code: function getCheckbox(name,id){ var check = 0; var deger = option-checkbox-+id; var dom
Got a seg fault from my memcpy that gdb can't give me anything else

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.