6.2.0 版本 form 表单中的 namespace 使用

阅读更多
写一个不使用 aui 标签的 form 表单提交数据
代码如下 :




在liferay 6.2 之前的版本中,在 portlet-class 内如果想获取数据:
public void processAction(ActionRequest request, ActionResponse response)  
     throws PortletException, IOException {  
          String email = request.getParameter("email");  
          System.out.println(email);  
}  


这么实现是好使的,但是在版本6.2.0使用会出现无法获取的问题。是因为在6.2.0之后,Liferay为避免属性冲突,默认需要用户添加
所以必须修改 form 表单为:




当然这是默认情况,如果一定不想使用 的话,Liferay也不会难为开发者。
6.2.0 之后,portlet 对应的 liferay-portlet.xml 中, 内有一个新element, , 默认情况下是true,为强制要求namespace,改为false则不要求。
代码如下:

test  
           /icon.png  
           false  
           false  
           /css/main.css  
             
                 /js/main.js  
             
           test-portlet  
      

你可能感兴趣的:(liferay,namespace)