File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes What do I need for Struts? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "What do I need for Struts?" Watch "What do I need for Struts?" New topic

What do I need for Struts?

Joshua Jones

Joined: Aug 30, 2011
Posts: 11
I have a java application with classes ready to serve as a model, but I don't really know how I can fit the JSP's and ?actionfor/beanS? together to make a proper struts application

Basically could someone list the things I need for everything to work. and also could someone explain how the struts-config, and web.xml files work I really am lost. using Struts 1 btw but any library is fine I just need someone to start me off so I can integrate my java classes with some forms on a few jsp's and run it all in tomcat6 thanks.
Shinil Mohan
Ranch Hand

Joined: Aug 24, 2011
Posts: 37

You may first need to decide on which version you need to use Struts 1 or Struts 2. Then you need to download the jar files accordingly.

You can download the latest version of Struts from the apache site

Few samples are available in the below tutorial link
Jimmy Clark
Ranch Hand

Joined: Apr 16, 2008
Posts: 2187
To get everything to work, you would need the following:

1. Learn how to use the Struts Frameworks to build the web components of an application, i.e. View and Controller.

2. Get a copy of the Struts class library

3. Get a copy of a Java Web server

In regards to struts-config.xml, the Struts Framework defines an XML-based markup language for
describing configuration data. This data is needed to configure the application's Controller and
add your specific Controller behavior, i.e. actions. In order to create an instance of a struts-
document, you first need to learn the elements and attributes of the language. And
then you need to learn the objects which are created with the configuration data and how they work,
what they do, etc.

In regards to web.xml, the Java Servlet Framework defines an XML-based markup language for
describing configuration data. This data is used to configure a Java Web server so that
it can serve your web application. Here again, you need to learn the language, the elements and
attributes in order to create a web-app document.

Good luck and Welcome to the JavaRanch - A Friendly Place for Java Greenhorns!
Joe Ess

Joined: Oct 29, 2001
Posts: 9189

Joshua Jones wrote:using Struts 1

Unless you have a compelling reason to use Struts 1 (i.e. you are maintaining an existing application) I would strongly recommend you use Struts 2. Struts 1 has several intractable problems that make it much less useful than the current generation of framework (to include Stripes, Spring, Wicket, et al).
That said, we have a FAQ for whichever version of Struts you choose. Spend some time with one of the tutorials or books. You'll find that's a better use of your time than trying to shoehorn your current app into the framework and coming to the forum every time you hit a wall.

[How To Ask Questions On JavaRanch]
I agree. Here's the link:
subject: What do I need for Struts?
It's not a secret anymore!