Rev 961 | Go to most recent revision | 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; |
||
8 | |||
9 | public class CountryTag |
||
1024 | dev | 10 | extends TagSupport |
950 | dev | 11 | { |
12 | public int doStartTag() |
||
13 | throws JspException |
||
14 | { |
||
15 | User user = (User)pageContext.getSession().getAttribute("user"); |
||
16 | |||
17 | if(user == null) |
||
18 | throw new JspException("no user found"); |
||
19 | |||
20 | try { |
||
21 | pageContext.getOut().print(user.getLocale().getDisplayCountry(user.getLocale())); |
||
22 | } |
||
23 | catch(IOException ex) { |
||
24 | throw new JspException("Cannot write out: " + ex.getMessage()); |
||
25 | } |
||
26 | |||
27 | return SKIP_BODY; |
||
28 | } |
||
29 | } |