博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Liferay7 BPM门户开发之27: MVC Portlet插件工程开发
阅读量:4653 次
发布时间:2019-06-09

本文共 2083 字,大约阅读时间需要 6 分钟。

官网上的教材说实话实在精简不清晰.

版本7的Action机制换了:

上边的例子有不少java代码直接写在jsp里,感觉有点不舒服,要想想替代方法。

 

关于新建Portlet就不再赘述,只写过程。只需要简单几步,开发前先需要熟悉Gradle.

 

1、新建工程 File → New → Liferay Module Project.

如果建立了Liferay Workspace,就在Workspace上建立新Module工程

 

2、首先修改settings.gradle仓库地址:

目的是不再使用IDE建立的不可用仓库地址,红色部分删除

buildscript {

dependencies {
classpath group: "com.liferay", name: "com.liferay.gradle.plugins.workspace", version: "1.0.40"
}

repositories {

maven {
url "https://repo1.maven.org/maven2"
}
maven {
url "https://cdn.lfrs.sl/repository.liferay.com/nexus/content/groups/public"
}
}
}

 

3、在build.gradle中增加需要的引用

比如增加spring mvc 、Acitiviti的依赖包,

dependencies {compile 'com.liferay.portal:com.liferay.portal.kernel:2.0.0'compile 'com.liferay.portal:com.liferay.util.bridges:2.0.0'compile 'com.liferay.portal:com.liferay.util.taglib:2.0.0'compile 'com.liferay:com.liferay.application.list.api:1.0.0'compile 'javax.portlet:portlet-api:2.0'compile 'javax.servlet:javax.servlet-api:3.0.1'compile 'org.osgi:org.osgi.service.component.annotations:1.3.0'compileOnly group: "jstl", name: "jstl", version: "1.2"compileOnly group: "org.osgi", name: "org.osgi.compendium", version: "5.0.0"compileOnly group: "org.activiti", name: "activiti-engine", version: "5.21.0"compile 'org.springframework:spring-webmvc:4.1.6.RELEASE'compile 'org.springframework:spring-webmvc-portlet:4.1.6.RELEASE'compile 'org.springframework:spring-aop:4.1.6.RELEASE'compile 'org.springframework:spring-context:4.1.6.RELEASE'compile 'org.springframework:spring-core:4.1.6.RELEASE'compile 'org.springframework:spring-expression:4.1.6.RELEASE'compile 'org.springframework:spring-web:4.1.6.RELEASE'compile 'org.springframework:spring-beans:4.1.6.RELEASE'compile 'org.springframework:spring-jdbc:4.1.6.RELEASE'compile 'org.slf4j:slf4j-log4j12:1.7.6'compile 'org.slf4j:slf4j-api:1.7.6'}tasks.withType(JavaCompile) {options.encoding = 'UTF-8'}

 

然后,再项目右键"Gradle" >> "Refresh gradle project"

4、编译、部署,见图1

 

5、调试,Debug 〉〉 然后选一个Liferay 7.XX server

然后手动添加新建的portlet

发现liferay7的调试非常方便,无论是修改了jsp还是java文件,可以立即(大概3-5秒)重新自动部署,调试简单又快捷。

 

转载于:https://www.cnblogs.com/starcrm/p/6047478.html

你可能感兴趣的文章
想算法无头绪,咋办?
查看>>
javascript ES5写法
查看>>
含有自增字段的插入问题
查看>>
使用GDI+保存用户的绘图数据.
查看>>
github上的优秀项目和开发环境配置【转http://www.cnblogs.com/2018/archive/2012/11/09/2763119.html】...
查看>>
Unity3D研究院之2D游戏开发制作原理(二十一) 【转】
查看>>
Abiword页面布局
查看>>
HDFS的Java客户端操作代码(查看HDFS下所有的文件存储位置信息)
查看>>
第二章 Vue快速入门-- 16 vue中通过属性绑定为元素绑定style行内样式
查看>>
第四章 生命周期函数--36 结合Node手写JSONP服务器剖析JSONP原理
查看>>
一个转角--->程序猿
查看>>
CMSIS_RTOS_Tutorial自译中文版
查看>>
SimpleTag——认识自定义标签
查看>>
将url的查询参数解析成字典对象
查看>>
Redis与RabbitMQ作为消息队列的比较
查看>>
mybatis实战教程三:mybatis和springmvc整合
查看>>
Java多线程:Semaphore
查看>>
960栅格化优势
查看>>
LSP原则—关于正方形不是长方形
查看>>
Android内核开发 相关工具及源码下载汇总
查看>>