我正在尝试从同一页面上的挂钩中检索帖子值,因此当我的值正确时,会出现内容。
我在钩子中添加了这段代码以将其放在指定的页面上。
<portlet:actionURL secure="<%= PropsValues.COMPANY_SECURITY_AUTH_REQUIRES_HTTPS || request.isSecure() %>" var="SecondloginURL">
<portlet:param name="saveLastPath" value="0" />
<portlet:param name="struts_action" value="/journal_content/view" />
</portlet:actionURL>
<aui:form action="" name="auth" method="POST">
<aui:input label="Second Password" type="password" name="password" />
<aui:button type="submit" value="authenticate" />
</aui:form>
我设法检索了该值,但是当它经过验证的会话开始时,它不会跨页移动。
这是代码:
<% String pass = request.getParameter("password"); %>
<c:if test="<%= pass.equals(\"1234\") %>">
<%
HttpSession session1 = request.getSession();
session1.setAttribute("pass","authenticated");
String foo = (String) session1.getAttribute("pass");
out.println(foo);
%>
<h2>this is the second password and it's working</h2>
<div class="journal-content-article" id="article_<%= articleDisplay.getCompanyId() %>_<%= articleDisplay.getGroupId() %>_<%= articleDisplay.getArticleId() %>_<%= articleDisplay.getVersion() %>">
<%= RuntimePortletUtil.processXML(application, request, response, renderRequest, renderResponse, articleDisplay.getContent()) %>
</div>
</c:if>