
Sysdeo Eclipse Tomcat Launcher plugin web site at : http://www.sysdeo.com/eclipse/tomcatPlugin.html
Documentation (french) : http://www.eclipsetotale.com/articles/tomcat/tomcatPluginDocFR.html
Send feedback to bleroux@sysdeo.com
Plugin features
- Setting Tomcat directory
- Starting, stopping and restarting Tomcat 4.x, 5.0.x, or 3.3
- Registering Tomcat process to Eclipse debugger
- Creating a WAR project (wizard can update server.xml file)
- Adding Java Projects to Tomcat classpath
- Setting Tomcat JVM parameters, classpath and bootclasspath
- Exporting a Tomcat project to a WAR File
- Choosing Tomcat configuration file
Mailing list
Send an email to bleroux@sysdeo.com
to be notified when a new version is released.
Installation
- This plugin does not contain Tomcat 5.
(Download and install Tomcat before using it)
- Download tomcatPluginV??.zip
- Unzip it in <eclipse_home>/plugins
- Plugin activation : select menu 'Perspective>Customize...', expand 'Other',
and check 'Tomcat'
- Set Tomcat home : Workbench -> Preferences, select Tomcat and set Tomcat
home
- This plugin launches Tomcat using the default JRE checked in Eclipe preferences
window.
To set a JDK as default JRE for Eclipse open the preference window : Window
-> Preferences -> Java -> Installed JREs.
This JRE must be a JDK (This is a Tomcat prerequisite).
We recommend that you use JDK 1.4 as it supports hot code replacement feature.
- The plugin sets itself Tomcat classpath and bootclasspath. Use Preferences
-> Tomcat ->JVM Settings, only if you need specific settings.
Working on a Tomcat project
If you don't want to use the Tomcat project wizard, follow these steps :
- Create a java project, its structure should be compliant with a war directory
structure. Two ways to create this project :
- create the project in eclipse workspace, then tell Tomcat that this
project is a web application, to do that add the following line to your
tomcat server.xml file :
<context path="/yourProjectUrlPath"
docbase="C:\your\project\abosolute\directory\path" />
- when creating the project unselect 'Use project default location' and
set location to a Tomcat web application directory (webapps subdirectory)
- Add Tomcat jar files (servlet.jar could be enough) to your project Build
path :
( open project properties, select Java Build Path, select librairies panel
and 'Add external JARs...')
- Start Tomcat from Tomcat menu AFTER your project is created.
JSP Debugging
We plan to make JSP debugging easier. For the moment, follow those steps :
(In version 0.9, steps 1 to 3 are automaticaly done by Tomcat Project Wizard)
- Create a directory work in your project, in this directory create the following
directory structure : /org/apache/jsp/
- Set work directory as a source folder for your project
(open project properties, select Java Build Path, select Source panel and
'Add Existing folders...')
- Tell Tomcat to put java files resulting from jsp compilation in this directory
( open tomcat server.xml file and set your application context like this :
<context path="/yourProjectUrlPath"
docbase="C:\your\project\abosolute\directory\path or /relative/path/from/webapps"
workDir="C:\your\project\abosolute\directory\path\work\org\apache\jsp" />
)
- Start Tomcat from Tomcat menu
- Call your JSP from a web browser
- In Eclipse select work folder in your project and 'Refresh from Local',
java files generated from your JSP should be seen by Eclipse and you can set
breakpoint
Known problems : Tomcat 4 and JSP in project subdirectories
Generated servlets for JSP couldn't be compile by Eclipse. Subdirectories do
not appear in Tomcat 4 generates servlets. Package definition is always package
org.apache.jsp.
- Workaround 1 : install our
Tomcat 4.x patch.
- Workaround 2 (from Gabriel Krupa) : if your jsp is /myjspdir/myjsp.jsp,
generated servlet will be in work/org/apache/jsp/myjspdir, change package
definition from org.apache.jsp to org.apache.jsp.myjspdir, to debug your jsp
access it from your browser with the following URL :
http://myhost:8080/myapplication/servlets/org.apache.jsp.myjspdir.myjsp$jsp
- Workaround 3 : use Tomcat 3.3 (servlet 2.2 and JSP 1.1), with Tomcat 3,
package definition is compliant with file location.
Send your feedback to bleroux@sysdeo.com
(c) Sysdeo 2002 - http://www.eclipsetotale.com