Struts WAR Tutorial covering Database Operations, Validation and Permissions

1-action-forward - Contains the basic files needed to display a JSP. Describes key aspects of the core files.

2-tiles - Covers tiles, adding the portlet to a category and internationalization.

3-render - Add an action class, the render method and a renderURL

4-processAction - Add processAction and validation

5-service-builder - Covers Liferay's Service Builder, adding business logic and adding an entry to the database. The SQL required to create the table is provided with the source code.

6-update-delete - Add update/delete methods and the Action menu button

7. Permissions - Coming Soon!

 

Tutorials and source code are available at the top of the page. Comments/Questions? Feedback is welcome! http://www.liferay.com/web/guest/community/forums/message_boards/message/473735

This tutorial covers how to develop a struts war that performs the basic add, update and delete operations. The first step to learning something new is to strip out any unnecessary components until you're left with just the basic functionality. You'll end up breaking things along the way, but you'll have a very good idea of how everything works at the end.

I started off with the sample-struts-liferay-portlet.war, and stripped out all unnecessary functionality until I was left with a portlet that could only display a JSP. The original sample-struts-liferay-portlet.war is available here:
http://www.liferay.com/web/guest/downloads/official_plugins

In order to deploy the files, you'll need to download the Liferay Plugins SDK located here:
http://www.liferay.com/web/guest/downloads/additional

And one of the Liferay Tomcat bundles here:
http://www.liferay.com/web/guest/downloads/portal
(If you don't know which one to use, get the Recommended Download.)

You'll also need to create a build.${user.name}.properties that points to your server.
For example, I have a build.ed.properties file with the following entry:
app.server.dir=D:/tomcat
(If you don't know how to do this, ask in our forums for some additional help.)

One thing to note is that the examples will only work on tomcat because they use the PortalClassLoader. However, the key concepts like internationalization, page flow, validation, database operations (Service Builder) and permissions will be the same. After you go through this tutorial, you will be able to port the same concepts to the sample-struts-portlet.war which uses the Apache Struts Bridge or any other framework including JSF or Spring.

3
Blogs
It's very useful for understanding struts portlet! What will be explained in the part 2?
I was originally going to post newly created tutorials to part 2, but I ended up posting all my updates to this blog post. The permissions tutorial will be the last update to this set of tutorials. If you don't mind, please post some feedback in the forums to give the tutorials some more exposure. Thanks!
Looks great. I tossed a link into the Roadmap for New Developers wiki article:
http://wiki.liferay.com/index.php/Roadmap_for_new_developers#Setting_up_a_development_environment