liferay portlet默认的显示页面是view.jsp,虽然可以在jsp中用include标签包括html文件,但是如何直接通过修改配置文件让默认的显示页面为view.html呢?

1.用Liferay IDE建一个mvc-portlet,打开其中的java代码,把@Component内容改成如下所示

@Component(
     immediate = true,
     property = {
         "com.liferay.portlet.display-category=category.sample",
         "com.liferay.portlet.instanceable=true",
         "javax.portlet.display-name=test Portlet",
         "javax.portlet.init-param.template-path=/",
         "javax.portlet.init-param.view-template=/view.html",
        "javax.portlet.init-param.valid-paths=/view.html",
        "javax.portlet.resource-bundle=content.Language",
       "javax.portlet.security-role-ref=power-user,user"
   },
    service = Portlet.class
)
public class TestPortlet extends MVCPortlet {       
}

就是这个样纸啦

 

相关文章:

  • 2021-12-17
  • 2022-12-23
  • 2021-08-30
  • 2022-12-23
  • 2021-11-23
  • 2022-12-23
  • 2022-01-03
  • 2022-12-23
猜你喜欢
  • 2021-12-02
  • 2021-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案