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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T17:25:51+00:00 2026-05-30T17:25:51+00:00

so my aim is to make a IF statement determine what the value of

  • 0

so my aim is to make a IF statement determine what the value of ‘pbutton’ and ‘value is.

I have a html page that has two lists boxes, one for PropertyID and another for Location which will look in a database for that value.

ccode and ccode1 are the list boxes from html page.

This is my code for .jsp page

    String pbutton=request.getParameter("ccode");

if (pbutton = 0); {
pbutton=request.getParameter("ccode1");
value = Property;
else {
pbutton=request.getParameter("ccode");
value = ID;
}
}

However, it doesnt like it, giving me this error….

    An error occurred at line: 75 in the jsp file: /Assignment/find.jsp
Type mismatch: cannot convert from String to boolean
72: 
73: String pbutton=request.getParameter("ccode");
74: 
75: if (pbutton = 0); {
76: pbutton=request.getParameter("ccode1");
77: value = Property;
78: else {

Help appreciated, thanks.

  • 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-05-30T17:25:52+00:00Added an answer on May 30, 2026 at 5:25 pm
    if (pbutton = 0); {
    

    Here are three major mistakes. You’re assigning an int value of 0 to a String variable and then checking if it is true or false. The = is an assignment operator, while you actually wanted to use == which is the equality operator which returns true or false. But this is not going to work as well because you’re basically comparing a String with an int. Also, that semicolon doesn’t belong there, it won’t enter the statement block.

    To check whether the String value equals to "0", you need this instead:

    if ("0".equals(pbutton)) {
    

    This is rather trivial and basic Java and has got nothing to do with JSP. Writing Java code in JSP files instead of normal Java classes doesn’t make it a JSP problem. I’d suggest to stop with whatever you’re doing now and invest some time in learning Java properly. Start with Oracle’s own basic Java tutorial. Once having a proper grasp on Java basics, you can continue your work.

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

Sidebar

Related Questions

I have followed this tutorial: http://www.phpjabbers.com/how-to-make-a-php-calendar-php26-6.html#comments to make a very basic calendar. My aim
My aim is to determine the color of object. And make a classification, for
I have following script which is aim to make a war file. def ant
We have developed an application in c# .net and aim to make it deployable
Aim The aim is to a have a container DIV with a fixed height
I aim to filter my Google results right at terminal such that I get
Should we aim for DRY, in the sense that changes to the functionality affect
Im trying to make some text non-copyable, my aim isn't to stop people from
In my situation, there is one case in which I need to make sure
My aim is to make a paint type application. Thank you for your suggestions..

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.