Răsfoiți Sursa

增加spring-mvc多语言支持

luoshi 5 ani în urmă
părinte
comite
341ca1912b

+ 5 - 17
stmms-web/src/main/java/cn/com/qmth/stmms/common/controller/LoginController.java

@@ -7,6 +7,7 @@ import java.util.UUID;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import org.apache.commons.lang.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.context.i18n.LocaleContextHolder;
@@ -80,8 +81,8 @@ public class LoginController {
 
                     new WebUser(u.getId(), u.getRole(), webToken).writeToSession(session);
 
-                    if (u.getRole() == Role.SYS_ADMIN || u.getRole() == Role.SCHOOL_ADMIN
-                            || u.getRole() == Role.SUBJECT_HEADER || u.getRole() == Role.SCHOOL_VIEWER) {
+                    if (u.getRole() == Role.SYS_ADMIN || u.getRole() == Role.SCHOOL_ADMIN || u.getRole() == Role.SUBJECT_HEADER
+                            || u.getRole() == Role.SCHOOL_VIEWER) {
                         ModelAndView modelAndView = new ModelAndView("redirect:admin/home");
                         return modelAndView;
                     } else {
@@ -121,8 +122,7 @@ public class LoginController {
                     modelAndView.addObject("indexLogo", indexLogo);
                     return modelAndView;
                 }
-                MarkGroup group = groupService.findOne(marker.getExamId(), marker.getSubjectCode(),
-                        marker.getGroupNumber());
+                MarkGroup group = groupService.findOne(marker.getExamId(), marker.getSubjectCode(), marker.getGroupNumber());
                 if (group == null) {
                     modelAndView.addObject("message", "大题不存在");
                     modelAndView.addObject("showType", showType);
@@ -171,7 +171,7 @@ public class LoginController {
 
     /**
      * 登出
-     * 
+     *
      * @param user
      * @param request
      * @param response
@@ -189,16 +189,4 @@ public class LoginController {
         }
     }
 
-    @RequestMapping(value = "/language/{language}")
-    public String getLanguageInCookie(@PathVariable String language, HttpServletRequest request,
-            HttpServletResponse response) {
-        Locale locale = LocaleContextHolder.getLocale();
-        if ("zh".equals(language)) {
-            locale = new Locale("zh", "CN");
-        } else if ("en".equals(language)) {
-            locale = new Locale("en", "US");
-        }
-        request.getSession().setAttribute(SessionLocaleResolver.LOCALE_SESSION_ATTRIBUTE_NAME, locale);
-        return "redirect:" + request.getParameter("url");
-    }
 }

+ 1 - 1
stmms-web/src/main/webapp/WEB-INF/language/messages.properties

@@ -1 +1 @@
-user.login=\u767b\u5f55111
+user.login=\u767B\u5F55

+ 1 - 1
stmms-web/src/main/webapp/WEB-INF/language/messages_en_US.properties

@@ -1 +1 @@
-user.login=login111
+user.login=login

+ 1 - 0
stmms-web/src/main/webapp/WEB-INF/language/messages_ja_JP.properties

@@ -0,0 +1 @@
+user.login=login_JP

+ 0 - 1
stmms-web/src/main/webapp/WEB-INF/language/messages_zh_CN.properties

@@ -1 +0,0 @@
-user.login=\u767b\u5f55222

+ 150 - 154
stmms-web/src/main/webapp/WEB-INF/spring-mvc.xml

@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <beans xmlns="http://www.springframework.org/schema/beans"
-	   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
-	   xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:context="http://www.springframework.org/schema/context"
-	   xmlns:task="http://www.springframework.org/schema/task"
-	   xsi:schemaLocation="
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
+       xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:task="http://www.springframework.org/schema/task"
+       xsi:schemaLocation="
         http://www.springframework.org/schema/beans
         http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
         http://www.springframework.org/schema/context
@@ -12,165 +12,161 @@
         http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
         http://www.springframework.org/schema/task
 		 http://www.springframework.org/schema/task/spring-task-3.2.xsd">
-        
-	<!--  <import resource="applicationContext.xml"/>-->
-	
-	<!-- Handles HTTP GET requests for /static/** by efficiently serving 
-		up static resources in the ${webappRoot}/static/ directory -->
-	<mvc:resources mapping="/resources/**" location="/static/" order="0"/>
-	<mvc:resources mapping="/static/**" location="file:${app.home}/static/" order="0"/>
-	
-	<!-- 自动扫描包下的所有类,使其认为spring mvc的控制器 -->
-	<context:component-scan base-package="cn.com.qmth.stmms.common.controller,
+
+    <!--  <import resource="applicationContext.xml"/>-->
+
+    <!-- Handles HTTP GET requests for /static/** by efficiently serving
+        up static resources in the ${webappRoot}/static/ directory -->
+    <mvc:resources mapping="/resources/**" location="/static/" order="0"/>
+    <mvc:resources mapping="/static/**" location="file:${app.home}/static/" order="0"/>
+
+    <!-- 自动扫描包下的所有类,使其认为spring mvc的控制器 -->
+    <context:component-scan base-package="cn.com.qmth.stmms.common.controller,
 					  cn.com.qmth.stmms.admin,
 					  cn.com.qmth.stmms.api,
 					  cn.com.qmth.stmms.file,
 					  cn.com.qmth.stmms.mark,
 					  cn.com.qmth.stmms.monitor,
 					  cn.com.qmth.stmms.report">
-		<context:include-filter type="annotation" expression="org.springframework.stereotype.Controller" />
-		<context:include-filter type="annotation" expression="org.springframework.stereotype.Component" />
-	</context:component-scan>
+        <context:include-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
+        <context:include-filter type="annotation" expression="org.springframework.stereotype.Component"/>
+    </context:component-scan>
+
+    <mvc:annotation-driven/>
+
+    <mvc:interceptors>
+        <mvc:interceptor>
+            <mvc:mapping path="/**"/>
+            <mvc:exclude-mapping path="/resources/**"/>
+            <mvc:exclude-mapping path="/static/**"/>
+            <mvc:exclude-mapping path="/file/**"/>
+            <mvc:exclude-mapping path="/api/**"/>
+            <bean id="commonInterceptor" class="cn.com.qmth.stmms.common.interceptor.CommonInterceptor"/>
+        </mvc:interceptor>
+        <mvc:interceptor>
+            <mvc:mapping path="/admin/**"/>
+            <bean id="adminInterceptor" class="cn.com.qmth.stmms.admin.interceptor.AdminInterceptor"/>
+        </mvc:interceptor>
+        <mvc:interceptor>
+            <mvc:mapping path="/admin/sys/**"/>
+            <bean id="sysAdminInterceptor" class="cn.com.qmth.stmms.admin.interceptor.SysAdminInterceptor"/>
+        </mvc:interceptor>
+        <mvc:interceptor>
+            <mvc:mapping path="/admin/exam/**"/>
+            <bean id="adminExamInterceptor" class="cn.com.qmth.stmms.admin.interceptor.AdminExamInterceptor"/>
+        </mvc:interceptor>
+        <mvc:interceptor>
+            <mvc:mapping path="/api/**"/>
+            <bean id="apiInterceptor" class="cn.com.qmth.stmms.api.interceptor.ApiInterceptor"/>
+        </mvc:interceptor>
+        <mvc:interceptor>
+            <mvc:mapping path="/mark/**"/>
+            <bean id="markInterceptor" class="cn.com.qmth.stmms.mark.interceptor.MarkInterceptor"/>
+        </mvc:interceptor>
+        <mvc:interceptor>
+            <mvc:mapping path="/**"/>
+            <mvc:exclude-mapping path="/resources/**"/>
+            <mvc:exclude-mapping path="/static/**"/>
+            <mvc:exclude-mapping path="/file/**"/>
+            <mvc:exclude-mapping path="/api/**"/>
+            <bean id="methodInterceptor" class="cn.com.qmth.stmms.common.interceptor.MethodInterceptor"/>
+        </mvc:interceptor>
+        <bean id="localeInterceptor" class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor">
+            <property name="paramName" value="lang"/>
+        </bean>
+    </mvc:interceptors>
+
+    <!-- <bean
+        class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver">
+        <property name="mediaTypes">
+            <map>
+                <entry key="atom" value="application/atom+xml" />
+                <entry key="html" value="text/html" />
+                <entry key="json" value="application/json" />
+            </map>
+        </property>
+        <property name="viewResolvers">
+            <list>
+                <bean class="org.springframework.web.servlet.view.BeanNameViewResolver" />
+                <bean
+                    class="org.springframework.web.servlet.view.InternalResourceViewResolver">
+                    <property name="prefix" value="/WEB-INF/jsp/" />
+                    <property name="suffix" value=".jsp" />
+                    <property name="exposedContextBeanNames">
+                        <list>
+                            <value>properties</value>
+                        </list>
+                    </property>
+                </bean>
+            </list>
+        </property>
+        <property name="defaultViews">
+            <list>
+                <bean
+                    class="org.springframework.web.servlet.view.json.MappingJacksonJsonView" />
+            </list>
+        </property>
+    </bean> -->
+
+    <!-- 视图文件解析配置 -->
+    <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
+        <property name="prefix" value="/WEB-INF/views/"/>
+        <property name="suffix" value=".jsp"/>
+        <property name="exposedContextBeanNames">
+            <list>
+                <value>properties</value>
+            </list>
+        </property>
+    </bean>
+    <!-- Mapping exception to the handler view -->
+    <!-- <bean id="exceptionResolver" class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">
+        to /error.jsp -->
+    <!-- <property name="defaultErrorView" value="error"/> <property name="exceptionMappings">
+        <props> </props> </property> </bean> -->
+
+    <!-- 配置SpringMVC @ResponseBody和@RequestBody注解 -->
+    <bean
+            class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
+        <property name="messageConverters">
+            <list>
+                <bean class="org.springframework.http.converter.ByteArrayHttpMessageConverter"/>
+                <ref bean="jsonHttpMessageConverter"/>
+            </list>
+        </property>
+    </bean>
 
-	<mvc:annotation-driven />
- 
-	<mvc:interceptors>
-		<mvc:interceptor>
-			<mvc:mapping path="/**" />
-			<mvc:exclude-mapping path="/resources/**"/>
-			<mvc:exclude-mapping path="/static/**"/>
-			<mvc:exclude-mapping path="/file/**"/>
-			<mvc:exclude-mapping path="/api/**"/>
-			<bean id="commonInterceptor" class="cn.com.qmth.stmms.common.interceptor.CommonInterceptor"></bean>
-		</mvc:interceptor>
-		<mvc:interceptor>
-			<mvc:mapping path="/admin/**" />
-			<bean id="adminInterceptor" class="cn.com.qmth.stmms.admin.interceptor.AdminInterceptor"></bean>
-		</mvc:interceptor>
-		<mvc:interceptor>
-			<mvc:mapping path="/admin/sys/**" />
-			<bean id="sysAdminInterceptor" class="cn.com.qmth.stmms.admin.interceptor.SysAdminInterceptor"></bean>
-		</mvc:interceptor>
-		<mvc:interceptor>
-			<mvc:mapping path="/admin/exam/**" />
-			<bean id="adminExamInterceptor" class="cn.com.qmth.stmms.admin.interceptor.AdminExamInterceptor"></bean>
-		</mvc:interceptor>
-		<mvc:interceptor>
-			<mvc:mapping path="/api/**" />
-			<bean id="apiInterceptor" class="cn.com.qmth.stmms.api.interceptor.ApiInterceptor"></bean>
-		</mvc:interceptor>
-		<mvc:interceptor>
-			<mvc:mapping path="/mark/**" />
-			<bean id="markInterceptor" class="cn.com.qmth.stmms.mark.interceptor.MarkInterceptor"></bean>
-		</mvc:interceptor>
-		<mvc:interceptor>
-			<mvc:mapping path="/**" />
-			<mvc:exclude-mapping path="/resources/**"/>
-			<mvc:exclude-mapping path="/static/**"/>
-			<mvc:exclude-mapping path="/file/**"/>
-			<mvc:exclude-mapping path="/api/**"/>
-			<bean id="methodInterceptor" class="cn.com.qmth.stmms.common.interceptor.MethodInterceptor"></bean>
-		</mvc:interceptor>
-		
-		<bean class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor" />
-	</mvc:interceptors>
+    <bean id="jsonHttpMessageConverter"
+          class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter">
+        <property name="supportedMediaTypes">
+            <list>
+                <value>application/json;charset=UTF-8</value>
+            </list>
+        </property>
+    </bean>
 
-	<!-- <bean
-		class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver">
-		<property name="mediaTypes">
-			<map>
-				<entry key="atom" value="application/atom+xml" />
-				<entry key="html" value="text/html" />
-				<entry key="json" value="application/json" />
-			</map>
-		</property>
-		<property name="viewResolvers">
-			<list>
-				<bean class="org.springframework.web.servlet.view.BeanNameViewResolver" />
-				<bean
-					class="org.springframework.web.servlet.view.InternalResourceViewResolver">
-					<property name="prefix" value="/WEB-INF/jsp/" />
-					<property name="suffix" value=".jsp" />
-					<property name="exposedContextBeanNames">
-						<list>
-							<value>properties</value>
-						</list>
-					</property>
-				</bean>
-			</list>
-		</property>
-		<property name="defaultViews">
-			<list>
-				<bean
-					class="org.springframework.web.servlet.view.json.MappingJacksonJsonView" />
-			</list>
-		</property>
-	</bean> -->
-	
-	<!-- 视图文件解析配置 -->
-	<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
-		<property name="prefix" value="/WEB-INF/views/"/>
-		<property name="suffix" value=".jsp"/>
-		<property name="exposedContextBeanNames">
-			<list>
-				<value>properties</value>
-			</list>
-		</property>
-	</bean>
-	<!-- Mapping exception to the handler view -->
-	<!-- <bean id="exceptionResolver" class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver"> 
-		to /error.jsp -->
-	<!-- <property name="defaultErrorView" value="error"/> <property name="exceptionMappings"> 
-		<props> </props> </property> </bean> -->
+    <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver"/>
 
-	<!-- 配置SpringMVC @ResponseBody和@RequestBody注解 -->
-	<bean
-		class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
-		<property name="messageConverters">
-			<list>
-				<bean class="org.springframework.http.converter.ByteArrayHttpMessageConverter"/>
-				<ref bean="jsonHttpMessageConverter" />
-			</list>
-		</property>
-	</bean>
+    <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
+        <property name="ignoreResourceNotFound" value="true"/>
+        <property name="locations">
+            <list>
+                <value>/WEB-INF/application.properties</value>
+            </list>
+        </property>
+    </bean>
 
-	<bean id="jsonHttpMessageConverter"
-		class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter">
-		<property name="supportedMediaTypes">
-			<list>
-				<value>application/json;charset=UTF-8</value>
-			</list>
-		</property>
-	</bean>
-	
-	<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver" />
-	
-	<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" >
-		<property name="ignoreResourceNotFound" value="true" />
-		<property name="locations">
-			<list>
-				<value>/WEB-INF/application.properties</value>
-			</list>
-		</property>
-	</bean>
+    <bean id="properties" class="org.springframework.beans.factory.config.PropertiesFactoryBean">
+        <property name="ignoreResourceNotFound" value="true"/>
+        <property name="locations">
+            <list>
+                <value>/WEB-INF/application.properties</value>
+            </list>
+        </property>
+    </bean>
 
-	<bean id="properties" class="org.springframework.beans.factory.config.PropertiesFactoryBean" >
-		<property name="ignoreResourceNotFound" value="true" />
-		<property name="locations">
-			<list>
-				<value>/WEB-INF/application.properties</value>
-			</list>
-		</property>
-	</bean>
-	
-	<bean id="localeResolver" class="org.springframework.web.servlet.i18n.SessionLocaleResolver" />
-	<bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
-    	<property name="useCodeAsDefaultMessage" value="true" />   
-    	<property name="defaultEncoding" value="UTF-8" />         
-    	<property name="basenames">
-		   <list>
-				<value>/WEB-INF/language/messages</value>
-		   </list>
-  		</property>
-	</bean>
+    <bean id="localeResolver" class="org.springframework.web.servlet.i18n.SessionLocaleResolver"/>
+    <bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
+        <property name="defaultEncoding" value="UTF-8"/>
+        <property name="basenames" value="/WEB-INF/language/messages"/>
+    </bean>
 </beans> 

+ 1 - 0
stmms-web/src/main/webapp/WEB-INF/views/include/taglib.jsp

@@ -1,6 +1,7 @@
 <%@ taglib prefix="shiro" uri="/WEB-INF/tlds/shiros.tld" %>
 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
 <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
+<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
 <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
 <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
 <%@ taglib prefix="fns" uri="/WEB-INF/tlds/fns.tld" %>

+ 78 - 74
stmms-web/src/main/webapp/WEB-INF/views/modules/sys/login.jsp

@@ -1,86 +1,90 @@
 <%@ page contentType="text/html;charset=UTF-8" %>
-<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
+<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
 <html>
 <head>
-	<title>登录</title>
-	<meta name="decorator" content="default"/>
-	<%@include file="/WEB-INF/views/include/head.jsp" %>
+    <title><spring:message code="user.login"/></title>
+    <meta name="decorator" content="default"/>
+    <%@include file="/WEB-INF/views/include/head.jsp" %>
     <link rel="stylesheet" href="${ctxStatic}/common/login.css">
-	<script type="text/javascript">
-		$(document).ready(function() {
-			$("#showType").hide();
-			$("#adminLogin").click(function() {
-				$("#adminLogin").addClass("on");
-				$("#markLogin").removeClass("on");
-				$("#showType").attr("value","admin-login");
-			});
-			$("#markLogin").click(function() {
-				$("#markLogin").addClass("on");
-				$("#adminLogin").removeClass("on");
-				$("#showType").attr("value","mark-login");
-			});
-			if(self.frameElement && self.frameElement.tagName=="IFRAME"){
-				parent.location.reload();
-			}
-			loadProperties('en');
-			function loadProperties(locale) {  
-	            jQuery.i18n.properties({//加载资浏览器语言对应的资源文件
-	                name : 'messages', //资源文件名称
-	                path : '/resources/i18n/', //资源文件路径
-	                mode : 'map', //用Map的方式使用资源文件中的值
-	                language : locale,
-	                callback : function() {//加载成功后设置显示内容
-	                    $("[data-i18n-value]").each(function() {
-	                    	$(this).val($.i18n.prop($(this).data("i18n-value")));
-	                    });
-	                    $("[data-i18n-text]").each(function() {
-	                    	$(this).text($.i18n.prop($(this).data("i18n-text")));
-	                    });
-	                    $("[data-i18n-html]").each(function() {
-	                    	$(this).html($.i18n.prop($(this).data("i18n-html")));
-	                    });
-	                }
-	            });
-			}
-		});
-	</script>
+    <script type="text/javascript">
+        $(document).ready(function () {
+            $("#showType").hide();
+            $("#adminLogin").click(function () {
+                $("#adminLogin").addClass("on");
+                $("#markLogin").removeClass("on");
+                $("#showType").attr("value", "admin-login");
+            });
+            $("#markLogin").click(function () {
+                $("#markLogin").addClass("on");
+                $("#adminLogin").removeClass("on");
+                $("#showType").attr("value", "mark-login");
+            });
+            if (self.frameElement && self.frameElement.tagName == "IFRAME") {
+                parent.location.reload();
+            }
+            loadProperties('en');
+
+            function loadProperties(locale) {
+                jQuery.i18n.properties({//加载资浏览器语言对应的资源文件
+                    name: 'messages', //资源文件名称
+                    path: '/resources/i18n/', //资源文件路径
+                    mode: 'map', //用Map的方式使用资源文件中的值
+                    language: locale,
+                    callback: function () {//加载成功后设置显示内容
+                        $("[data-i18n-value]").each(function () {
+                            $(this).val($.i18n.prop($(this).data("i18n-value")));
+                        });
+                        $("[data-i18n-text]").each(function () {
+                            $(this).text($.i18n.prop($(this).data("i18n-text")));
+                        });
+                        $("[data-i18n-html]").each(function () {
+                            $(this).html($.i18n.prop($(this).data("i18n-html")));
+                        });
+                    }
+                });
+            }
+        });
+    </script>
 </head>
 <body>
 <div class="container">
-  <div class="middle cl">
-   <div class="left">
-    <div class="logo"><img src="${ctxStatic}/images/<c:if test="${indexLogo ==null||indexLogo =='' }">logo@2x.png</c:if><c:if test="${indexLogo !=null }">${indexLogo }</c:if>"/></div>
-    <p>Copyright &#169武汉启明软件 2012-2014</p>
-   </div>
-   <div class="right">
-     <div class="title">
-       <h1>高校考试管理平台</h1>
-       <c:if test="${loginType == 'admin-login' }"><p>管理员登录</p></c:if>
-       <c:if test="${loginType == 'mark-login' }"><p>评卷员登录</p></c:if>
-       <c:if test="${loginType == null || loginType == '' }">
-       <p><span><a href="#" class="<c:if test="${showType == 'admin-login' ||showType==null}">on</c:if>" id="adminLogin">管理员登录</a></span>
-       	<span><a href="#" class="<c:if test="${showType == 'mark-login' }">on</c:if>" id="markLogin">评卷员登录</a></span></p>
-       </c:if>
-     </div>
-     <div class="loginbox">
-      <form action="${ctx}/login" method="post" role="form" id="loginForm">
-      	<input id ="showType" name ="showType" value="${showType}" />
-        <div class="input-group">
-        	<input type="text" class="form-control required" id="loginName" name="loginName" placeholder="请输入用户名" autocomplete="off" value="${loginName }"/>
+    <div class="middle cl">
+        <div class="left">
+            <div class="logo"><img
+                    src="${ctxStatic}/images/<c:if test="${indexLogo ==null||indexLogo =='' }">logo@2x.png</c:if><c:if test="${indexLogo !=null }">${indexLogo }</c:if>"/>
+            </div>
+            <p>Copyright &#169武汉启明软件 2012-2014</p>
         </div>
-        <div class="input-group">
-        	<input type="password" class="form-control required" id="password" name="password" placeholder="请输入密码" autocomplete="off"/>
+        <div class="right">
+            <div class="title">
+                <h1>高校考试管理平台</h1>
+                <c:if test="${loginType == 'admin-login' }"><p>管理员登录</p></c:if>
+                <c:if test="${loginType == 'mark-login' }"><p>评卷员登录</p></c:if>
+                <c:if test="${loginType == null || loginType == '' }">
+                    <p><span><a href="#" class="<c:if test="${showType == 'admin-login' ||showType==null}">on</c:if>"
+                                id="adminLogin">管理员登录</a></span>
+                        <span><a href="#" class="<c:if test="${showType == 'mark-login' }">on</c:if>" id="markLogin">评卷员登录</a></span></p>
+                </c:if>
+            </div>
+            <div class="loginbox">
+                <form action="${ctx}/login" method="post" role="form" id="loginForm">
+                    <input id="showType" name="showType" value="${showType}"/>
+                    <div class="input-group">
+                        <input type="text" class="form-control required" id="loginName" name="loginName" placeholder="请输入用户名"
+                               autocomplete="off" value="${loginName }"/>
+                    </div>
+                    <div class="input-group">
+                        <input type="password" class="form-control required" id="password" name="password" placeholder="请输入密码"
+                               autocomplete="off"/>
+                    </div>
+                    <div class="point <c:if test="${message != null }"></c:if><c:if test="${message == null }">hide</c:if>">
+                        <em class="error">${message }</em>
+                    </div>
+                    <div class="login-btn"><input class="opacity" type="submit" value="登 录" data-i18n-value="user.login.submit"/></div>
+                </form>
+            </div>
         </div>
-        <div class="point <c:if test="${message != null }"></c:if><c:if test="${message == null }">hide</c:if>">
-        <em class="error">${message }</em>
-        </div>
-        <div class="login-btn"><input class="opacity" type="submit" value="登 录" data-i18n-value="user.login.submit"/></div>
-        <div class="language"><a href="#" onclick="location='${ctx}/language/zh?url='+location.href">&nbsp; 中文</a>
-			 <a href="#" onclick="location='${ctx}/language/en?url='+location.href">&nbsp; English</a></div>
-      </form>
-     </div>
-   </div>
-  </div>
+    </div>
 </div>
 </body>
 </html>