...
- Next step is to create a Bean Class which will implement the Business method to be executed. Right Click on the jsf package and create a new class.
- Enter the class name as CountryCapitalBean.
- Populate the bean class with the code as follows
Code Block title CountryCapitalBean.java borderStyle solid package ejb; import javax.ejb.Stateless; @Stateless public class CountryCapitalBean implements CountryCapital,CountryCapitalLocal{ public String capitalName(String countryName) { String capital=new String("No such country"); if (countryName.equalsIgnoreCase("India")) { capital="New Delhi"; } if (countryName.equalsIgnoreCase("United States Of America")) { capital="Washington DC"; } if (countryName.equalsIgnoreCase("China")) { capital="Bejing"; } return capital; } }
This completes the development of EJB application.
Warning | ||
---|---|---|
| ||
Due to some limitations in Geronimo Eclipse Plugin the deployment plan(openejb-jar.xml) does not have the correct namespace. Replace the existing namespace as shown in the figure with the following |