I have the following code:
@RestController
public class RestTmp {
@Autowired
SchemasService schemasService;
@RequestMapping(path = "/editSchema/{id}")
public void editSchemaById(Model model, @PathVariable("id") Integer id, HttpServletResponse response) throws IOException {
String schemaERD = schemasService.editUser(id);
model.addAttribute("message", schemaERD);
response.sendRedirect("/drawdiagram");
}
}
Can anyone tell me how i can get value from that variable "message" now?
I need to handle that value in my "/drawdiagram" ---> (drawdiagram.html)
I tried with thymeleaf something like that:
<script th:inline="javascript">
/*<![CDATA[*/
var message = /*[[${message}]]*/ 'default';
console.log(message);
/*]]>*/
</script>
but i am getting null all the time ... Can someone help me? :(