• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Help with Setting up Environment

 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I am a newbie to Struts. So, can anyone please help me with setting up the environment.

I steps I followed are as follows:

1) Uncompress the zip file of the binaries
2) Placed the lib directory in C:\Tomcat 4.1\webapps\examples\WEB-INF
3) Created a web.xml in C:\Tomcat 4.1\webapps\examples\WEB-INF
The contents of web.xml are :
[
CODE] <?xml version = "1.0" encoding = "ISO-8859-1" ?>
<!DOCTYPE web-app
PUBLIC "-//Sun Micro Systems Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/j2ee/dtds/web_app_2_3.dtd">

<web-app>
<taglib>
<taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-html.tld</taglib-location>
</taglib>
</web-app> [/CODE]

4) Created struts-config.xml in C:\Tomcat 4.1\webapps\examples\WEB-INF directory.

The contents of it are:

[code] <?xml version = "1.0" encoding = "ISO-8859-1" ?>
<!DOCTYPE web-app
PUBLIC "-//Sun Micro Systems Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/j2ee/dtds/web_app_2_3.dtd">

<struts-config>
</struts-config> [/code]

5) I also placed struts-html.tld in the same directory C:\Tomcat 4.1\webapps\examples\WEB-INF.

Please let me know if there is anything wrong or anything more that I have to do as Tomcat shuts down when I start it.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Modifying the examples web application that comes with Tomcat is not a good way to set up a new Struts application. Here's what I'd recommend.

1-Undo all the changes you made to the Tomcat Examples Web App.
2-Create a new directory called "myStrutsApp" in the Tomcat /webapps directory
3-Find the struts-blank.war file in the webapps/ directory in the material you downloaded.
4-Unzip the file into the Tomcat webapps/myStrutsApp directory that you created earlier.

That's it. You're done. You now have an empty Struts application that will run in Tomcat under the name "myStrutsApp". Everything you need has been set up for you. The next step would be to select a good tutorial from this link and work through the example.
[ August 21, 2006: Message edited by: Merrill Higginson ]
 
Ram Kas
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks. But, I have a question

Now, How do I know that it is working? I mean, what should I type in the browser to know that it is working
 
Ranch Hand
Posts: 425
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try this


http://<hostname>:8080/myStrutsApp/Welcome.do


I assume your tomcat is running on port 8080. It helps a lot if you can explor e the extracted blank application. You can start by looking at struts-config.xml and web.xml
[ August 21, 2006: Message edited by: Purushothaman Thambu ]
 
Time is mother nature's way of keeping everything from happening at once. And this is a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic