In the following steps, you create the index.jsp
page, which will be the default starting page for the application. The page does not include any display elements, and simply forwards the user to the application login page, login.jsp
. To do this you use the jsp:forward
tag. A jsp:forward
tag runs on JSP pages that handle queries and forms, to forward to either the same JSP page again, or another JSP page.
Create a new JSP page and call it index.jsp
.
For the sample application, we will not add any text to this page. From the JSP page of the Component Palette, drag Forward to include a jsp:forward
tag in the page.
In the Insert Forward dialog box for the forward
tag, enter login.jsp
as the Page.
You can now specify this new page as the default target for the application as follows:
index.jsp
page you just created and click OK. Then click OK again to close the dialog box.You can now run your application by right-clicking in the View project and select Run from the shortcut menu. When the application launches, it first runs index.jsp
, which has been set as the default launch target for the application. The index.jsp
forwards you directly to the login page, login.jsp
, which is displayed in your browser.