start.jsp
001 <%page contentType="text/html;charset=UTF-8" language="java" %>
002 <%taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
003 <%taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
004 <%taglib uri="/WEB-INF/sslext.tld" prefix="sslext"%>
005 <%page import="java.util.Locale,
006                  org.apache.struts.Globals,
007                  com.bea.medrec.utils.MedRecWebAppUtils" %>
008 
009 <%
010   Locale locale = null;
011   Cookie cookie = null;
012   String country = null;
013   String language = null;
014 
015   Cookie[] cookies = request.getCookies();
016   Cookie languageCookie = null;
017   Cookie countryCookie = null;
018 
019   if (cookies != null) {
020     for (int i=0; i < cookies.length; i++) {
021       cookie = cookies[i];
022       if (cookie.getName().equals("Language")) language = cookie.getValue();
023       else if (cookie.getName().equals("Country")) country = cookie.getValue();
024     }
025   }
026 
027   if (country != null && language != null) {
028     locale = new Locale(language, country);
029   else {
030     locale = request.getLocale();
031     languageCookie = new Cookie("Language", locale.getLanguage());
032     countryCookie = new Cookie("Country", locale.getCountry());
033     languageCookie.setMaxAge(Integer.MAX_VALUE);
034     countryCookie.setMaxAge(Integer.MAX_VALUE);
035     response.addCookie(languageCookie);
036     response.addCookie(countryCookie);
037   }
038 
039   if (!(locale.getLanguage().equals("ja"||
040         locale.getLanguage().equals("ko"||
041         locale.getLanguage().equals("zh"||  
042         locale.getLanguage().equals("en"||
043         locale.getLanguage().equals("es"))) {
044     locale = new Locale("en""US");
045     languageCookie = new Cookie("Language""en");
046     countryCookie = new Cookie("Country""US");
047     languageCookie.setMaxAge(Integer.MAX_VALUE);
048     countryCookie.setMaxAge(Integer.MAX_VALUE);
049     response.addCookie(languageCookie);
050     response.addCookie(countryCookie);
051   }
052 
053   Locale secondLocale = request.getLocale();
054   String secondLocaleLabel = null;
055   if(secondLocale.getLanguage().equals("ja")){
056     secondLocaleLabel = "Japanese";
057   }else if(secondLocale.getLanguage().equals("ko")){
058     secondLocaleLabel = "Korean";
059   }else if(secondLocale.getLanguage().equals("zh")){
060     if(secondLocale.getCountry().equals("CN")){
061       secondLocaleLabel = "SimplifiedChinese";
062     }else if(secondLocale.getCountry().equals("TW"||
063             secondLocale.getCountry().equals("HK")){
064       secondLocaleLabel = "TraditionalChinese";
065     }else{
066       secondLocaleLabel = "Japanese";
067       secondLocale = new Locale("ja""JA");
068     }
069   }else{
070     secondLocaleLabel = "Japanese";
071     secondLocale = new Locale("ja""JA");
072   }
073   String secondLanguage = secondLocale.getLanguage();
074   String secondCountry = secondLocale.getCountry();
075   
076   String localelink = "/changelocale.do?Language=" + secondLanguage + "&Country=" + secondCountry;
077   request.getSession().setAttribute(Globals.LOCALE_KEY, locale);
078 %>
079 
080 <html:html>
081 <head>
082   <html:base/>
083   <title><bean:message key="title.MedRec"/>:  <bean:message key="subtitle.MedRec"/></title>
084   <link rel="stylesheet" type="text/css" href="stylesheet.css">
085 </head>
086 <body bgcolor="white" topmargin="0" leftmargin="0">
087 
088 
089 <!-- Title Bar Start -->
090 <table class="pagetop" width="100%" border="0" cellspacing="0" cellpadding="0">
091   <tr><td colspan="2"bgcolor="#02669A"><img src="images/banner_login.gif"></td></tr>
092   <tr><td colspan="2"bgcolor="#FFFFFF"><img src="images/clear.gif" width="1" height="1"></td></tr>
093   <tr><td class="pagetop" valign="middle">&nbsp;&nbsp;<bean:message key="subtitle.MedRec"/></td>
094   <td valign="middle" align=left bgcolor="#C8C8C8">
095     <table width="100%" cellpadding="0" cellspacing=border="0" align="center">
096       <tr><td><sslext:link page="/changelocale.do?Language=en&Country=US" styleClass="languagebutton"><bean:message key="English"/></sslext:link></td>
097         <td><img src="images/clear.gif" width="10"></td>
098         <td><sslext:link page="<%=localelink%>" styleClass="languagebutton"><bean:message key="<%=secondLocaleLabel%>"/></sslext:link></td>
099       </tr>
100     </table>
101   </td>
102 </tr>
103 <tr><td colspan="2"bgcolor="#8B8B8B"><img src="images/clear.gif" width="1" height="2"></td></tr>
104 <tr><td colspan="2"bgcolor="#FFFFFF"><img src="images/clear.gif" width="1" height="2"></td></tr>
105 </table>
106 <!-- Title Bar End -->
107 
108 
109 <br/>
110 <table width="90%" border="0" cellspacing="0" cellpadding="0" align="center" class="loginborder">
111   <tr><td bgcolor="#E9F4F0" align=left><img src="images/login_patient.gif"></td>
112   <td align=left class="pagetitlePatient"><bean:message key="Patients"/><img src="images/clear.gif" height="1" width="400"></td></tr>
113   <tr><td colspan="2"bgcolor="#C8C8C8"><img src="images/clear.gif" width="1" height="2"></td></tr>
114   <tr><td colspan="2"class="logincontent">
115   <br/>
116   <sslext:link page="/patient/register.do"><b><bean:message key="Register"/></b></sslext:link> - <bean:message key="descr.patient.register"/>
117   <br/>
118   <sslext:link page="/patient/login.do"><b><bean:message key="Login"/></b></sslext:link> <bean:message key="descr.patient.login"/>
119   <br/><br/>
120   </td></tr>
121 </table>
122 
123 <br/>
124 
125 <table width="90%" border="0" cellspacing="0" cellpadding="0" align="center" class="loginborder">
126   <tr><td bgcolor="#D1FFFE" align=left><img src="images/login_admin.gif"></td>
127   <td align=left valign="middle" class="pagetitleAdmin">
128    <bean:message key="Administrators"/><img src="images/clear.gif" height="1" width="400"></td>
129   </tr>
130   <tr><td colspan="2"bgcolor="#C8C8C8"><img src="images/clear.gif" width="1" height="2"></td></tr>
131   <tr><td colspan="2"class="logincontent">
132   <br/>
133   <sslext:link page="/admin/login.do"><b><bean:message key="Login"/></b></sslext:link>
134   <bean:message key="descr.admin.login"/>
135   <br/><br/><br/>
136   </td></tr>
137 </table>
138 
139 <br/>
140 <table width="90%" border="0" cellspacing="0" cellpadding="0" align="center" class="loginborder">
141   <tr><td bgcolor="#FFFFCF" align=left><img src="images/login_physician.gif"></td>
142   <td align=left valign="middle" class="pagetitleMd">
143    <bean:message key="Physicians"/><img src="images/clear.gif" height="1" width="400"></td></tr>
144   <tr><td colspan="2"bgcolor="#C8C8C8"><img src="images/clear.gif" width="1" height="2"></td></tr>
145   <tr><td colspan="2"class="logincontent">
146   <br/>
147   <sslext:link page="/physician/login.do"><b> <bean:message key="Login"/></b></sslext:link> <bean:message key="descr.physician.login"/>
148   <br/><br/><br/>
149   </td></tr>
150 </table>
151 
152 </body>
153 </html:html>