Note that there are some explanatory texts on larger screens.

plurals
  1. PODifficulty adding a new view to a Roo-generated project
    text
    copied!<p>I'm trying to add my custom view and controller to a VERY basic roo-generated project.</p> <p>By using Spring Tool Suite (STS, Spring 3.1) I created a new project and then ran the following 3 commands:</p> <pre><code> persistence setup --database MYSQL --provider HIBERNATE --userName *** --password *** --databaseName *** entity jpa --class com.demoing.domain.Customer --testAutomatically field string --fieldName firstName --notNull field string --fieldName lastName --notNull controller scaffold --class com.demoing.controller.CustomerController --entity com.demoing.domain.Customer </code></pre> <p>After generating these, the application can be started on the server.</p> <p>However, when I add a new .jspx file (Like home.jspx) the application says "Resource not found" when going to the specific link. I added to jspx next to other views in src/main/webapp/WEB-INF/views/home.jspx</p> <p>I've added the view's definition in views.xml and manually created a controller as seen below:</p> <pre><code>package com.demoing.domain; import javax.servlet.http.HttpServletRequest; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; @Controller @Scope(value = "session") @RequestMapping("/home") public class HomeController { @RequestMapping(produces="text/html") public String home(HttpServletRequest request, Model uiModel ){ return "home"; } } </code></pre> <p>And the views definition:</p> <pre><code> &lt;definition name="home" extends="public"&gt; &lt;put-attribute name="body" value="/WEB-INF/views/home.jspx" /&gt; &lt;/definition&gt; </code></pre> <p>All I want is to display a completely new, empty page. However when I go to "project/home" it says "resource not found".</p> <p>I really don't understand what I'm missing and I hope someone with a bit more experience with these things can help me out.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload