File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes IDEs, Version Control and other tools and the fly likes running a servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "running a servlet " Watch "running a servlet " New topic

running a servlet

adwin berkowits

Joined: Feb 23, 2012
Posts: 6
fail in running a servlet
i get error messages:

package javax.servlet does not exist

package javax.servlet.http does not exist

i found general servlet jar at:
C:\Program Files\NetBeans 7.1\ide\modules\locale
C:\Program Files\NetBeans 7.1\ide\modules\ext
C:\Program Files\NetBeans 7.1\ide\modules
C:\Program Files\NetBeans 7.1\ide\update_tracking
C:\Program Files\NetBeans 7.1\ide\config\Modules

were in the netbeans i write the class or jar path to enable compilation
and were do i get the missing packages
tried to launch a resin server but the setup file makes an error
may be there is the other way to download other server than resin and run the servlet without the need to fetch the missing packages
Vicky Vijay
Ranch Hand

Joined: Apr 23, 2008
Posts: 125

Refer the below link

adwin berkowits

Joined: Feb 23, 2012
Posts: 6
"If you don't have any Tomcat available, you need to go back and reinstall NetBeans"

1. system windows xp home edition fail to uninstall netbean. i have 7.1 netbeans so i cant install tomcat
2. i downloaded tomcat on a separate directory but i cant run it all the bat files open a console that is being shut down immediatly
3. the categories "Java Web" and project "Web Application doesnt appear
Peter Johnson

Joined: May 14, 2008
Posts: 5852

1) Why can't you uninstall NetBeans? What error do you get? There are free products that can help uninstall things, search for windows uninstallers

2) That is the way the Tomcat startup.bat file works - it calls another bat file to do the work and then exits. It is the other bat file that really runs Tomcat. You should be able to access Tomcat at http://localhost:8080.

And another though on that. Given your description, you are double-clicking startup.bat in Explorer. Don't! Instead, open a command prompt , cd to the Tomcat bin directory, and enter "startup" there. Then if there are issues such as an improper JAVA_HOME setting, you'll find out about it.

Also, if you don't want startup.bat to exit, you can start Tomcat as:

3) Sounds like you did not install the NetBeans package that has Java EE support.

And finally: you need to read your private messages and take care of that administrative matter. It is not optional.

JBoss In Action
adwin berkowits

Joined: Feb 23, 2012
Posts: 6
succeede to uninstall netbeans and install the proper one
after making the new project i have index.jsp file with hello world i have a certain servlet which suppose to work
without the need to use jsp
how can i replace the index.jsp with it the instructions you had given me :

Creating a new servlet
The easiest way to create a new servlet is to use the servlet wizard. Select File | New File...
In step 1 of the wizard, select category "Web" and file type "Servlet".
In step 2, choose an appropriate class name and an appropriate package name. A good package name is "fred.first" if your name is fred and this is your first project.
In step 3, accept all the defaults. NetBeans will automatically add information about your servlet to the web.xml configuration file.
NetBeans will generate the outline of the new servlet. In mos

will have conflict with the jsp.index so what should be the type of project to create before this steps (servlet file) because main file is now index.jsp

i think i succeeded to invoke the tomcat but how can i launch the servlet
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17410

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: running a servlet
It's not a secret anymore!