• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What do I need for Struts?

 
Joshua Jones
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 37
Hibernate Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

http://struts.apache.org/download.cgi

Few samples are available in the below tutorial link
http://www.vaannila.com/struts-2/struts-2-tutorial/struts-2-tutorial.html
 
Jimmy Clark
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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-
config
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
Bartender
Pie
Posts: 9266
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic