All,
I have a situation where I would like the same servlet to be accessed by different paths. I am using the Apache server and Tomcat. The servlet then parses out the path and creates action according to the path that called it. The reason I am doing this is because we have two environments, the Customer environment and the Customer Service Representatives. Each environment has some special functionality, but they share a large amount of the same functionality. I am going to use the same .jsp's and servlets for each, but parse out the path to determine which environment is being used. Here is my problem.... I can parse out the information correctly with the .jsp's, but when it comes to the servlets, I can not access the servlets. The webapp name is 'customersearch'. I have created a context of '/CUS' and '/CSR' that both point to the same webapp of 'customersearch'. I have set the web.xml of the 'customersearch' webapp as follows: <web-app> <servlet> <servlet-name>CustomerBodyControl</servlet-name> <servlet-class>com.shipley.customersearch.CustomerBodyControl</servlet-class > </servlet> <servlet> <servlet-name>CustomerSearchControl</servlet-name> <servlet-class>com.shipley.customersearch.CustomerSearchControl</servlet-cla ss> </servlet> <servlet-mapping> <servlet-name>CustomerBodyControl</servlet-name> <url-pattern>/CSR/CustomerBodyControl</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>CustomerSearchControl</servlet-name> <url-pattern>/CSR/CustomerSearchControl</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>CustomerBodyControl</servlet-name> <url-pattern>/CUS/CustomerBodyControl</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>CustomerSearchControl</servlet-name> <url-pattern>/CUS/CustomerSearchControl</url-pattern> </servlet-mapping> <session-config> <session-timeout>30</session-timeout> </session-config> </web-app> In my Apache config, I did a JkMount /CSR *inprocess, JkMount /CUS *inprocess, JkMount /CUS/* *inprocess, JkMount /CSR/* *inprocess. Here is the problem: When referencing a servlet (http://<server-name>/CSR/CustomerSearchControl) I get a 404 (page not found). When looking in the logs, I get the following error: POST /CSR/CustomerSearchControl HTTP/1.1" 404 199 Anyone have any ideas? Mike ================================
Mike Silvers AS/400 Senior Programmer/Analyst AS/400 IBM Certified RPG IV Developer AS/400 IBM Certified Solutions Expert Hainey Business Systems 8 E. Canal St Dover, PA 17315 Branch Office: (410) 397-8739 Phone: (800) 932-3380 ext. 237 Fax: (717) 292-9474 Web: http://www.hbs-inc.com ________________________________ Providing E-Commerce, EDI, AS/400 Development, Java Development, and related services nationwide. ================================ |
- Re: Accessing a servlet problem - Apache/Tomcat Mike Silvers
- Re: Accessing a servlet problem - Apache/Tomcat Ravisankar.N