配置不是很了解,找不带错误,求大神知道
No mapping found for HTTP request with URI in DispatcherServlet
Successfully completed request
Controller:
@Controller
@RequestMapping("/connect")
public class connectController {
@RequestMapping(method = RequestMethod.GET, value = "test.do")
public boolean getActs(String wxy) {
System.out.println("1111");
boolean a = false;
if(wxy=="123"){
a=true;
}
return a;
}
}
配置文件
<mvc:default-servlet-handler/>
<!-- 让spring支持annotation -->
<!-- 设置spring去哪些包下找annotation -->
mvc:annotation-driven/
<mvc:resources location="/resources/" mapping="/resources/**"></mvc:resources>
<context:component-scan base-package="com.wxy"/>
<!-- 定义视图解析器 -->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
<property name="prefix" value="/WEB-INF/jsp/"></property>
<property name="suffix" value=".jsp"></property>
</bean>
<!-- 设置multipartResolver才能完成文件上传 -->
<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<property name="MaxUploadSize" value="5000000"></property>
</bean>
<!-- 配置spring的事物处理 -->
<!-- 创建事物管理器 -->
<bean id="txManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"/>
</bean>
<tx:advice id="txAdvice" transaction-manager="txManager">
<tx:attributes>
<tx:method name="*" propagation="REQUIRED"/>
</tx:attributes>
</tx:advice>
<!-- 配置AOP,spring是通过aop来进行事务处理的 -->
<aop:config expose-proxy="true">
<!-- execution(* com.yxyy.service.impl.*.*(..)) 第一个星号表示任意返回值,第二个星号表示任意类,第三个星号表示任意方法,(..)表示任意参数 -->
<aop:pointcut id="allMethods" expression="execution(* com.wxy.service.impl.*.*(..)) &"/>
<!-- 通过txAdvice说明哪些具体的方法加入事务 -->
<aop:advisor advice-ref="txAdvice" pointcut-ref="allMethods"/>
</aop:config>
beans.xml
<servlet>
<servlet-name>wumochou</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:config/beans.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
wumochou
*.do