Testing environment is following:
I wanted my tomcat project to be located in different directory from sub of webapp folder. Above Tomcat 6, Tomcat has a config fiile for the application. See the Tomcat_Installed_Dir\conf\Catalina\Host_Name (ex. c:\tomcat\Catalina\localhost) directory and then you can find configuraion files XMF format. If the application name is "faces" then tomcat directories will look like following:
tomcat_installed_dir
- bin
- conf
- Catalina
- localhost
- faces.xml
- logs
- temp
- webapps
- faces
- WEB-INF
- classes
- lib
- ROOT
- work
Configuration XML file for application context
Create tomcat_installed_dir/conf/Catalina/localhost/faces.xml (same name with application) and edit the file like following. The docBase attribute means the directory for your project and workDir is the one that Web containor generates compiled JSP pages.
<Context path="/faces" reloadable="true"
docBase="D:\Projects\JSF\faces"
workDir="D:\Projects\JSF\faces\work" />
Now shutdown and restart tomcat. Create index.jsp and go to http://localhost:8080/, then you can see index.jsp on your Web browser.
Tomcat Plug-in for Eclipse
If you are Eclipse user then, it will be helful to install tomcat plug-in. Please go to http://www.eclipsetotale.com/tomcatPlugin.html#A3 to download it. (If the link does not work, please ask to Google.)
- Windows XP Professional ServicePack 2
- Tomcat 6.0.32
- Java 6.0 (JDK 1.6.0.24)
I wanted my tomcat project to be located in different directory from sub of webapp folder. Above Tomcat 6, Tomcat has a config fiile for the application. See the Tomcat_Installed_Dir\conf\Catalina\Host_Name (ex. c:\tomcat\Catalina\localhost) directory and then you can find configuraion files XMF format. If the application name is "faces" then tomcat directories will look like following:
tomcat_installed_dir
- bin
- conf
- Catalina
- localhost
- faces.xml
- logs
- temp
- webapps
- faces
- WEB-INF
- classes
- lib
- ROOT
- work
Configuration XML file for application context
Create tomcat_installed_dir/conf/Catalina/localhost/faces.xml (same name with application) and edit the file like following. The docBase attribute means the directory for your project and workDir is the one that Web containor generates compiled JSP pages.
<Context path="/faces" reloadable="true"
docBase="D:\Projects\JSF\faces"
workDir="D:\Projects\JSF\faces\work" />
Now shutdown and restart tomcat. Create index.jsp and go to http://localhost:8080/, then you can see index.jsp on your Web browser.
Tomcat Plug-in for Eclipse
If you are Eclipse user then, it will be helful to install tomcat plug-in. Please go to http://www.eclipsetotale.com/tomcatPlugin.html#A3 to download it. (If the link does not work, please ask to Google.)
Comments
Post a Comment