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);
|
||||
}
|
||||
|
||||
if (!path.endsWith(".jsp")) {
|
||||
if (CMSConfig.getInstanceOf().getUseLanguageExtension()
|
||||
&& path.matches("(.*)/index\\.[a-zA-Z]{2}")) {
|
||||
|
||||
|
|
@ -87,9 +88,11 @@ public class NavigationFileResolver extends DefaultApplicationFileResolver {
|
|||
|
||||
String lang;
|
||||
if (GlobalizationHelper.getSelectedLocale(sreq) == null) {
|
||||
lang = GlobalizationHelper.getNegotiatedLocale().getLanguage();
|
||||
lang = GlobalizationHelper.getNegotiatedLocale()
|
||||
.getLanguage();
|
||||
} else {
|
||||
lang = GlobalizationHelper.getSelectedLocale(sreq).getLanguage();
|
||||
lang = GlobalizationHelper.getSelectedLocale(sreq)
|
||||
.getLanguage();
|
||||
}
|
||||
|
||||
final StringBuffer redirectTo = new StringBuffer();
|
||||
|
|
@ -116,7 +119,8 @@ public class NavigationFileResolver extends DefaultApplicationFileResolver {
|
|||
if (cats == null) {
|
||||
lang = KernelConfig.getConfig().getDefaultLanguage();
|
||||
} else {
|
||||
final CategoryLocalizationCollection langs = cats[cats.length
|
||||
final CategoryLocalizationCollection langs
|
||||
= cats[cats.length
|
||||
- 1]
|
||||
.getCategoryLocalizationCollection();
|
||||
if (!langs.localizationExists(lang)) {
|
||||
|
|
@ -127,7 +131,11 @@ public class NavigationFileResolver extends DefaultApplicationFileResolver {
|
|||
redirectTo
|
||||
.append("/ccm")
|
||||
.append(app.getPath())
|
||||
.append(path)
|
||||
.append(path);
|
||||
if (!path.endsWith("/")) {
|
||||
redirectTo.append('/');
|
||||
}
|
||||
redirectTo
|
||||
.append("index.")
|
||||
.append(lang);
|
||||
|
||||
|
|
@ -139,6 +147,7 @@ public class NavigationFileResolver extends DefaultApplicationFileResolver {
|
|||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
if (path.equals("/category.jsp")) {
|
||||
Navigation nav = (Navigation) Web.getWebContext().getApplication();
|
||||
|
|
|
|||
Loading…
Reference in New Issue