wood burning stoves 2.0*
The moose likes JSP and the fly likes Hello World in JSP/JSTL/ANT using Ant, Eclipse & Tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Hello World in JSP/JSTL/ANT using Ant, Eclipse & Tomcat" Watch "Hello World in JSP/JSTL/ANT using Ant, Eclipse & Tomcat" New topic
Author

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

Siegfried Heintze
Ranch Hand

Joined: Aug 11, 2000
Posts: 381
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 ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60785
    
  65

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 ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

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.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Siegfried Heintze
Ranch Hand

Joined: Aug 11, 2000
Posts: 381
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

Joined: Dec 11, 2004
Posts: 13410

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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hello World in JSP/JSTL/ANT using Ant, Eclipse & Tomcat
 
Similar Threads
Eclipse - exporting files in WAR file
Unable to locate the .jsp file error
diff between war file created by Ant and eclipse
Building a .WAR file
Creating WAR File