JAVA - Introduce Line break in request

In the example bellow the recipe description had something like:

    100ml milk\r\n10g sugar

which in html corresponded to the following textarea contents:

    100ml milk
    10g sugar

    public String submitRecipe2(Model model, @ModelAttribute Recipe recipe, HttpServletRequest request) {
        model.addAttribute("recipe", recipe.getDescription().replace("\r\n", "%0A"));
        return "result2";


Popular posts from this blog

Oracle - duplicate fields in RECORD,TABLE or argument list are not permitted

spring @async causing BeanCurrentlyInCreationException