AddCountryBean.java 674 Bytes
package org.legrog.web.xyz;

import org.legrog.entities.Country;

import javax.enterprise.context.RequestScoped;
import javax.inject.Inject;
import javax.inject.Named;

@Named
@RequestScoped
public class AddCountryBean {
    @Inject
    private SharedService sharedService;

    private String countryName;

    public String getCountryName() {
        return countryName;
    }

    public void setCountryName(String countryName) {
        this.countryName = countryName;
    }

    public String add()
    {
        Country country = new Country();
        country.setCountryName(countryName);
        sharedService.addCountry(country);
        return "success";
    }

}