Adding Jar Files
m (added sections) |
m |
||
(One intermediate revision by one user not shown) | |||
Line 1: | Line 1: | ||
− | There are several ways to add jar files to opencms, to be used in your jsp code. | + | There are several ways to add jar files to opencms, to be used in your jsp code. This also works for class files. |
==Tomcat Common Lib folder== | ==Tomcat Common Lib folder== | ||
Line 9: | Line 9: | ||
==In the module== | ==In the module== | ||
Finally, if you want your module to be self-contained, you can create a lib directory in your module, and upload the jar file there. However, then you must export your module, then re-import it. This has to do with how the classpaths are configured when the modules are imported. You will probably also have to restart Tomcat again. | Finally, if you want your module to be self-contained, you can create a lib directory in your module, and upload the jar file there. However, then you must export your module, then re-import it. This has to do with how the classpaths are configured when the modules are imported. You will probably also have to restart Tomcat again. | ||
+ | |||
+ | Once you have added your jar file to the module, you don't have to export and re-import. You can simply replace the jar file. In some cases you may also have to restart Tomcat, probably good to do this every time. | ||
+ | |||
+ | [[Category:Extending OpenCms]] |
Latest revision as of 20:23, 27 June 2007
There are several ways to add jar files to opencms, to be used in your jsp code. This also works for class files.
Tomcat Common Lib folder
The simplest way is to add them to the Tomcat library (common\lib) directory, then restart Tomcat. This is good for jar files that will be used by many different webapps.
OpenCms library folder
You can also add jar files to the opencms library file, and restart Tomcat. The path would be something like tomcat\webapps\opencms\WEB-INF\lib.
In the module
Finally, if you want your module to be self-contained, you can create a lib directory in your module, and upload the jar file there. However, then you must export your module, then re-import it. This has to do with how the classpaths are configured when the modules are imported. You will probably also have to restart Tomcat again.
Once you have added your jar file to the module, you don't have to export and re-import. You can simply replace the jar file. In some cases you may also have to restart Tomcat, probably good to do this every time.