目前,所有JSP都位于src/main/resources/META-INF/resources文件夹,该文件夹充当上下文根文件夹。要明确区分Guestbook portlet 和 the Guestbook Admin portlet,必须将视图层的文件放在不同文件夹:
- In the
guestbook-webproject, right click thesrc/main/resources/META-INF/resourcesfolder and select New → Folder. Name the new folderguestbookwebportletand click Finish. - Copy
view.jspandedit_entry.jspinto the new folder by dragging and dropping them there. - Open both files and change the
init.jsplocation 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中更新资源位置。下一步,将修改所有这些属性。
本文介绍如何在guestbook-web项目中对视图层文件进行重新组织,包括创建新的文件夹来存放不同的portlet视图文件,并更新文件内的路径引用。
928

被折叠的 条评论
为什么被折叠?



