0,0 → 1,30 |
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; |
import ak.hostadmiral.core.servlet.SessionKeys; |
|
public class LanguageTag |
extends TagSupport |
{ |
public int doStartTag() |
throws JspException |
{ |
User user = (User)pageContext.getSession().getAttribute(SessionKeys.USER); |
|
if(user == null) |
throw new JspException("no user found"); |
|
try { |
pageContext.getOut().print(user.getLocale().getDisplayLanguage(user.getLocale())); |
} |
catch(IOException ex) { |
throw new JspException("Cannot write out: " + ex.getMessage()); |
} |
|
return SKIP_BODY; |
} |
} |