Announcement Announcement Module
No announcement yet.
spring data rest Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • wims.tijd
    started a topic spring data rest

    spring data rest

    1) i am not getting any rest events with an applicationlistener on RepositoryEvent,
    2) could not get a reference to RepositoryRestHandlerMapping either :
    i want to hook in an HandlerInterceptorAdapter or PermissionEvaluator
    - how get hold of the applicatontext in which the exporter is running ?

    3) could restrict http method access with :

    <security:intercept-url pattern="/hateoas/*" method="GET"/>
    		<security:intercept-url pattern="/hateoas/*" method="POST" access="hasRole('ROLE_POST_ALLOWED')"/>
    		<security:intercept-url pattern="/hateoas/*" method="PUT" access="hasRole('ROLE_PUT_ALLOWED')"/>
    		<security:intercept-url pattern="/hateoas/*" method="DELETE" access="hasRole('ROLE_DELETE_ALLOWED')"/>

  • wims.tijd
    okay , i got an interceptor with
    			<mvc:mapping path="/**"/>
    			<bean class="RepositoryHandlerInterceptor"
    public class RepositoryHandlerInterceptor extends HandlerInterceptorAdapter {
    	Logger logger = LoggerFactory.getLogger(getClass());
    	public boolean preHandle(HttpServletRequest request,
    			HttpServletResponse response, Object handler) throws Exception {
   "{}", request);
    		return super.preHandle(request, response, handler);
    	public void postHandle(HttpServletRequest request,
    			HttpServletResponse response, Object handler,
    			ModelAndView modelAndView) throws Exception {"{}", response);
    		super.postHandle(request, response, handler, modelAndView);
    	public void afterCompletion(HttpServletRequest request,
    			HttpServletResponse response, Object handler, Exception ex)
    			throws Exception {"{}", response);
    		super.afterCompletion(request, response, handler, ex);
    preHandle shows but neither postHandle nor afterCompletion,
    Last edited by wims.tijd; Oct 23rd, 2012, 03:00 AM.

    Leave a comment:

  • Marten Deinum
    Could you be a bit more expressive? Not much to go on nor on what you want.

    You have 2 servlets and you cannot access the ApplicationContext from servlet 1 in servlet 2 and vice versa... The same goes for events they are only intercepted/handled in the context they occur and the parent not in other contexts which don't know eachother.

    Leave a comment: