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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T17:41:44+00:00 2026-06-01T17:41:44+00:00

I keep getting this error here: SEVERE: java.lang.NumberFormatException: For input string: at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) at

  • 0

I keep getting this error here:

SEVERE: java.lang.NumberFormatException: For input string: ""
    at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:504)
at java.lang.Integer.parseInt(Integer.java:527)
at com.myapp.cmt.web.ContentController.saveContent(ContentController.java:129)

It happens when no options are selected on the dropdown menu for categories on my page. I’m checking the length, so how come it’s still trying to process the parseInt()?

        String[] category = request.getParameterValues("categories");
        if (category.length > 0) {
            content.addCategory(contentDao.findCategory(Integer.parseInt(category[0])));
        }

My HTML

    <strong>Category</strong><br/>
    <select name="categories">
        <option></option>
    <c:forEach items="${categories}" var="category">
        <option value="${category.id}" <c:if test="${content.hasCategory(category)}"> CHECKED</c:if>>${category.name}</option>
    </c:forEach>
    </select>
  • 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-01T17:41:45+00:00Added an answer on June 1, 2026 at 5:41 pm

    The length of your array is only half the story… you have to also check what’s in the array. Try some code like this:

    if (category.length > 0 &&
      category[0] != null &&
      category[0].trim().length() > 0)
        content.addCategory(contentDao.findCategory(Integer.parseInt(category[0])));
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I keep getting this error 07-14 23:53:03.653: ERROR/AndroidRuntime(14995): java.lang.NullPointerException 07-14 23:53:03.653: ERROR/AndroidRuntime(14995): at com.fttech.organizeit.meeting_list$meetingHolder.populateFrom(meeting_list.java:110)
I keep getting this error? 07-25 17:04:00.796: ERROR/AndroidRuntime(420): Caused by: java.lang.OutOfMemoryError 07-25 17:04:00.796: ERROR/AndroidRuntime(420):
I keep getting this error while trying to modify some tables. Here's my code:
I keep getting this error when I try to call Find() public void findTxt(string
I am going a tad crazy here. I keep getting this error: ImportError: No
I keep getting this error: expected specifier-qualifier-list before ‘tcp_seq’ in my header file. Here
I keep getting this error 07-28 19:32:40.536: ERROR/error(534): java.io.IOException: No such file or directory
So I don't know why I keep getting this error. Here's the relevant code:
I keep getting this error on heroku....here is my gemfile...what do i do source
Keep getting this error after inserting a subdatasheet into a query and trying to

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.