V
vic
Hi All,
I have a question regarding structuring my servlet. I have a couple of
if conditions like this
if((String)request.getParameter("test").equals("a")) {do something
.........}
if((String)request.getParameter("test").equals("b")) {do something
.........}
if((String)request.getParameter("test").equals("c")) {do something
.........}
if((String)request.getParameter("test").equals("d")) {do something
.........}
if((String)request.getParameter("test").equals("e")) {do something
.........}
how do i go about structuring these if conditions using a switch case
statement
i am looking for something like this, how do i pass the choice and
evaluate the case block .
switch(choice)
case 1: { }
case 2: { }
case 3: { }
..
..
..
..
..
Any help appreciated
I have a question regarding structuring my servlet. I have a couple of
if conditions like this
if((String)request.getParameter("test").equals("a")) {do something
.........}
if((String)request.getParameter("test").equals("b")) {do something
.........}
if((String)request.getParameter("test").equals("c")) {do something
.........}
if((String)request.getParameter("test").equals("d")) {do something
.........}
if((String)request.getParameter("test").equals("e")) {do something
.........}
how do i go about structuring these if conditions using a switch case
statement
i am looking for something like this, how do i pass the choice and
evaluate the case block .
switch(choice)
case 1: { }
case 2: { }
case 3: { }
..
..
..
..
..
Any help appreciated