Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. 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.





  2. Enter the class name as CountryCapitalBean.





  3. Populate the bean class with the code as follows
    Code Block
    titleCountryCapitalBean.java
    borderStylesolid
    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
titleWarning

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
<openejb-jar xmlns="http://www.openejb.org/xml/ns/openejb-jar-2.2" xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.2" xmlns:pkgen="http://www.openejb.org/xml/ns/pkgen-2.0" xmlns:sec="http://geronimo.apache.org/xml/ns/security-1.2" xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2">