Servlets - Tomcat
Folder Structure
For a CADViewer Servlets installation under Tomcat on Windows, the base file-structure should be as below:
NOTE: Under Linux replace c:\xampp\tomcat\webapps with /var/lib/tomcat{X}.
c:\xampp\tomcat\webapps └─── cadviewer ├── app │ ├── cv │ │ ├── cv-pro │ │ │ ├── menu_config │ │ │ ├── language_table │ │ │ └── space │ │ │ ├── css │ │ │ └── html │ │ ├── cv-core │ │ │ ├── menu_config │ │ │ └── language_table │ │ └── cv-custom_commands │ ├── fonts │ ├── images │ ├── js │ ├── css │ └── user_resources ├── converters │ ├── ax2022 │ │ ├── windows │ │ │ └── fonts │ │ └── linux │ │ └── fonts │ ├── dwgmerge2022 │ │ ├── windows │ │ │ └── fonts │ │ └── linux │ │ └── fonts │ ├── linklist2022 │ │ ├── windows │ │ │ └── fonts │ │ └── linux │ │ └── fonts │ └── files ├── WEB-INF │ ├── classes │ └── lib ├── content ├── html └── temp_print
1: Download and install CADViewer under this structure.
2: Download and install AutoXchange 2022 under this structure.
3: Optionally, Download and install DwgMerge 2022 under this structure.
Note: Use our GitHub repository, https://github.com/CADViewer/cadviewer-tomcat-01 for a fully integrated structure. Also from Download, .war install files can be downloaded.
WEB-INF Configuration
NOTE: Under Linux replace c:\xampp\tomcat\webapps with /var/lib/tomcat{X}.
In folder:
c:\xampp\tomcat\webapps └─── cadviewer └─── WEB-INF ├── classes └── lib
4: Download install WEB-INF folder under this structure from the download Handlers section.
In folder /cadviewer/WEB-INF open and edit the file web.xml.
Locate and change all CADViewer Servlets related <param-name> / <param-value> pairs, so the paths and executable points properly to the values defined in your CADViewer installation structure.
HTML
NOTE: Under Linux replace c:\xampp\tomcat\webapps with /var/lib/tomcat{X}.
In folder:
c:\xampp\tomcat\webapps └─── cadviewer └── html
For the combination of JavaScript front-end and Servlets back-end a typical Handler initialization in any of the sample .html files looks like:
var ServerBackEndUrl = "http://localhost:8080/cadviewer/";
var ServerUrl = "http://localhost:8080/cadviewer/";
var ServerLocation = "c:/xampp/tomcat/webapps/cadviewer/"; // or leave blank to use server side path structure
// Pass over the location of the installation, will update the internal paths
cvjs_setAllServerPaths_and_Handlers(ServerBackEndUrl, ServerUrl, ServerLocation, "Servlets", "JavaScript", "floorPlan");
See the API documentation for initialization:
- cvjs_setAllServerPaths_and_Handlers() - required
Running
Open a web-browser pointing to your sample html file (any of the files in the /cadviewer/html/ folder): http:/localhost:8080/cadviewer/html/mysample.html
Use the server traces and browser development console for debugging, alternatively contact our Support
NOTE: Under Linux replace c:\xampp\tomcat\webapps with /var/lib/tomcat{X}.
For debugging, the folder:
c:\xampp\tomcat\ └─── temp
contains a debug files corresponding to each of the Servlets defined in /cadviewer/WEB-INF/classes folder. The debug files are of type: getFileServlet-log-err2938081564144043508.txt and ConversionServlet-log_8998081420588034766.txt.
Especially ConversionServlet-log_xxxxxx.txt lists the command line and traces in the communication with the back-end converter AutoXchange 2020.
If drawing files does not display, this file will contain useful information to pinpoint the issue.
Troubleshooting
One issue that often appears in installations is that interface icons do not display properly:
Typically the variable ServerUrl in /cadviewer/app/cv/CADViewer_ServerHandlerSettings.js is not set to reflect the front-end server url or port.