Rev 1024 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
950 | dev | 1 | package ak.hostadmiral.core.taglib; |
2 | |||
3 | import java.io.IOException; |
||
4 | import javax.servlet.jsp.JspException; |
||
1024 | dev | 5 | import javax.servlet.jsp.tagext.TagSupport; |
950 | dev | 6 | |
7 | import ak.hostadmiral.core.model.User; |
||
1057 | dev | 8 | import ak.hostadmiral.core.servlet.SessionKeys; |
950 | dev | 9 | |
10 | public class CountryTag |
||
1024 | dev | 11 | extends TagSupport |
950 | dev | 12 | { |
13 | public int doStartTag() |
||
14 | throws JspException |
||
15 | { |
||
1057 | dev | 16 | User user = (User)pageContext.getSession().getAttribute(SessionKeys.USER); |
950 | dev | 17 | |
18 | if(user == null) |
||
19 | throw new JspException("no user found"); |
||
20 | |||
21 | try { |
||
22 | pageContext.getOut().print(user.getLocale().getDisplayCountry(user.getLocale())); |
||
23 | } |
||
24 | catch(IOException ex) { |
||
25 | throw new JspException("Cannot write out: " + ex.getMessage()); |
||
26 | } |
||
27 | |||
28 | return SKIP_BODY; |
||
29 | } |
||
30 | } |