2017-01-23 20:40:49 +05:30
|
|
|
package com.baeldung.struts;
|
|
|
|
|
|
|
|
public class CarMessageService {
|
|
|
|
|
|
|
|
public String getMessage(String carName) {
|
|
|
|
System.out.println("inside getMessage()" + carName);
|
2017-02-14 00:40:28 +05:30
|
|
|
if (carName.equalsIgnoreCase("ferrari")){
|
2017-01-23 20:40:49 +05:30
|
|
|
return "Ferrari Fan!";
|
2017-02-14 00:40:28 +05:30
|
|
|
}
|
|
|
|
else if (carName.equalsIgnoreCase("bmw")){
|
2017-01-23 20:40:49 +05:30
|
|
|
return "BMW Fan!";
|
2017-02-14 00:40:28 +05:30
|
|
|
}
|
|
|
|
else{
|
2017-01-23 20:40:49 +05:30
|
|
|
return "please choose ferrari Or bmw";
|
2017-02-14 00:40:28 +05:30
|
|
|
}
|
2017-01-23 20:40:49 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
}
|