• 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

Hello World in JSP/JSTL/ANT using Ant, Eclipse & Tomcat

 
Ranch Hand
Posts: 428
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does someone know of a minimal example of JSP/JSTL using tomcat and eclipse and ant? Is it necessary to create a WAR file to deploy a minimal JSP program to tomcat?

I was hoping eclipse would have a nice wizard to get me started with a minimal build.xml that would create the minimal files. I assume it is necesary to create a war file to use JSP.

Anyone know of one?

Thanks,
Siegfried
[ June 23, 2006: Message edited by: Bear Bibeault ]
 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Siegfried Heintze:
Does someone know of a minimal example of JSP/JSTL using tomcat and eclipse and ant?



What do you mena by "using Eclipse"? The choice of IDE has no impact on what goes into the code. Are you looking for a pre-built project file for Eclipse?

Is it necessary to create a WAR file to deploy a minimal JSP program to tomcat?



No.

I assume it is necesary to create a war file to use JSP.



You assume incorrectly. A war file is but one possible deployment method.
[ June 23, 2006: Message edited by: Bear Bibeault ]
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I know this isn't exactly what you're looking for but the "First App" tutorial, written by Craig R. McClanahan, on the Tomcat website, walks you through the entire process of building a web application with Tomcat (including Ant build scripts for compiling and deploying the app).
I say "not exactly what you're looking for" because it does so without the use of an IDE. This is not a shortcoming in my opinion.
Personally, I prefer to learn how things work before letting an IDE help me with some of the drudgery. Once you understand what it is that the IDE is trying to do for you, it's a lot easier to debug things when they go wrong.

http://tomcat.apache.org/tomcat-5.5-doc/appdev/index.html

Hope this helps.
 
Siegfried Heintze
Ranch Hand
Posts: 428
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks,
I've been reading http://tomcat.apache.org/tomcat-5.0-doc/jasper-howto.html and http://tomcat.apache.org/tomcat-5.5-doc/appdev/source.html and I cannot figure out how to deploy without a war file. Can someone point me to the documentation that explains how to do this?

Siegfried
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Tomcat periodically scans the webapps directory for new war files and/or new directories that contain a WEB-INF directory.

All you need to do is create a directory under the {tomcat install location}/webapps directory. Then, inside your new directory, create one named WEB-INF (case sensitive).
It's also a good idea to add a web.xml file but it's not required with Tomcat.

Example:
{tomcat install directory}/webapps/myApp/WEB-INF

If your app doesn't deploy on it's own after a minute or two, just restart Tomcat and, voila, you have deployed a webapp. Put a jsp page in there and you can hit it with your browser.
[ June 24, 2006: Message edited by: Ben Souther ]
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic