Else If Statement - with one or another variable

Posted on 2004-08-26
Medium Priority
Last Modified: 2010-04-01
Hi, How do I create an if/else statement in which I want it to do the same thing if either of 2 variables are entered? Here is my code:

String mode = request.getParameter("mode");

      if (mode.equals("largeimages"))
            String imagenumber = request.getParameter("imagenumber");
            out.print("<a href=\"deleteimages.jsp?mode=" + mode + "&imagenumber=" + imagenumber + "\">");
      } else if (mode.equals("listaccession") OR mode.equals("listaccessionall"))
            String last2 = request.getParameter("last2");
            out.print("<a href=\"deleteimages.jsp?mode=" + mode + "&last2=" + last2 + "\">");
      } else
            out.print("<a href=\"deleteimages.jsp?mode=" + mode + "&series=" + series + "\">");
out.print("<font size=2>Unselect Image</font>");

Thank you for your help in advance.
Question by:akamauu
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Accepted Solution

pat5star earned 500 total points
ID: 11908739
    } else if (mode.equals("listaccession") || mode.equals("listaccessionall"))

|| is how you say OR


Author Comment

ID: 11908872
Thank you ... that worked great.


Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this blog post, we’ll look at how using thread_statistics can cause high memory usage.
Check out the latest tech news, community articles, and expert highlights in August's newsletter.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question