Home > JAVA, Ubuntu Geek > Stripes Framework (IntelliJ IDEA 9.04) : Calculator Example as the new project

Stripes Framework (IntelliJ IDEA 9.04) : Calculator Example as the new project

Project is described on the Stripes main site  as the Beginner guide.  I’m using IntelliJ as my IDE for such applications. Here are steps how to avoid to common mistakes in web.xml setup.

What I have:

  1. IntelliJ IDEA 9.04
  2. Apache Tomcat 6.0.29
  3. Stripes 1.5.4

Create new project from scratch ( example “StripesExample” ).  You obtain project directory structure.  I’ll go from the top of this structure and add or change appropriate files inside. Before we start just do import of all Stripes and other necessary libraries for this example (commons-logging.jar, cos.jar, jstl.jar, log4j-1.2.15.jar, mail.jar,standard.jar, stripes.jar). Don’t forget  libraries are located in /WEB-INF/lib directory.

1. create new package inside “src” directory  (example: “examples.stripes“)
2. in this directory create new “CalculatorActionBean.java” and copy the source code. Don’t forget to change package name !
3. time to configure *.properties files (commons-logging.properties, log4j.properties, StripesResources.properties) . You can follow the manual. These files are located in “/WEB-INF/classes” directory
4. web.xml file configuration. It seems to be key to run the example properly.  If you have followed me  only do change in web.xml :

….
<filter>
<display-name>Stripes Filter</display-name>
<filter-name>StripesFilter</filter-name>
<filter-class>net.sourceforge.stripes.controller.StripesFilter</filter-class>
<init-param>
<param-name>ActionResolver.Packages</param-name>
<param-value>examples.stripes</param-value>
</init-param>
</filter>
……

Now should be everything ready to deploy on Tomcat server directly from IDE…

About these ads
Categories: JAVA, Ubuntu Geek
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: