]> SALOME platform Git repositories - tools/siman.git/commitdiff
Salome HOME
Upload operation is improved(Files that name contains the special symbols(ex, &)...
authormka <mka@opencascade.com>
Mon, 8 Apr 2013 08:48:46 +0000 (08:48 +0000)
committermka <mka@opencascade.com>
Mon, 8 Apr 2013 08:48:46 +0000 (08:48 +0000)
Workspace/Siman/src/org/splat/simer/UploadAction.java
Workspace/Siman/src/struts.xml

index a5548dd530847d46fe7e3264217e11927c44b444..1814bceea424bfcde1f3b82fc58ad1df06e13856 100644 (file)
@@ -1,6 +1,8 @@
 package org.splat.simer;
 
 import java.io.File;
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
 
 import org.splat.kernel.Do;
 import org.splat.service.technical.RepositoryService;
@@ -162,6 +164,20 @@ public class UploadAction extends Action {
                return _uploadFileName;
        }
 
+       /**
+        * Get fileName with url special symbols canceled for usage in struts.xml.
+        * @return
+        */
+       public String getCanceledFileName() {
+               String res = _uploadFileName;
+               try {
+                       res = URLEncoder.encode(res, "UTF-8");
+               } catch (UnsupportedEncodingException e) {
+                       LOG.error("Reason: ", e);
+               }
+               return res;
+       }
+       
        /**
         * Get the action to which the uploaded file is passed.
         * 
index 1c319620450475a911738f8d7ab7c6aec53b53d9..8d6c00dd151daa5ebe72b6ba8ee10d9e8ef73ba8 100644 (file)
                                step-study
                        </result>
                        <result name="import" type="redirectAction">
-                               import-document?fileName=%{fileName}
+                               import-document?fileName=%{canceledFileName}
                        </result>
                        <result name="version" type="redirectAction">
-                               version-document?index=%{index}&amp;fileName=%{fileName}
+                               version-document?index=%{index}&amp;fileName=%{canceledFileName}
                        </result>
                        <result name="attach" type="redirectAction">
-                               attach-document?index=%{index}&amp;fileName=%{fileName}
+                               attach-document?index=%{index}&amp;fileName=%{canceledFileName}
                        </result>
                        <result name="outofmemory" type="tiles">
                                page.error.study