eclipse搭建springMVC ,求指导!

J2EE 码拜 9年前 (2015-05-10) 957次浏览 0个评论
 

我在百度上找一篇教程,按着来做,但总是跑不起,大姐大哥们推荐几个可以行得通的教程或者是可以跑得聊得简单程序,感激涕流呀

小弟不会,求调教呀!

10分
这项目搭建无非就是加一些包,写一些配置,主要就是繁琐。如果你对springMVC不熟悉就更难了,在网上看例子也就是搭对了也云里雾里,做开发的时候会发现好多问题,莫句其秒的问题。我这个的springMVC视频,一共5个小时的吧,不用全部看,里面从xml配置到annocation配置都有详细介绍springMVC教程springMVC。这两个都不错的,很详细
引用 1 楼 hjw506848887 的回复:

这项目搭建无非就是加一些包,写一些配置,主要就是繁琐。如果你对springMVC不熟悉就更难了,在网上看例子也就是搭对了也云里雾里,做开发的时候会发现好多问题,莫句其秒的问题。我这个的springMVC视频,一共5个小时的吧,不用全部看,里面从xml配置到annocation配置都有详细介绍springMVC教程springMVC。这两个都不错的,很详细

顺便,我那个包下好多编程视频学习都是公开的,有需要的,就去找找吧。。。

引用 1 楼 hjw506848887 的回复:

这项目搭建无非就是加一些包,写一些配置,主要就是繁琐。如果你对springMVC不熟悉就更难了,在网上看例子也就是搭对了也云里雾里,做开发的时候会发现好多问题,莫句其秒的问题。我这个的springMVC视频,一共5个小时的吧,不用全部看,里面从xml配置到annocation配置都有详细介绍springMVC教程springMVC。这两个都不错的,很详细

不胜感激呀!

有什么错误信息,贴出来看看。
引用 4 楼 rui888 的回复:

有什么错误信息,贴出来看看。

好像是路径问题,我改了一不管用,报404
十二月 30, 2013 10:16:49 上午 org.springframework.web.servlet.DispatcherServlet noHandlerFound
WARNING: No mapping found for HTTP request with URI [/0miss1/hello.html] in DispatcherServlet with name “”spring””

10分
应该是请求的路径问题。 估计是 多了  /   问题。
引用 4 楼 rui888 的回复:

有什么错误信息,贴出来看看。

我粘贴错了!

HTTP Status 404 – /0miss1/hello.jsp

type Status report

message /0miss1/hello.jsp

description The requested resource is not available.
Apache Tomcat/6.0.37

要看看我的配置吗

ip:端口/项目名/xxx.jsp   你看看是什么问题。
10分
404错误和你用springMVC关系不大。你看看是不是路径输入不对
我把代码贴上吧

index.jsp

<html>
<head>
<title>Spring 3.0 MVC</title>
</head>
<body>
<a href=”hello.jsp”>SAY HELLO</a>
</body>
</html>

hello.jsp

<html>
<head>
<title>Spring 3.0 MVC Series:Hello World</title>
</head>
<body>

${message}
</body>
</html>

spring-servlet.xml
<?xml version=”1.0″ encoding=”UTF-8″?>
<beans xmlns=”http://www.springframework.org/schema/beans”
    xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”
    xmlns:p=”http://www.springframework.org/schema/p”
    xmlns:context=”http://www.springframework.org/schema/context”
    xsi:schemaLocation=”http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
        http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context-3.0.xsd”> 
    <context:component-scan
        base-package=”net.viralpatel.spring3.controller”/> 
    <bean id=”viewResolver”
        class=”org.springframework.web.servlet.view.UrlBasedViewResolver”>
        <property name=”viewClass”
            value=”org.springframework.web.servlet.view.JstlView”/>
        <property name=”prefix” value=”/WEB-INF/jsp/” />
        <property name=”suffix” value=”.jsp”/>
    </bean>
</beans>

web.xml

<?xml version=”1.0″ encoding=”UTF-8″?>
<web-app xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”
    xmlns=”http://java.sun.com/xml/ns/javaee”
    xmlns:web=”http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd”
    xsi:schemaLocation=”http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd”
    id=”WebApp_ID” version=”2.5″>
    <display-name>0miss1</display-name>
    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list> 
    <servlet>
        <servlet-name>spring</servlet-name>
        <servlet-class>
org.springframework.web.servlet.DispatcherServlet
        </servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>spring</servlet-name>
        <url-pattern>*.html</url-pattern>
    </servlet-mapping>
</web-app>
        

受教,谢谢分享
20分
http://blog.csdn.net/u010469432/article/details/17587699你可以看看这篇文章,我里面写的有源码,是我在工作中开发商业项目用的框架。用的就是springMVC 数据库使用的是SQLServer  。里面写好的有登陆功能。如果你用的不是SqlServer,只需要更改jdbc.properties文件的配置即可。
20分
404找不到文件,如跳转到的某个html、jsp文件
10分
建议别去百度搜那些乱七八糟的复制不知道多少遍了的教程,去官方网站直接用maven搞一个样例好好研究下

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明eclipse搭建springMVC ,求指导!
喜欢 (0)
[1034331897@qq.com]
分享 (0)

文章评论已关闭!