In this step, you first create a Portlet from the new page flow and then edit the login form.
<tr class="tablebody">
<td>Username:</td>
<td>
<netui:textBox dataSource="{actionForm.username}"/>
</td>
</tr>
<tr class="tablebody">
<td>Password:</td>
<td>
<netui:textBox dataSource="{actionForm.password}" password="true"/>
</td>
</tr>
<% if (request.getRemoteUser() != null) { %>
<BR>you are logged in as: <%=request.getRemoteUser()%>
<br>
<%
}
else
{
%>
<BR>you are not logged in
<%
}
%>
The index.jsp should read as follows, with the inserted code shown in red:
<%@ page language="java" contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="netui-tags-databinding.tld" prefix="netui-data"%>
<%@ taglib uri="netui-tags-html.tld" prefix="netui"%>
<%@ taglib uri="netui-tags-template.tld" prefix="netui-template"%>
<netui-template:template templatePage="/resources/jsp/template.jsp">
<netui-template:setAttribute value="Index" name="title"/>
<netui-template:section name="bodySection">
<p class="pagehead">
Page Flow: yyyFlow
</p>
<table width="100%" cellpadding="0" class="tablebody" cellspacing="0">
<tr>
<td valign="top">
<table width="100%" class="tablebody">
<tr class="tablehead">
<td>Actions With No Parameters</td>
</tr>
</table>
</td>
<td valign="top">
<table width="100%" class="tablebody">
<tr class="tablehead">
<td>Input Forms For Actions With Parameters</td>
</tr>
<tr>
<td>
<netui:anchor action="loginLink">
login
</netui:anchor>
<netui:form action="logout">
<netui:button type="submit" value="logout" action="logout"></netui:button>
</netui:form>
</td>
</tr>
</table>
<br/>
<br/>
</td>
</tr>
<tr class="tablehead">
<td align="left" colspan="2">
Results Area
</td>
</tr>
</table>
<br/>
<%Object res = request.getAttribute ( "results" );%><%=(res == null ? "<i>none</i><br/>" : ( res + "<br/>"))%>
<% if (request.getRemoteUser() != null) { %>
<BR>you are logged in as: <%=request.getRemoteUser()%>
<br>
<%
}
else
{
%>
<BR>you are not logged in
<%
}
%>
</netui-template:section>
</netui-template:template>