springmvc随笔

 No mapping found for HTTP request with URI [/springmvcdemo/welcome] in DispatcherServlet with n....

遇到上面的问题检查下servlet-mapping是不是"/",同时,检查springmvc配置文件的扫包是不是只到达包,不能像struts一样到达class


如果遇到lisenner不能发现,则检查引用的包是否都放在了lib下再引用的,另外应用spring官方额外两个包:

com.springsource.org.aopalliance-1.0.0.jar

com.springsource.org.apache.commons.logging-1.1.1.jar


web三部曲:

配置监听(监听springmvc配置文件,默认为spring-servlet.xml),

配置springservlet

启动加上load-start为1


springmvc配置文件三部曲

装在注解驱动

<mvc:annotion-diven/>....

扫包

<context:component-scan base-package="com.marine.test" />

配置视图

<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver" p:prefix="/WEB-INF/xxx/" p:suffix=".html" />


undone....

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值