Refactoring the Prototype
Step 1 of 6
Currently, all your JSPs sit in your web module’s
src/main/resources/META-INF/resources
folder, which serves as the context root
folder. To make a clear separation between the Guestbook portlet and the
Guestbook Admin portlet, you must place the files that make up their view layers
in separate folders:
-
In the
guestbook-web
project, right click thesrc/main/resources/META-INF/resources
folder and select New → Folder. Name the new folderguestbookwebportlet
and click Finish. -
Copy
view.jsp
andedit_entry.jsp
into the new folder by dragging and dropping them there. -
Open both files and change the
init.jsp
location at the top of the file:<%@include file="../init.jsp"%>
-
Check the other references to JSPs within the files to make sure that they point to the new locations.
As you update your view layer to take full advantage of the new back-end, you’ll update any references to the old paths. In addition, you must update the resource location in your component properties. In the next step, you’ll update all of those properties, including the one that defines the resource location.