aboutsummaryrefslogtreecommitdiff
path: root/juick-spring-www/src/main/java/com
diff options
context:
space:
mode:
Diffstat (limited to 'juick-spring-www/src/main/java/com')
-rw-r--r--juick-spring-www/src/main/java/com/juick/www/configuration/WebAppConfiguration.java8
-rw-r--r--juick-spring-www/src/main/java/com/juick/www/configuration/WebSecurityConfig.java2
-rw-r--r--juick-spring-www/src/main/java/com/juick/www/controllers/PMController.java4
3 files changed, 13 insertions, 1 deletions
diff --git a/juick-spring-www/src/main/java/com/juick/www/configuration/WebAppConfiguration.java b/juick-spring-www/src/main/java/com/juick/www/configuration/WebAppConfiguration.java
index b314db643..a66322896 100644
--- a/juick-spring-www/src/main/java/com/juick/www/configuration/WebAppConfiguration.java
+++ b/juick-spring-www/src/main/java/com/juick/www/configuration/WebAppConfiguration.java
@@ -5,6 +5,8 @@ import com.juick.www.WebApp;
import com.juick.www.settings.TemplateSettingsHolder;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cache.guava.GuavaCacheManager;
+import org.springframework.cache.interceptor.KeyGenerator;
+import org.springframework.cache.interceptor.SimpleKeyGenerator;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
@@ -54,4 +56,10 @@ public class WebAppConfiguration {
public HelpService helpService() {
return new HelpService("help");
}
+
+ @Bean
+ public KeyGenerator keyGenerator() {
+ // configure and return an implementation of Spring's KeyGenerator SPI
+ return new SimpleKeyGenerator();
+ }
}
diff --git a/juick-spring-www/src/main/java/com/juick/www/configuration/WebSecurityConfig.java b/juick-spring-www/src/main/java/com/juick/www/configuration/WebSecurityConfig.java
index 551c0185b..bb6387d66 100644
--- a/juick-spring-www/src/main/java/com/juick/www/configuration/WebSecurityConfig.java
+++ b/juick-spring-www/src/main/java/com/juick/www/configuration/WebSecurityConfig.java
@@ -48,10 +48,10 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
.loginPage("/login")
.permitAll()
.defaultSuccessUrl("/")
- .failureForwardUrl("/login?error=1")
.loginProcessingUrl("/do_login")
.usernameParameter("j_username")
.passwordParameter("j_password")
+ .failureUrl("/login?error=1")
.and()
.rememberMe()
.tokenValiditySeconds(6 * 30 * 24 * 3600)
diff --git a/juick-spring-www/src/main/java/com/juick/www/controllers/PMController.java b/juick-spring-www/src/main/java/com/juick/www/controllers/PMController.java
index 41c6b33c3..d40e7aaff 100644
--- a/juick-spring-www/src/main/java/com/juick/www/controllers/PMController.java
+++ b/juick-spring-www/src/main/java/com/juick/www/controllers/PMController.java
@@ -42,13 +42,17 @@ public class PMController {
@RequestMapping("/pm/inbox")
public String doGetInbox(ModelMap context) {
User visitor = UserUtils.getCurrentUser();
+
String title = "PM: Inbox";
List<Message> msgs = pmQueriesService.getLastPMInbox(visitor.getUid());
+
msgs.forEach(m -> m.setText(MessageUtils.formatMessage(m.getText())));
+
context.put("title", title);
context.put("visitor", visitor);
context.put("msgs", msgs);
context.put("tags", tagService.getPopularTags());
+
return "views/pm_inbox";
}