Bugfix for ccm-navigation and redirect to language specific URL: If the URL points to a JSP (sitemap.jsp in particular) do no redirect.
git-svn-id: https://svn.libreccm.org/ccm/trunk@5104 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
ae645cb299
commit
c9bf0919b0
|
|
@ -77,6 +77,7 @@ public class NavigationFileResolver extends DefaultApplicationFileResolver {
|
||||||
s_log.debug("Resolving " + path);
|
s_log.debug("Resolving " + path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!path.endsWith(".jsp")) {
|
||||||
if (CMSConfig.getInstanceOf().getUseLanguageExtension()
|
if (CMSConfig.getInstanceOf().getUseLanguageExtension()
|
||||||
&& path.matches("(.*)/index\\.[a-zA-Z]{2}")) {
|
&& path.matches("(.*)/index\\.[a-zA-Z]{2}")) {
|
||||||
|
|
||||||
|
|
@ -87,9 +88,11 @@ public class NavigationFileResolver extends DefaultApplicationFileResolver {
|
||||||
|
|
||||||
String lang;
|
String lang;
|
||||||
if (GlobalizationHelper.getSelectedLocale(sreq) == null) {
|
if (GlobalizationHelper.getSelectedLocale(sreq) == null) {
|
||||||
lang = GlobalizationHelper.getNegotiatedLocale().getLanguage();
|
lang = GlobalizationHelper.getNegotiatedLocale()
|
||||||
|
.getLanguage();
|
||||||
} else {
|
} else {
|
||||||
lang = GlobalizationHelper.getSelectedLocale(sreq).getLanguage();
|
lang = GlobalizationHelper.getSelectedLocale(sreq)
|
||||||
|
.getLanguage();
|
||||||
}
|
}
|
||||||
|
|
||||||
final StringBuffer redirectTo = new StringBuffer();
|
final StringBuffer redirectTo = new StringBuffer();
|
||||||
|
|
@ -116,7 +119,8 @@ public class NavigationFileResolver extends DefaultApplicationFileResolver {
|
||||||
if (cats == null) {
|
if (cats == null) {
|
||||||
lang = KernelConfig.getConfig().getDefaultLanguage();
|
lang = KernelConfig.getConfig().getDefaultLanguage();
|
||||||
} else {
|
} else {
|
||||||
final CategoryLocalizationCollection langs = cats[cats.length
|
final CategoryLocalizationCollection langs
|
||||||
|
= cats[cats.length
|
||||||
- 1]
|
- 1]
|
||||||
.getCategoryLocalizationCollection();
|
.getCategoryLocalizationCollection();
|
||||||
if (!langs.localizationExists(lang)) {
|
if (!langs.localizationExists(lang)) {
|
||||||
|
|
@ -127,7 +131,11 @@ public class NavigationFileResolver extends DefaultApplicationFileResolver {
|
||||||
redirectTo
|
redirectTo
|
||||||
.append("/ccm")
|
.append("/ccm")
|
||||||
.append(app.getPath())
|
.append(app.getPath())
|
||||||
.append(path)
|
.append(path);
|
||||||
|
if (!path.endsWith("/")) {
|
||||||
|
redirectTo.append('/');
|
||||||
|
}
|
||||||
|
redirectTo
|
||||||
.append("index.")
|
.append("index.")
|
||||||
.append(lang);
|
.append(lang);
|
||||||
|
|
||||||
|
|
@ -139,6 +147,7 @@ public class NavigationFileResolver extends DefaultApplicationFileResolver {
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (path.equals("/category.jsp")) {
|
if (path.equals("/category.jsp")) {
|
||||||
Navigation nav = (Navigation) Web.getWebContext().getApplication();
|
Navigation nav = (Navigation) Web.getWebContext().getApplication();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue