Author: ktlili
Date: Tue Oct 9 12:27:53 2007
New Revision: 18791
URL: https://svndev.jahia.net/websvn/listing.php?sc=3D1&rev=3D18791&repname=
=3Djahia
Log:
- fix JAHIA-2438 : deal with "?" and "&" in "applyEngineUrl"
Modified:
branches/JAHIA-5-0-SP-BRANCH/core/src/webapp/jsp/jahia/engines/shared/a=
pply.jsp
Modified: branches/JAHIA-5-0-SP-BRANCH/core/src/webapp/jsp/jahia/engines/sh=
ared/apply.jsp
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/core/src/webapp/jsp/jahia/engines/shared/apply.jsp&rev=3D18791&repn=
ame=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/JAHIA-5-0-SP-BRANCH/core/src/webapp/jsp/jahia/engines/shared/a=
pply.jsp (original)
+++ branches/JAHIA-5-0-SP-BRANCH/core/src/webapp/jsp/jahia/engines/shared/a=
pply.jsp Tue Oct 9 12:27:53 2007
@@ -1,39 +1,43 @@
-<%--
-Copyright 2002-2006 Jahia Ltd
-
-Licensed under the JAHIA COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (JCDD=
L), =
-Version 1.0 (the "License"), or (at your option) any later version; you ma=
y =
-not use this file except in compliance with the License. You should have =
-received a copy of the License along with this program; if not, you may ob=
tain =
-a copy of the License at =
-
- http://www.jahia.org/license/
-
-Unless required by applicable law or agreed to in writing, software =
-distributed under the License is distributed on an "AS IS" BASIS, =
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. =
-See the License for the specific language governing permissions and =
-limitations under the License.
---%><%@ page language=3D"java" %>
+<%@ page language=3D"java" %>
<%@ page import=3D"java.util.*" %>
=
+<%!
+ private String composeApplyJahiaWindowUrl(final String url, final Stri=
ng screen) {
+ if (url !=3D null) {
+ String applyJahiaWindowUrl =3D new String(url);
+ if (url.indexOf('?') > -1) {
+ // url has at least one parameter
+ applyJahiaWindowUrl =3D applyJahiaWindowUrl + "&";
+ } else {
+ // url hasn't parameters
+ applyJahiaWindowUrl =3D applyJahiaWindowUrl + "?";
+ }
+ applyJahiaWindowUrl =3D applyJahiaWindowUrl + "screen=3D" + sc=
reen;
+ return applyJahiaWindowUrl;
+ }
+ return null;
+ }
+%>
+
<%
- final HashMap engineMap =3D (HashMap) request.getAttribute("org.jahia.=
engines.EngineHashMap");
- final String javaScriptPath =3D (String) engineMap.get("javaScriptPath=
");
- final String url =3D (String) engineMap.get("engineUrl");
- final String screen =3D (String) engineMap.get("screen");
+ HashMap engineMap =3D (HashMap) request.getAttribute("org.jahia.engine=
s.EngineHashMap");
+ String javaScriptPath =3D (String) engineMap.get("javaScriptPath");
+ String url =3D (String) engineMap.get("engineUrl");
+ String screen =3D (String) engineMap.get("screen");
+
%>
=
<html>
<head>
- <script type=3D"text/javascript" src=3D"<%=3DjavaScriptPath%>">
+
+ <script language=3D"javascript" src=3D"<%=3DjavaScriptPath%>">
</script>
- <script type=3D"text/javascript">
- applyJahiaWindow("<%=3Durl%>" + "&screen=3D" + "<%=3Dscreen%>");
+ <script language=3D"javascript">
+ applyJahiaWindow("<%=3DcomposeApplyJahiaWindowUrl(url, screen)%>");
</script>
=
</head>
-
<body bgcolor=3D"white">
</body>
</html>
+
_______________________________________________
cvs_list mailing list
[email protected]
http://lists.jahia.org/cgi-bin/mailman/listinfo/cvs_list