Archive for the ‘Struts’ category

Simple Struts Example Zip File

August 23rd, 2008

Click hereto download the complete application without Jar Dependency (few KBs)
This file does not contain the jars. If you would like to download the application with the jars , » Read more: Simple Struts Example Zip File

Struts Tutorial – Eclipse Workspace Setup Video

August 23rd, 2008

After your workspace is ready, » Read more: Struts Tutorial – Eclipse Workspace Setup Video

Struts Tutorial – Eclipse Server Setup Video

August 23rd, 2008

This video helps you configure your server » Read more: Struts Tutorial – Eclipse Server Setup Video

Struts Tutorial – How to setup a workspace For Struts

August 23rd, 2008

Create a workspace with the following folder structure .
FolderStructure.JPG

(Click on the image to see enlarged image.

The image also lists the Jars needed to run struts)

Struts Tutorial – Sample Action Class

August 23rd, 2008

package com;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

» Read more: Struts Tutorial – Sample Action Class

Struts Tutorial – Sample JSP

August 23rd, 2008

<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.0 Transitional//EN”>
<html>
<head>

</head>

<body>
<p>This is my first struts example </p>
</body>
</html>

Struts Tutorial – Sample struts-config.xml

August 23rd, 2008

<?xml version=”1.0″ encoding=”ISO-8859-1″ ?>

<!DOCTYPE struts-config PUBLIC
“-//Apache Software Foundation//DTD Struts Configuration 1.2//EN”
“http://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd”>

<struts-config>

» Read more: Struts Tutorial – Sample struts-config.xml

Struts Tutorial – Sample Web.xml

August 23rd, 2008

Copy the contents below and save it in web.xml

<?xml version=”1.0″ encoding=”UTF-8″?>
<web-app id=”WebApp_ID” version=”2.4″
xmlns=”http://java.sun.com/xml/ns/j2ee”
xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”
xsi:schemaLocation=”http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd”>

» Read more: Struts Tutorial – Sample Web.xml

Struts Tutorial

August 23rd, 2008

What this tutorial will do is help you get started with a simple example of forwarding a request to a jsp.This is a practical tutorial so lets gets started .

1. Make sure you have an Application Server Installed on your system . For this demo I am using Tomcat 5.5.

2. Download Eclipse or any other IDE (This step is optional and would help in case you would like to follow the Video tutorial of Struts which would be posted in a few days. ). I am using Eclipse.

3. Sample Web.xml

4.Sample struts-config.xml

5. Sample Java Class (Action Class)

6. How to Configure your Server – Video

In case you have any other queries , please feel free to leave a comment and we would love to help you out .