Need to understand Struts Framework

Greetings everyone,

I am trying to understand how the entire Struts Framework works.

If I am running tomcat, is copying and pasting the WAR file into webapps directory the only way to install struts?

Since I am new to struts and was trying to understand how it works from ground up, I tried creating the neccessary files needed and copied the struts.jar into my web app's WEB-INF\lib folder.

Unfortunately, I kept on hitting errors.

Here is my app directory structure

1) MyApp/

- index.jsp

- displayname.jsp

2) WEB-INF/

- struts-config.xml

- struts-html.tld

- web.xml

3) WEB-INF/classes/example/

- NameAction.class

- NameForm.class

4) WEB-INF/lib/

- servlet-api.jar

- struts.jar

I am getting this error:

HTTP Status 404 - /StrutsActionForm/index.jsp

--

type Status report

message /StrutsActionForm/index.jsp

description The requested resource (/StrutsActionForm/index.jsp) is not available.

--

Apache Tomcat/5.5.20

I know it sounds silly but that's the only way I can truly understand the entire struts framework.

Your reply will be much appreciated.

[1227 byte] By [JavaNutCasea] at [2007-11-26 21:12:26]
# 1

If you specify the appBase of your application in Tomcat's server.xml ,

or define a <Context>.xml and point the docBase to where ever your code's main directory is, you won't hae to create a WAR file and place it under WEB-INF each time you make any change.

This saves a lot of time and effort in the development envionment, especially when you make a change to JSP pages - you can just refresh the browser to see the changes instead of creating a WAR file just to see changes in JSPs.

Create a WAR file only when you are deploying your application to production / live website - a WAR file is not necessary in dev environment.

With the above set-up your project can be located outside and independent of Tomcat, as long as the appBase or docBase are pointing to the location of your project.

For tomcat related questions join the Tomcat User Mailing List

and for struts question Struts User Mailing List

appy77a at 2007-7-10 2:50:16 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...