Skip to content

Commit

Permalink
Merge pull request #303 from ArcBees/mi_gwtpSpringSimplify
Browse files Browse the repository at this point in the history
Spring GWTP-Dispatch secure action simplify configuration, by providing a default value for cookieName.
  • Loading branch information
branflake2267 committed Aug 13, 2013
2 parents 00b9c88 + fed523f commit 3d79fae
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;

import com.gwtplatform.dispatch.server.Dispatch;
import com.gwtplatform.dispatch.server.actionhandlervalidator.ActionHandlerValidatorRegistry;
Expand Down Expand Up @@ -79,6 +80,11 @@ public ActionHandlerValidatorRegistry getActionHandlerValidatorRegistry() {
return instance;
}

@Bean
public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
return new PropertySourcesPlaceholderConfigurer();
}

@Bean
public Dispatch getDispatch() {
Dispatch instance = SpringUtils.getOrCreate(context, dispatchClass);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.web.HttpRequestHandler;
import org.springframework.web.context.ServletContextAware;
Expand All @@ -41,7 +42,7 @@ public class DispatchServiceImpl extends AbstractDispatchServiceImpl implements

private static final long serialVersionUID = 136176741488585959L;

@Autowired(required = false)
@Value("${securityCookieName:JSESSIONID}")
protected String securityCookieName;

private ServletContext servletContext;
Expand All @@ -57,10 +58,6 @@ public String getSecurityCookieName() {
return securityCookieName;
}

public void setSecurityCookieName(String securityCookieName) {
this.securityCookieName = securityCookieName;
}

@Override
public void handleRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
Expand Down

0 comments on commit 3d79fae

Please sign in to comment.