Servlet Hilfe

W

webraccoon

Hallo,

ich beabsichtige, mich in die Servlet-Technologie einzuarbeiten.
Ich brauche allerdings noch etwas Hilfestellung bei der Technik

Tomcat Server ist installiert, Eclips 3.0 auch.
Versuche ich nun eine Beispieldatei in Eclipse zu kompilieren, so meckert der Compiler erwartungsgemäss, daß er die nötigen Import-Dateien nicht findet.

Frage: Welche Plugins oder welche .jar-Archiv benötige ich für die Arbeit mit Servlets und wie importiere ich diese in Eclipse?

Das wäre erstmal alles

Danke
webraccoon
 
Hallo!

Im Tomcat_HOME\common\lib Verzeichnis findst du das servlet-api.jar welches du in deinen Classpath (bzw. Buildpath) aufnehmen solltest.

Gruß Tom
 
Hi Tom,

ja, idese Datei habe ich gefunden. Nun das heikle: wie binde ich sie ein?
Rechte Maustaste auf mein Package und dann Import? Dort finde ich aber keinen Hinweis auf auf eine .jar Datei ...

oder gibt es noch einen anderen Weg? Gar nur reinkopieren

gruss
webraccoon
 
Hallo!

In eclipse kannst du beispielsweise so eine jar - Bibliothek Datei zum Buildpath (Classpath) hinzufügen:
-> rechte Maustaste auf dein Projekt im Package Explorer
-> Properties
->Java Build Path
-> Libraries
-> add external Jars

Gruß Tom
 
Jo,


danke. Jetzt meckert er wenigstens nicht mehr :)

gruss
webraccoon
 
Hallo Forum!

Ich habe genau das gleiche Problem, aber bei mir hat das importieren des .jar files nach oben genanntem Schema leider nicht weitergeholfen...

Ich versuche nun wirklich schon seit Stunden ein einfaches HelloWorld Servlet zu kompilieren aber ich krieg immer die typischen Fehlermeldungen alla "cannot resolve symbol. symbol: Class HttpServlet" oder "package javax.servlet does not exist"...

Meine versuche: Setzen der Classpath-Variablen -> Kein erfolg
Aufruf des Javac-Compilers mit -classpath option -> Kein erfolg
Einbinden des servlet-api.jar ins Eclipse-Projekt -> Kein erfolg

ich werde langsam verrückt... :-(

Hier noch ein Post von mir aus dem SUN-Forum (leider keine Antworten) in dem
nochmal alle Details nachzulesen sind (auf englisch):

--------------------------------------------------------------------------------------------------------------------------------

Hi Forum,

I`ve been sitting here for hours trying to compile a simple "Hello World"-Servlet.
I think there's no need to post the sourcecode, because there are a lot of examples around :)

I'm using :

Eclipse 3.0.2
Apache Tomcat 5.5 using jre 1.5.0_02
Ant 1.6.3
j2sdk 1.4.2

under WinXP Home Edition

The problem is, that when I´m trying to compile the servlet get plenty of errors like
"cannot resolve symbol. symbol: class HttpServlet" etc....
or "package javax.servlet does not exist"...

I've been searching around the internet and this forum for hours now and only found the hint about the CLASSPATH-Variable butt this couldn't fix my problem.

In my opinion all Classpath-settings are allright:
CLASSPATH=
".; C:\Programme\Apache Software Foundation\Tomcat 5.5\bin\bootstrap.jar; C:\Programme\Apache Software Foundation\Tomcat 5.5\common\lib\servlet-api.jar; C:\Programme\Apache Software Foundation\Tomcat 5.5\common\lib\jsp-api.jar; C:\Programme\Apache Software Foundation\Tomcat 5.5\common\lib\j2ee.jar"

ANT_HOME="c:\Programme\Apache Software Foundation\apache-ant-1.6.3"

JAVA_HOME="C:\j2sdk1.4.2"

Since my first post tried to use the classpath directly with the javac-command
(sth. like javac -classpath c:\...\jsp-api.jar \myprojekt\src\...* )

=> the same effect: "cannot resolve symbol: Class HttpServlet"

I also imported the .jar files directly into my eclipse-project via
"project->properties->Java Build Path-> Libraries"

=> it still doesnt fix my problem.... :-(

Ich muss unbedingt ein Projekt für die Uni bearbeiten, komm so aber einfach nicht weiter!

HILFE!

Danke, Fabi
 

Neue Beiträge

Zurück