Commit 5d41db5a authored by Matija Obreza's avatar Matija Obreza

Handle UTF8

parent 2459bd72
eclipse.preferences.version=1 eclipse.preferences.version=1
encoding//src/main/resources=UTF-8 encoding//src/main/resources=UTF-8
encoding//src/main/webapp/WEB-INF/jsp/login.jsp=UTF-8
encoding//src/main/webapp/WEB-INF/jsp/wiews/index.jsp=UTF-8
encoding//src/test/resources=UTF-8 encoding//src/test/resources=UTF-8
encoding/<project>=UTF-8 encoding/<project>=UTF-8
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
<packaging>war</packaging> <packaging>war</packaging>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jdk.target>1.7</jdk.target> <jdk.target>1.7</jdk.target>
<jdk.source>1.7</jdk.source> <jdk.source>1.7</jdk.source>
<show.deprecations>false</show.deprecations> <show.deprecations>false</show.deprecations>
......
...@@ -15,13 +15,17 @@ public class AddStuffInterceptor implements HandlerInterceptor { ...@@ -15,13 +15,17 @@ public class AddStuffInterceptor implements HandlerInterceptor {
@Override @Override
public void postHandle(HttpServletRequest arg0, HttpServletResponse arg1, Object arg2, ModelAndView modelAndView) throws Exception { public void postHandle(HttpServletRequest arg0, HttpServletResponse arg1, Object arg2, ModelAndView modelAndView) throws Exception {
// Authentication auth = SecurityContextHolder.getContext().getAuthentication(); long startTime = (Long) arg0.getAttribute("springStartTime");
// if (auth.isAuthenticated()) long endTime = System.currentTimeMillis();
// modelAndView.addObject("userPrincipal", auth.getPrincipal()); long executeTime = endTime - startTime;
arg0.setAttribute("springExecuteTime", executeTime);
} }
@Override @Override
public boolean preHandle(HttpServletRequest arg0, HttpServletResponse arg1, Object arg2) throws Exception { public boolean preHandle(HttpServletRequest arg0, HttpServletResponse arg1, Object arg2) throws Exception {
long startTime = System.currentTimeMillis();
arg0.setAttribute("springStartTime", startTime);
return true; return true;
} }
......
...@@ -69,6 +69,7 @@ sample.message.invite.organizations = Invite Organizations ...@@ -69,6 +69,7 @@ sample.message.invite.organizations = Invite Organizations
sample.message.invite.to.network = Invite to Network sample.message.invite.to.network = Invite to Network
data.error.404=The data you requested was not found in the system. data.error.404=The data you requested was not found in the system.
page.rendertime=Processing this page took {0}ms.
user.pulldown.logout=Logout user.pulldown.logout=Logout
user.pulldown.profile=View profile user.pulldown.profile=View profile
......
...@@ -93,7 +93,13 @@ ...@@ -93,7 +93,13 @@
<div id="dialog"></div> <div id="dialog"></div>
<sitemesh:write property="body" /> <sitemesh:write property="body" />
<!-- Processing time:
<div class="footer clearfix" style="font-size: 80%"><spring:message code="page.rendertime" arguments="${springExecuteTime}" /></div>
-->
</div> </div>
</div> </div>
</body> </body>
</html> </html>
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<body> <body>
<c:if test="${cropList ne null and cropList.size() gt 0}"> <c:if test="${cropList ne null and cropList.size() gt 0}">
<div class="pull-left" style="margin-right: 5%;"> <div class="pull-left" style="width: 20%; margin-right: 5%;">
<h3><spring:message code="crop.croplist"/></h3> <h3><spring:message code="crop.croplist"/></h3>
<ul> <ul>
<c:forEach items="${cropList}" var="crop" varStatus="status"> <c:forEach items="${cropList}" var="crop" varStatus="status">
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
</c:if> </c:if>
<c:if test="${lastNews ne null}"> <c:if test="${lastNews ne null}">
<div class="pull-left" style="width: 60%; margin-left: 5%"> <div class="pull-left" style="width: 70%; margin-left: 5%">
<h3><spring:message code="activity.recent-activity"/></h3> <h3><spring:message code="activity.recent-activity"/></h3>
<c:forEach items="${lastNews}" var="activityPost" varStatus="status"> <c:forEach items="${lastNews}" var="activityPost" varStatus="status">
<div class="activity-post"> <div class="activity-post">
......
<%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags" %> <%@ taglib prefix="security" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
<title><spring:message code="sample.message.index.title"/></title> <title><spring:message code="sample.message.index.title"/></title>
</head> </head>
<body> <body>
<c:if test="${param['error'] ne null}"> <c:if test="${param['error'] ne null}">
<div class="alert alert-error"><spring:message code="sample.error.wrong.credentials"/></div> <div class="alert alert-error"><spring:message code="sample.error.wrong.credentials"/></div>
</c:if> </c:if>
......
...@@ -11,13 +11,14 @@ ...@@ -11,13 +11,14 @@
<spring:message code="faoInstitutes.page.list.title" /> <spring:message code="faoInstitutes.page.list.title" />
</h1> </h1>
<div class="nav-header"><a href="?page=${faoInstitutes.number}">⇇ Previous</a> <a href="?page=${faoInstitutes.number + 2}">Next ⇉</a></div>
<ul> <ul>
<c:forEach items="${faoInstitutes.content}" var="faoInstitute" varStatus="status"> <c:forEach items="${faoInstitutes.content}" var="faoInstitute" varStatus="status">
<li><a href="<c:url value="/wiews/${faoInstitute.code.toLowerCase()}" />"><b><c:out value="${faoInstitute.code}" /></b> <c:out value="${faoInstitute.fullName}" /></a></li> <li><a href="<c:url value="/wiews/${faoInstitute.code.toLowerCase()}" />"><b><c:out value="${faoInstitute.code}" /></b> <c:out value="${faoInstitute.fullName}" /></a></li>
</c:forEach> </c:forEach>
</ul> </ul>
<a href="?page=${faoInstitutes.number}">Previous</a> <div class="nav-header"><a href="?page=${faoInstitutes.number}">⇇ Previous</a> <a href="?page=${faoInstitutes.number + 2}">Next ⇉</a></div>
<a href="?page=${faoInstitutes.number + 2}">Next</a>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -17,6 +17,23 @@ ...@@ -17,6 +17,23 @@
<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class> <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
</listener> </listener>
<filter>
<filter-name>encodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter> <filter>
<filter-name>org.springframework.security.filterChainProxy</filter-name> <filter-name>org.springframework.security.filterChainProxy</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
...@@ -64,4 +81,10 @@ ...@@ -64,4 +81,10 @@
<session-timeout>30</session-timeout> <session-timeout>30</session-timeout>
</session-config> </session-config>
<jsp-config>
<jsp-property-group>
<url-pattern>*.jsp</url-pattern>
<page-encoding>UTF-8</page-encoding>
</jsp-property-group>
</jsp-config>
</web-app> </web-app>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment