目前,所有JSP都位于src/main/resources/META-INF/resources
文件夹,该文件夹充当上下文根文件夹。要明确区分Guestbook portlet 和 the Guestbook Admin portlet,必须将视图层的文件放在不同文件夹:
- 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.
当修改视图层以使用新的后端时,必须更新对旧路径的引用。另外,必须在 component properties中更新资源位置。下一步,将修改所有这些属性。