Thursday, February 28, 2013

Struts2+Liferay Service Builder +JqGrid Liferay portlet

Struts2+Liferay Service Builder +JqGrid   Liferay portlet

Create liferay portlet using Struts2, struts jqGrid   and Liferay Service builder.
Before read this article we need to have good understanding in spring frame work struts framework and hibernate and have knowledge on annotation.

The following are the reference links to get knowledge.

Here Struts is used as controllers and liferay service layer  for persistence logic.
Steps to run port let.
1.     Take the portlet from following location.

2.     Place portlet into your plugins/portlets directory
3.     If you are use Eclipse ide create portle as existing source.
5.     Run ant build-service and ant deploy commands
6.     See in samples category
7.     Drag and drop into page and add the user using UI.
8.     And Users View users screens.
Screen shots: 



Note: This portlet done in liferay 6.0.6 version.
IF you want run this in liferay 6.1 version first create one mvc port let thorough the Liferay IDE and copy manually all files to newly created one.
Please make sure dtd version of liferay xml files.
For liferay xml  xml files copy content to respective xml files then there no effect in dtd files of liferay.


  1. i create another package with your portlet, i call it myportlet, i allready named the nameSpace and else . so far so good. done with strut.xml action

    but i confuse why my return string wont show ( )
    the result went to the jsp i set ( i made a condition success and error .

    her my class package com.lkpp.pusdatin.action;

    import org.apache.struts2.dispatcher.DefaultActionSupport;

    public class helloword extends DefaultActionSupport {

    private static final long serialVersionUID = 2352134545L;

    private String message;

    private String name;

    public String execute() {
    if ("admin")) {
    setMessage("Hello" + getName() );
    return "SUCCESS";
    } else {
    return "ERROR";


    public String getMessage() {
    return message;

    public void setMessage(String message) {
    this.message = message;

    public String getName() {
    return name;

    public void setName(String name) { = name;

    i need your help


    Arif Rahman

  2. Hi, why message errors does'nt show up!!!

  3. Hi,good job.
    but i do need your help for struts2 validations. it's not working for me ! can u help me


Recent Posts

Recent Posts Widget

Popular Posts