java文件
- import com.opensymphony.xwork2.ActionSupport;
-
- public class StrutsDemo extends ActionSupport {
-
- private static final long serialVersionUID = 1L;
-
- private String message;
-
- public String getMessage(){
- return message;
- }
- public void setMessage(String message){
- this.message=message;
- }
- public String view() throws Exception {
- message = "hello Struts2 View Portlet!";
- return SUCCESS;
- }
- public String portletView(){
- return "view";
- }
- public String edit() throws Exception {
- message = "hello Struts2 Edit Portlet!";
- return SUCCESS;
- }
- public String portletEdit(){
- return "edit";
- }
- }
strutsDemoView/view.jsp
- <%@ page contentType="text/html;charset=utf-8"%>
- <%@ taglib prefix="s" uri="/struts-tags"%>
- <h2><s:property value="message"/></h2>
- <s:form action="portletView!portletView.action" method="post" namespace="view">
- <s:textfield label="名字" key="message"></s:textfield>
- <s:submit value="提交"></s:submit>
- </s:form>
其他的JSP不写了,和普通的Strtus2开发一样
分享到:
相关推荐
liferay-portal-sql-6.1.1-ce-ga2-20120731132656558
liferay portal比较完整的学习资料,供大家学习
liferay-portal-src-6.0.6-20110225.part2
内容如下: Portal介绍 Liferay Portal6安装及简单设置 Liferay IDE的安装使用 Liferay开发模式介绍 Struts Portlet开发示例 使用Struts2开发Portlet
Liferay Spring Portlet MVC 使用 Maven 的 Liferay Spring Portlet MVC 项目模板。 Liferay EE 6.2.10.11 (GA1, SP... $ cp target/liferay-spring-mvc-portlet.war $LIFERAY_HOME/deploy/ 配置 默认设置为 Liferay
中文英文的liferay-portlet-development-guide;主要是里面有中文翻译好的,免去你翻译的烦恼。
liferay-portal-tomcat-5.5-5.1.1.part2.rar
liferay-portal-doc-6.0.6-20110225.part2
LifeRay_Portal_6学习笔记6使用Struts2开发Portlet.
liferay-portal-src-6.0.6-20110225.part1
liferay-portal-doc-6.0.6-20110225.part1
liferay_使用struts2开发portlet
liferay-portal-tomcat-5.5-5.1.1.part1.rar
liferay-portal-sql-6.1.2-ce-ga3-20130816114619181.zip包,移植liferay建库需要用到
liferay-portal-sql-oracle-10-5.2.3.dmp
liferay-portal-tomcat-5.5-5.1.1.part4.rar
liferay-portal-tomcat-5.5-5.1.1.part3.rar
liferay-plugins-sdk-6.1.1-20130816114619181.zip是liferay开发中不可缺少的文件,还有src文件,liferay-eclipse等
liferay-portal-src-6.0.6-20110225.part3
liferay-portal-src-6.0.6-20110225.part5