Developing Your First Portlet
Step 4 of 8
In the same folder your
view.jsp is in, create the
Right-click your project’s
src/main/resources/META-INF/resourcesfolder and choose New → File.
Name the file
edit_entry.jspand click Finish.
Add this line to the top of the file:
<%@ 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.
You’ll create two URLs: one to submit the form and one to go back to the
view.jsp. To create the URL to go back to
view.jsp, add the following tag below the first line you added:
<portlet:renderURL var="viewURL"> <portlet:param name="mvcPath" value="/view.jsp"></portlet:param> </portlet:renderURL>
Next, you must create a new URL for submitting the form. Before you do, you must learn about portlet actions.