JQuery / Thymeleaf: overwriting submit action

Viewed 281

I work in a Spring Boot application, where I have this property defined in the application.properties

server.contextPath=/NoEnTenimNiCinc

I want to overwrite the submit action in a Thymeleaf template, but I don't know how to set the context path

$('#geocodingButtonId').click(function(){       
        $('#deviceFormId').attr('action', /*[[@{/}]]*/ '/device/search');
}); 

I also tried

$('#geocodingButtonId').click(function(){       
     $('#deviceFormId').attr('action','/device/search');
}); 

I want the app to go

http://localhost:8080/NoEnTenimNiCinc/device/search/

but instead the apps goes to

http://localhost:8080/device/search/
2 Answers
Related