This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Siegfried Heintze
Ranch Hand
Posts: 408
  • Mark post as helpful
  • send pies
  • 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 ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65227
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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 ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • 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: 408
  • Mark post as helpful
  • send pies
  • 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 Redhat VI Editor
  • Mark post as helpful
  • send pies
  • 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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic