最近在单位要求研究portlet,本人菜鸟水平,查了许多文档,整了很多天,终于有了一点效果,出来晒晒:
1,首先下载http://mirror.bjtu.edu.cn/apache//portals/jetspeed-2/binaries/jetspeed-installer-2.2.1.jar
不出意外是78.8M,如果你装了JDK1.6直接双击jar包就可以安装。最好放到磁盘根目录下再双击,否则路径中有中文会乱码。我没使用的是默认数据库derby。
2,安装成功后,记得配置环境变量JAVHOME,然后再到C:\Apache\jetspeed2\bin目录下双击start.bat,启动tomcat
3,安装MyEclipse8.6,以这个版本支持portlet功能。
4,新键一webproject
右键(project)——〉MyEclipse——〉add portlet capbility
5,新建packge:com.ldq.test,新建portlet Class
右键(com.ldq.test)——〉new——〉Other——〉portlet
Name:MyTestPortlet
Extends:GenericPortlet
勾选edit,view,help
Next,finish;
6,修改portlet.xml
一定要给新建的portlet一个id
<portlet id=”mytestportlet”>
最好在<portlet-info>中添加一个〈key-words〉mytest〈/ key-words〉
7,将这个项目部署成*.war,如mytest.war
将mytest.war剪切到C:\Apache\jetspeed2\webapp\jetspeed\WEB-INF\deploy
8,这时,jetspeed会自动部署(先拷贝到webaapp下再解压缩),我们只需要登陆到
http://localhost:8080然后以admin/admin登陆系统
9,在主页右上角会看到jetspeed的tool;输入〈key-words〉中的关键字mytest搜索
我们的portlet就被列出来了,单击Add ,这个portlet就被加到页面中了
剩下的就是修改jsp,处理业务逻辑,访问数据库了。
比如:processAction,render,doEdit,doView等等
本人对jetSpeed部署到jboss还没搞懂,望各位大拿指点小弟:
QQ:582519230
Email:lideqina999@163.com