Kawai Wiki

Compare Revisions

Ignore whitespace Rev 228 → Rev 229

/trunk/src/main/java/org/kawai/AppManager.java
250,7 → 250,7
on(AJAX, ajax(new JsonRenderer()));
 
ActionConfig mainAction = action("/Page", PageAction.class)
.prettyURLParams("name", "title")
.prettyURLParams("name", "lang", "title")
.on(SHOW, redir()) // for the pretty url
.on(SUCCESS, fwd("/show_page.jsp"));
 
/trunk/src/main/java/org/kawai/tag/kcode/PageLink.java
110,9 → 110,9
page = pageDAO.loadWithTitleOnly(name, pageAction.getLanguage());
if (page != null) {
prettyURL = HttpUtils.getPrettyURL("Page", null, name, page.getPrettyURLFormattedTitle());
prettyURL = HttpUtils.getPrettyURL("Page", null, name, pageAction.getLanguage().getLocale().toString(), page.getPrettyURLFormattedTitle());
} else {
prettyURL = HttpUtils.getPrettyURL("Page", null, name);
prettyURL = HttpUtils.getPrettyURL("Page", null, name, pageAction.getLanguage().getLocale().toString());
}
}
}
/trunk/src/main/java/org/kawai/action/PageAction.java
12,7 → 12,6
import org.mentawai.filter.AuthenticationFree;
import org.mentawai.rule.MethodRule;
import org.mentawai.rule.RegexRule;
import org.mentawai.util.HttpUtils;
import org.mentawai.validation.Validatable;
import org.mentawai.validation.ValidationInterceptor;
import org.mentawai.validation.Validator;
328,11 → 327,15
}
if (isPrettyURL()) {
boolean wrongLanguage = !language.getLocale().equals(getLocale()); // cookies do not match with parameter
// check if URL is complete with the correct title...
String correctTitle = page.getPrettyURLFormattedTitle();
String inputTitle = input.getString("title");
if (inputTitle == null || !inputTitle.equals(correctTitle)) {
String prettyURL = getPrettyURL("Page", null, name, correctTitle);
if (inputTitle == null || !inputTitle.equals(correctTitle) || wrongLanguage) {
String prettyURL = getPrettyURL("Page", null, name, language.getLocale().toString(), correctTitle);
if (wrongLanguage) prettyURL += "?lang=" + language.getLocale().toString(); // adjust cookies to adjust flags...
redir(prettyURL);
return SHOW;
}
/trunk/pom.xml
80,7 → 80,7
<dependency>
<groupId>me.soliveirajr</groupId>
<artifactId>mentawai</artifactId>
<version>2.5.3</version>
<version>2.5.4-SNAPSHOT</version>
</dependency>
 
</dependencies>