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

  • Home
  • SEARCH
  • 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 8419115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T02:31:20+00:00 2026-06-10T02:31:20+00:00

I recieved Data from a form via POST/GET method in a page. Now, by

  • 0

I recieved Data from a form via POST/GET method in a page. Now, by default, JSP takes that as string. I wanted to convert it to int and tried but it not worked.

My JSP Code for this is:

String editstr=request.getParameter("some_thing");
int edit;
edit=Integer.parseInt(editstr)

I also tried something like

int edit=Integer.parseInt(editstr)

Neither Works

  • 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-10T02:31:22+00:00Added an answer on June 10, 2026 at 2:31 am

    You must have to test the parameter whether it is null or not.

    String editstr=request.getParameter("some_thing");
    int edit=0;
    if(editstr!=null){
       try{
         edit=Integer.parseInt(editstr);
       }catch(Exception ex) { 
         out.println(ex);
       }
    }
    

    PS: You should have to learn/use JSTL to avoid Java code in JSPs.

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

Sidebar

Related Questions

So I have a form that can get data from a database by its
I have some data recieved from a simple HTML form like this: $newdata =
I have some code that I'm using to get data from a network socket.
i use mysql_real_escape_string php function for escape data recieved from a form. my code
I have an app that received JSON data from the server. Currently when I
I'm developing an application that works with 8 COM-ports, when data is received from
I'm trying to create an image by using binary data that I received from
I am doing a system that imports live data from Fusion tables. I am
Is there a method to prepopulate a certain field in a form using data
I am trying to start a PHP session to store data from a form

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.