Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

running a servlet

 
adwin berkowits
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
adwin berkowits
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"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
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
adwin berkowits
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18152
52
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://www.coderanch.com/t/568454/Tomcat/running-servlet#2584090
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic