Solved

Else If Statement - with one or another variable

Posted on 2004-08-26
2
257 Views
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");

out.print("<td><center>");
      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>");
out.print("</a></center></td>");


Thank you for your help in advance.
AKamauu
0
Comment
Question by:akamauu
[X]
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
2 Comments
 
LVL 3

Accepted Solution

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

|| is how you say OR

-Pat
0
 

Author Comment

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

AKamauu
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

Suggested Solutions

Title # Comments Views Activity
java.util.concurrent.locks in java 3 208
AlarmClock Challenge 35 157
JSONSerializer.toJSON in JSP generating error 8 100
JavaScript parse form with colon separated values 2 79
Unified and professional email signatures help maintain a consistent company brand image to the outside world. This article shows how to create an email signature in Exchange Server 2010 using a transport rule and how to overcome native limitations …
When the s#!t hits the fan, you don’t have time to look up who’s on call, draft emails, call collaborators, or send text messages. An instant chat window is definitely the way to go, especially one like HipChat. HipChat is a true business app. An…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

734 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