您的位置:首页 > Web前端

liferay namespace用法

2014-11-30 00:55 190 查看
在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/
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: