Rev 950 | Rev 1024 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
package ak.hostadmiral.core.taglib;
import java.io.IOException;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.TagSupport;
import ak.hostadmiral.core.model.User;
public class CountryTag
extends TagSupport
{
public int doStartTag()
throws JspException
{
User user = (User)pageContext.getSession().getAttribute("user");
if(user == null)
throw new JspException("no user found");
try {
pageContext.getOut().print(user.getLocale().getDisplayCountry(user.getLocale()));
}
catch(IOException ex) {
throw new JspException("Cannot write out: " + ex.getMessage());
}
return SKIP_BODY;
}
}