liferay namespace用法

来源:互联网 发布:网页版淘宝 编辑:程序博客网 时间:2024/06/10 19:09

在Jsp页面代码如下: 


<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %><portlet:defineObjects />This is the <b>Namespace</b> portlet in View mode.<form name="userInfoForm">      username : <input id= "<portlet:namespace/>username" name="<portlet:namespace/>usernameusername"  type="text" > </br>      <input type="button" onclick="<portlet:namespace/>submit()" value="submit">     </form><script>     function  <portlet:namespace/>submit(){      var  username = document.getElementById("<portlet:namespace/>username").value     alert("username = " + username);     }</script>


对应页面如



采用namespace (见上面代码) 后,当点击 Namespace portlet的submit能得到相应的username值(见上面图片),比如username = 9/8/


0 0