This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
Hello World in JSP/JSTL/ANT using Ant, Eclipse & Tomcat
Siegfried Heintze
Ranch Hand
Joined: Aug 11, 2000
Posts: 359
posted
0
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.
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 ]
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.
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.
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 ]