Author: cmailleux
Date: Thu Oct 11 11:13:45 2007
New Revision: 18830
URL: https://svndev.jahia.net/websvn/listing.php?sc=3D1&rev=3D18830&repname=
=3Djahia
Log:
JAHIA-2338
Redirect to home page in edit mode even with pageUrlKey
Make it also work with esi
Modified:
branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/bin/Jahia.java
Modified: branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/bin/Jahia.ja=
va
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/core/src/java/org/jahia/bin/Jahia.java&rev=3D18830&repname=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/java/org/jahia/bin/Jahia.java (or=
iginal)
+++ branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/bin/Jahia.java Thu=
Oct 11 11:13:45 2007
@@ -972,7 +972,23 @@
} else {
redirectURL =3D requestURI.substring(0, pidPos=
) + "/pid/"+site.getHomePageID() + requestURI.substring(nextSlashPos);
}
+ if(jSettings.isEsiCacheActivated()) {
+ response.sendRedirect("http://"+request.getHea=
der("x-forwarded-host")+":"+request.getHeader("x-forwarded-port")+redirectU=
RL);
+ } else
response.sendRedirect(redirectURL); =
=
+ } else {
+ pidPos =3D requestURI.substring(0,requestURI.lengt=
h()-2).lastIndexOf("/");
+ // We are using url key
+ int nextSlashPos =3D requestURI.indexOf("/", pidPo=
s + "/pid/".length());
+ if (nextSlashPos =3D=3D -1) {
+ redirectURL =3D requestURI.substring(0, pidPos=
) + "/pid/"+site.getHomePageID();
+ } else {
+ redirectURL =3D requestURI.substring(0, pidPos=
) + "/pid/"+site.getHomePageID() + requestURI.substring(nextSlashPos);
+ }
+ if(jSettings.isEsiCacheActivated()) {
+ response.sendRedirect("http://"+request.getHea=
der("x-forwarded-host")+":"+request.getHeader("x-forwarded-port")+redirectU=
RL);
+ } else
+ response.sendRedirect(redirectURL);
}
} catch (IOException e) {
logger.error("error during redirection to homepage",e);
_______________________________________________
cvs_list mailing list
[email protected]
http://lists.jahia.org/cgi-bin/mailman/listinfo/cvs_list