O'Reilly logo

GateIn Cookbook by Piergiorgio Lucidi, Luca Stancapiano, Ken Finnigan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using an action to pass form parameters

This recipe will extend the portlet created in the previous recipe by adding a form for the user to enter their name, and then responding with a welcome message that includes their name.

Getting ready

The following are required for this recipe:

  • Apache Maven
  • An IDE of your choice
  • GateIn-3.2.0.Final
  • HelloWorldPortlet project from the Creating a portlet with the Portlet 2.0 Specification recipe

How to do it...

Passing form parameters and acting on that input involves the following:

  1. Create welcome.jsp in the src/main/webapp folder of the project.
  2. Add the following to welcome.jsp:
    <%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %> <div class="portlet-section-header">Welcome to the HelloWorld portlet</div> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required