I am trying to build a basic webpage with Spring
+ JSF
.
Basically, I have one HelloController
and HelloSpringService
.
It gives error on the return helloSpringService.sayHello();
line in HelloController
class.
public class HelloController {
@ManagedProperty("#{helloSpringService)")
private HelloSpringService helloSpringService;
public String showHello() {
return helloSpringService.sayHello();
}
public void setHelloSpringService(HelloSpringService helloSpringService) {
this.helloSpringService = helloSpringService;
}
public HelloSpringService getHelloSpringService() {
return helloSpringService;
}
}
import org.springframework.stereotype.Service;
@Service
public class HelloSpringService {
public String sayHello() {
return "hellofromspringservice";
}
}