This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Tomcat and the fly likes Ajax in 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 » Products » Tomcat
Bookmark "Ajax in Tomcat" Watch "Ajax in Tomcat" New topic

Ajax in Tomcat

Rohan Kalbhor
Ranch Hand

Joined: Aug 18, 2006
Posts: 78
I am a starter in Ajax and i am implementing it using Tomcat 6.0

I have 3 files

1.try.html - html file
2.Ajax.js - javascript file - servlet code

Can someone please tell me where do i store these files in tomcat 6.0 files so that i can get them running.

Thankyou in advance

..............................<br />Exceptions are a part of possibility<br />Errors are a part of truth<br />................................
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074

It's not as easy as just putting the files in the right place. You will have to create a Java web application, package it as a WAR file and deploy the WAR file in Tomcat.

Have a look at this: The J2EE 1.4 Tutorial - Getting Started with Web Applications

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Rohan Kalbhor
Ranch Hand

Joined: Aug 18, 2006
Posts: 78
Hey Jesper,
Thank you for the Reply,
i researched a lot on this it goes

ROOT directory:
1.Javascript file
2.HTML file
3.Style sheet(In ROOt/css folder)create css folder if absent
4.servlet in ROOT/WEB-INF/classes folder

had a hard time playing with it...
hope some one finds it useful

Rohan Kalbhor
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

For experimenting with JSP, this is fine but, before moving any further, you should consider Jesper's advice and learn how to create your own web applications.

By putting your code into the ROOT directory, you've mixed your code with an existing (but unrelated) web application.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
I agree. Here's the link:
subject: Ajax in Tomcat
Similar Threads
how to access other folders outside webapp in tomcat6
Unable to run start up file for tomcat 6.0
Setting up contexts somewhere other than webapps
JSTL installation
Heeelp! Fileupload with jsf and ajax