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

Handle UTF8

parent 2459bd72
eclipse.preferences.version=1
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/<project>=UTF-8
......@@ -12,6 +12,7 @@
<packaging>war</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jdk.target>1.7</jdk.target>
<jdk.source>1.7</jdk.source>
<show.deprecations>false</show.deprecations>
......
......@@ -15,13 +15,17 @@ public class AddStuffInterceptor implements HandlerInterceptor {
@Override
public void postHandle(HttpServletRequest arg0, HttpServletResponse arg1, Object arg2, ModelAndView modelAndView) throws Exception {
// Authentication auth = SecurityContextHolder.getContext().getAuthentication();
// if (auth.isAuthenticated())
// modelAndView.addObject("userPrincipal", auth.getPrincipal());
long startTime = (Long) arg0.getAttribute("springStartTime");
long endTime = System.currentTimeMillis();
long executeTime = endTime - startTime;
arg0.setAttribute("springExecuteTime", executeTime);
}
@Override
public boolean preHandle(HttpServletRequest arg0, HttpServletResponse arg1, Object arg2) throws Exception {
long startTime = System.currentTimeMillis();
arg0.setAttribute("springStartTime", startTime);
return true;
}
......
......@@ -69,6 +69,7 @@ sample.message.invite.organizations = Invite Organizations
sample.message.invite.to.network = Invite to Network
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.profile=View profile
......
......@@ -93,7 +93,13 @@
<div id="dialog"></div>
<sitemesh:write property="body" />
<!-- Processing time:
<div class="footer clearfix" style="font-size: 80%"><spring:message code="page.rendertime" arguments="${springExecuteTime}" /></div>
-->
</div>
</div>
</body>
</html>
......@@ -9,7 +9,7 @@
<body>
<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>
<ul>
<c:forEach items="${cropList}" var="crop" varStatus="status">
......@@ -20,7 +20,7 @@
</c:if>
<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>
<c:forEach items="${lastNews}" var="activityPost" varStatus="status">
<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="security" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
......
......@@ -7,7 +7,6 @@
<title><spring:message code="sample.message.index.title"/></title>
</head>
<body>
<c:if test="${param['error'] ne null}">
<div class="alert alert-error"><spring:message code="sample.error.wrong.credentials"/></div>
</c:if>
......
......@@ -11,13 +11,14 @@
<spring:message code="faoInstitutes.page.list.title" />
</h1>
<div class="nav-header"><a href="?page=${faoInstitutes.number}">⇇ Previous</a> <a href="?page=${faoInstitutes.number + 2}">Next ⇉</a></div>
<ul>
<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>
</c:forEach>
</ul>
<a href="?page=${faoInstitutes.number}">Previous</a>
<a href="?page=${faoInstitutes.number + 2}">Next</a>
<div class="nav-header"><a href="?page=${faoInstitutes.number}">⇇ Previous</a> <a href="?page=${faoInstitutes.number + 2}">Next ⇉</a></div>
</body>
</html>
\ No newline at end of file
......@@ -17,6 +17,23 @@
<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
</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-name>org.springframework.security.filterChainProxy</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
......@@ -64,4 +81,10 @@
<session-timeout>30</session-timeout>
</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>
\ 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