Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / January 2007

Tip: Looking for answers? Try searching our database.

servlets problems

Thread view: 
boyScout - 02 Jan 2007 13:06 GMT
Hello guys, I'm learnig java servelts but I got problems. I'using
tomcat as a container so I have a web application named so I created a
directory named jsp within the webapps' directory. After I have created
a web.xml file and a WEB-INFO directory inside my web application
directory then I put all classes inside the WEB-INFO/classes directory.
But nothing appear. Can someone help with that? Thanx
Andrew Thompson - 02 Jan 2007 13:13 GMT
> Hello guys, I'm learnig java servelts but I got problems. I'using
> tomcat as a container so I have a web application named so I created a
> directory named jsp within the webapps' directory. After I have created
> a web.xml file and a WEB-INFO ...

Huhh?  Did you mean 'WEB-INF' (no 'O')?

>...directory inside my web application
> directory then I put all classes inside the WEB-INFO/classes directory.

Only loose classes go in the classes directory, and
then by 'reverse package name', so for example...

<snippet>
package com.ourcompany;

public class TheClass {
...
</snippet>

..should be located as..

 WEB-INF/classes/com/ourcompany/TheClass.class

OTOH, if your classes are in a jar, they need
to go in WEB-INF/lib.

> But nothing appear.

Are you saying the 'classes are not found'?
Please try to give more detail of error output.

If none of the above works, don't forget to refresh
the server (restarting it is the easiest way).

HTH

Andrew T.
ck - 02 Jan 2007 14:35 GMT
> > Hello guys, I'm learnig java servelts but I got problems. I'using
> > tomcat as a container so I have a web application named so I created a
[quoted text clipped - 34 lines]
>
> Andrew T.

Adding to what Andrew has said. You could make this simpler by just
creating a jsp file(index.jsp) and putting it inside your application
folder (in this case jsp folder and not WEB-INF).
Simply delete web.xml if it contains nothing or if its giving any error
during start up of the server.
In index.jsp you could put "hello world"

In your browser try to open it (http://127.0.0.1:8080/jsp/index.jsp I
am presuming that you would have not changed the port number)
I would also like to presume that you don't know how servlets can be
invoked. So you should refer some book, how to deploy a servlet.

Hope this helps

Cheers,
Ck
http://www.gfour.net


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.