This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Same name on different CheckBox is not working?  RSS feed

 
Kishor Joshi
Ranch Hand
Posts: 674
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there

I am trying to send more than one checkbox values as array or in form of group from JSP page to y servlet.But I am getting null pointer exception in servlet Whethar I have checked any item or not

This is my jsp page


this is my servlet code


ant I am getting null pointer exception in my servlet

Where is error?

Thanks
 
Srikkanth Mohanasundaram
Ranch Hand
Posts: 243
1
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kishore,

You're looking for a parameter called userCourses on the servlet , but what you're passing is 'userCourses[]'. Rename the name attribute in the HTML/JSP

.

You'll have to change for all the checkboxes. Start using the network tab on chrome developer tools / firebug to inspect the data being sent back and forth , make it your friend.

Thanks
Srikkanth
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65828
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Srikkanth Mohanasundaram wrote:Start using the network tab on chrome developer tools / firebug to inspect the data being sent back and forth , make it your friend.

Quoted for truth.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!