From f1854bda4a87b3e6be2ccb3166365e79b803517d Mon Sep 17 00:00:00 2001 From: rkv Date: Tue, 16 Apr 2013 08:50:11 +0000 Subject: [PATCH] Fix for uploading of files with names containing specific (accented, ampersand) characters. --- Workspace/Siman/WebContent/layout/baseLayout.jsp | 3 ++- .../Siman/WebContent/layout/baseLayoutWithoutTitleBar.jsp | 3 ++- Workspace/Siman/WebContent/layout/homeLayout.jsp | 4 ++-- Workspace/Siman/WebContent/layout/layoutLogin.jsp | 4 ++-- Workspace/Siman/WebContent/layout/welcomeLayout.jsp | 4 ++-- Workspace/Siman/src/org/splat/simer/UploadAction.java | 2 +- 6 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Workspace/Siman/WebContent/layout/baseLayout.jsp b/Workspace/Siman/WebContent/layout/baseLayout.jsp index 07aff59..3d1689d 100644 --- a/Workspace/Siman/WebContent/layout/baseLayout.jsp +++ b/Workspace/Siman/WebContent/layout/baseLayout.jsp @@ -1,4 +1,5 @@ -<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> <%@ taglib prefix="s" uri="/struts-tags"%> <%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles"%> diff --git a/Workspace/Siman/WebContent/layout/baseLayoutWithoutTitleBar.jsp b/Workspace/Siman/WebContent/layout/baseLayoutWithoutTitleBar.jsp index 4401d4d..1af287a 100644 --- a/Workspace/Siman/WebContent/layout/baseLayoutWithoutTitleBar.jsp +++ b/Workspace/Siman/WebContent/layout/baseLayoutWithoutTitleBar.jsp @@ -1,4 +1,5 @@ -<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> <%@ taglib prefix="s" uri="/struts-tags"%> <%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles"%> diff --git a/Workspace/Siman/WebContent/layout/homeLayout.jsp b/Workspace/Siman/WebContent/layout/homeLayout.jsp index 3de62f2..c8b78b9 100644 --- a/Workspace/Siman/WebContent/layout/homeLayout.jsp +++ b/Workspace/Siman/WebContent/layout/homeLayout.jsp @@ -1,5 +1,5 @@ -<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%> -<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> <%@ taglib prefix="s" uri="/struts-tags"%> <%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles"%> diff --git a/Workspace/Siman/WebContent/layout/layoutLogin.jsp b/Workspace/Siman/WebContent/layout/layoutLogin.jsp index ca97ea4..e4e188a 100644 --- a/Workspace/Siman/WebContent/layout/layoutLogin.jsp +++ b/Workspace/Siman/WebContent/layout/layoutLogin.jsp @@ -1,5 +1,5 @@ -<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%> -<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> <%@ taglib prefix="s" uri="/struts-tags"%> <%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles"%> diff --git a/Workspace/Siman/WebContent/layout/welcomeLayout.jsp b/Workspace/Siman/WebContent/layout/welcomeLayout.jsp index 86dd973..c854eda 100644 --- a/Workspace/Siman/WebContent/layout/welcomeLayout.jsp +++ b/Workspace/Siman/WebContent/layout/welcomeLayout.jsp @@ -1,5 +1,5 @@ -<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%> -<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> <%@ taglib prefix="s" uri="/struts-tags"%> <%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles"%> diff --git a/Workspace/Siman/src/org/splat/simer/UploadAction.java b/Workspace/Siman/src/org/splat/simer/UploadAction.java index 742b213..95b5b38 100644 --- a/Workspace/Siman/src/org/splat/simer/UploadAction.java +++ b/Workspace/Siman/src/org/splat/simer/UploadAction.java @@ -172,7 +172,7 @@ public class UploadAction extends Action { public String getCanceledFileName() { String res = _uploadFileName; try { - res = URLEncoder.encode(res, "UTF-8"); + res = URLEncoder.encode(res, "ISO-8859-1"); } catch (UnsupportedEncodingException e) { LOG.error("Reason: ", e); } -- 2.39.2