Given the applicationContext:
Code:<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd" > <beans> <!-- Data Source --> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName" value="org.postgresql.Driver"> </property> <property name="url" value="jdbc:postgresql://127.0.0.1/distdata"></property> <property name="username" value="root"></property> <property name="password" value="celicious"></property> </bean> <!-- iBATIS sqlMapClient --> <bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean"> <property name="configLocation" value="sqlMapConfig.xml"></property> <property name="dataSource" ref="dataSource"></property> <property name="lobHandler" ref="defaultLobHandler"></property> </bean> <!-- LobHandler for JDBC drivers --> <bean id="defaultLobHandler" class="org.springframework.jdbc.support.lob.DefaultLobHandler" lazy-init="true"> </bean> <!-- A transaction manager for a single JDBC connection --> <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource"><ref local="dataSource"/></property> <!-- <property name="sessionFactory"><ref local="sessionFactory"/></property> --> </bean> <bean id="sqlMapClientProvinceDao" class="dist.dao.ibatis.SqlMapClientProvinceDao"> <property name="dataSource" ref="dataSource"></property> <property name="sqlMapClient" ref="sqlMapClient"></property> </bean> <bean id="sqlMapClientPlaceDao" class="dist.dao.ibatis.SqlMapClientPlaceDao"> <property name="dataSource" ref="dataSource"></property> <property name="sqlMapClient" ref="sqlMapClient"></property> </bean> <bean id="sqlMapClientDistributorDao" class="dist.dao.ibatis.SqlMapClientDistributorDao"> <property name="dataSource" ref="dataSource"></property> <property name="sqlMapClient" ref="sqlMapClient"></property> </bean> <bean id="sqlMapClientUomDao" class="dist.dao.ibatis.SqlMapClientUomDao"> <property name="dataSource" ref="dataSource"></property> <property name="sqlMapClient" ref="sqlMapClient"></property> </bean> <bean id="sqlMapClientProductDao" class="dist.dao.ibatis.SqlMapClientProductDao"> <property name="dataSource" ref="dataSource"></property> <property name="sqlMapClient" ref="sqlMapClient"></property> </bean> <bean id="sqlMapClientProductUomDao" class="dist.dao.ibatis.SqlMapClientProductUomDao"> <property name="dataSource" ref="dataSource"></property> <property name="sqlMapClient" ref="sqlMapClient"></property> </bean> </beans>
the dsrapp-servlet.xml:
Code:<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd" > <beans> <bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> <property name="mappings"> <props> <prop key="/viewUom">viewUomController</prop> </props> </property> </bean> <!-- <bean id="handlerMapping" name="handlerMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping" > <property name="urlMap" > <map> <entry key="/viewUom" value-ref="viewUom"></entry> </map> </property> </bean> --> <bean id="viewResolver" name="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver" > <property name="viewClass" value="org.springframework.web.servlet.view.JstlView"></property> <property name="prefix" value="/WEB-INF/jsp/"></property> <property name="suffix" value=".jsp"></property> </bean> <bean id="viewUomController" name="viewUomController" class="dist.web.ViewUomController" > <property name="uomDao" ref="sqlMapClientUomDao"></property> </bean> </beans>
and the web.xml:
the webapp is properly deployed in Tomcat 6... Tomcat is running (http://localhost:8080 returns the tomcat page)...Code:<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> <web-app> <display-name>dsrapp</display-name> <description>Daily Sales Report Monitoring Application</description> <context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/applicationContext.xml</param-value> </context-param> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <servlet> <servlet-name>dsrapp</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>detectAllHandlerAdapters</param-name> <param-value>false</param-value> </init-param> <init-param> <param-name>detectAllHandlerExceptionResolvers</param-name> <param-value>false</param-value> </init-param> <init-param> <param-name>detectAllHandlerMappings</param-name> <param-value>false</param-value> </init-param> <init-param> <param-name>detectAllViewResolvers</param-name> <param-value>false</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>dsrapp</servlet-name> <url-pattern>/dsrapp/*</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>test.html</welcome-file> </welcome-file-list>
but as far as the deployed webapp, I'm not sure which proper URL to use in order to get the controller / pages to work. I've tried the following:
http://localhost:8080/dsrapp/viewuom
http://localhost:8080/dsrapp/dsrapp/viewuom
and both addresses return a status 404.


Reply With Quote
Sami
