I have a question about spring roo.
How can you add a custom page to your web application? It seems really basic and easy if I’m using standard Servlet, but I’m totally confused to do this in Spring roo.
All I want to have is a link in main page (with the menus etc) that links to my custom page.
I have tried to add a new Servlet to the application, setting its path mapping to /custompage. but when I access http://localhost:8080/myapp/custompage , it shows that the resource is unavailable.
I also can’t add a link in the main page, I have tried to edit the menu.jspx directly and it fails.
Can anyone shed me light on this? Any help will be greatly appreciated.
First of all edit your
{project_root}/src/main/webapp/WEB-INF/spring/webmvc-config.xmland add newmvc:view-controllerdefinition for your new page. Something like:Then open
{project_root}/src/main/webapp/WEB-INF/views/views.xmland add the following definition:And add your
custompage.jspxto the{project_root}/src/main/webapp/WEB-INF/views/folder.And then edit
{project_root}/src/main/webapp/WEB-INF/views/menu.jspxand newmenu:itemwithurl="/custompage".I think it should work.