Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Java IF Condition, Incorrect use of braces ?

Status
Not open for further replies.

MrPhreaker

Programmer
Jun 20, 2003
19
GB
Hi all

I have a post already open but that one kinda solved a different problem so here goes :

This is a snippet of a servlet that is passed the paramValue parameter. However, the only one that works is "Roe". All the others return people.xls.

Please advise.




if (paramValue.equals("people")){
xslFile = "file:///C:/temp/JDeveloper9032/jdev/mywork/Workspace2/Project2/src/people.xsl";
}
if (paramValue.equals("Bacon")){
xslFile = "file:///C:/temp/JDeveloper9032/jdev/mywork/Workspace2/Project2/src/Bacon.xsl";
}

if (paramValue.equals("Guin")){
xslFile = "file:///C:/temp/JDeveloper9032/jdev/mywork/Workspace2/Project2/src/Guin.xsl";
}

if (paramValue.equals("Miller")){
xslFile = "file:///C:/temp/JDeveloper9032/jdev/mywork/Workspace2/Project2/src/Miller.xsl";
}
if (paramValue.equals("Roe")){
xslFile = "file:///C:/temp/JDeveloper9032/jdev/mywork/Workspace2/Project2/src/Roe.xsl";
}

else
{
xslFile = "file:///C:/temp/JDeveloper9032/jdev/mywork/Workspace2/Project2/src/people.xsl";
}


 
if (paramValue.equals("people")){
xslFile = "file:///C:/temp/JDeveloper9032/jdev/mywork/Workspace2/Project2/src/people.xsl";
}
else if (paramValue.equals("Bacon")){
xslFile = "file:///C:/temp/JDeveloper9032/jdev/mywork/Workspace2/Project2/src/Bacon.xsl";
}

else if (paramValue.equals("Guin")){
xslFile = "file:///C:/temp/JDeveloper9032/jdev/mywork/Workspace2/Project2/src/Guin.xsl";
}

else if (paramValue.equals("Miller")){
xslFile = "file:///C:/temp/JDeveloper9032/jdev/mywork/Workspace2/Project2/src/Miller.xsl";
}
else if (paramValue.equals("Roe")){
xslFile = "file:///C:/temp/JDeveloper9032/jdev/mywork/Workspace2/Project2/src/Roe.xsl";
}

else
{
xslFile = "file:///C:/temp/JDeveloper9032/jdev/mywork/Workspace2/Project2/src/people.xsl";
}


Ion Filipski
1c.bmp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top