问题描述
我正在使用Liferay Portal 6版本.如何在同一页面上获取UserName和Password值?
I am using Liferay Portal 6 version.How can I get the UserName and Password values with in the same page?
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@page import="javax.portlet.RenderRequest"%>
<portlet:defineObjects />
This is the <b>Kiran</b> portlet.
<form>
<p><b>UserName:</b> <input type="text" name="UserName" size="10"></p>
<p><b>Password:</b> <input type="Password" name="Password"
size="10"></p>
<p><input type="submit" value="Submit" name="submit"><input type=
"reset" value="Reset" name="reset"></p><hr><hr>
</form>
<%
// here
%>
推荐答案
我不确定它是否正确提交值,因为您的表单没有目标,也没有引用portlet操作url.
I'm not sure if its submitting the values correctly as your form has no target and is not refering to a portlet action url.
此教程显示了一些内容基本用法和参数检索.检查"JSP Portlet"部分.您还应该能够在jsp中访问请求对象.
This tutorial shows some basic usage and parameter retrieval. Check the JSP portlet section. You should be able to access the request object in your jsp as well.
我不会开始编写JSP portlet.如今,它已经过时了.检查 Spring Portlet MVC 或甚至考虑使用JSF.
I wouldn't start writing JSP portlets. Its quite outdated nowadays. Check Spring Portlet MVC or even consider JSF.
这篇关于如何获取从Liferay中的JSP提交的值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!