zyro23 / grails-spring-websocket

93 stars 28 forks source link

Conflict with URL Mapping #43

Closed lsauwen closed 7 years ago

lsauwen commented 7 years ago

Hello, when i use " ** " in url mappings (to accept slash and url like blog) the stocks.js show this error code in the console log: "VM7751:1 Uncaught SyntaxError: Unexpected token < in JSON at position 0"

when i remove the " ** " all works fine.

the project avaliable in https://github.com/lsauwen/justpad

thanks

zyro23 commented 7 years ago

i guess the url-mapping ** catches the stomp endpoint (i.e. /stomp/info) as well. then that results in grails rendering a 404 page that starts with <. hence, your js error.

try excluding the stomp endpoint(s) from the urlmappings:

class UrlMappings {
    static excludes = ["/stomp/**"]
    static mappings = {
        …
    }
}
lsauwen commented 7 years ago

when excludes stomp worked perfectly.

thank you

lsauwen commented 7 years ago

It was not a bug but a configuration issue in my project