在同一个文件夹view.jsp中,创建edit_entry.jsp文件:
- 右键单击
src/main/resources/META-INF/resources文件夹,然后选择 New → File。 - 命名该文件为
edit_entry.jsp,并单击完成。 - 将此行添加到文件的顶部:
<%@ include file="init.jsp" %>Remember, it’s a best practice to add all JSP imports and tag library declarations to a single file that’s imported by your application’s other JSP files. For
edit_entry.jsp, you need these imports to access the portlet tags that create URLs and the Alloy tags that create the form. - 您将创建两个URL:一个提交表单,另一个返回
view.jsp。创建返回网址,请在view.jsp刚才添加的第一行下面再添加以下代码:<portlet:renderURL var="viewURL"> <portlet:param name="mvcPath" value="/view.jsp"></portlet:param> </portlet:renderURL>
接下来,创建一个提交表单的URL。
本文介绍如何在Maven项目的resources文件夹下创建edit_entry.jsp文件,并实现与view.jsp页面之间的跳转。通过设置portlet和Alloy标签来创建返回和提交表单的URL。
450

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



