Previously, we have looked at the necessary code for our custom magnifier tool. Now lets talk about how to put things together step by step.
1. First, use arcgisant tool to create a MapViewer web application.
2. Deploy the web application in a servlet container and verify that it works fine.
3. Go to this web application root directory and then to its WEB-INF/classes folder.
4. Under the classes folder, create this path: com/esri/arcgis/sample.
5. Put the AgsServlet.java and AgsMap.java files in the sample folder.
6. Compile these 2 java classes. (You need to have servlet and arcgis server libraries in the classpath to compile the code.)
7. Next, we need to map our custom servlet in the web application. Go to WEB-INF folder and open web.xml file.
a) Add these tags to add the servlet:
<servlet>
<servlet-name>AgsServlet</servlet-name>
<servlet-class>com.esri.arcgis.sample.AgsServlet</servlet-class>
</servlet>
b) Add these tags to map the servlet:
<servlet-mapping>
<servlet-name>AgsServlet</servlet-name>
<url-pattern>/AgsServlet</url-pattern>
</servlet-mapping>
8. Refresh the servlet container.
This does it for the configuration of our custom servlet in the web application. Next time, we will talk about how to add the magnifier tool to the jsp page and customize the javascript code for this new tool.