Hello word
来源:互联网 发布:如何开通淘宝达摩盘 编辑:程序博客网 时间:2024/06/05 07:19
首先加入jar 包:
web.xml中加入:
<servlet><servlet-name>springDispatcherServlet</servlet-name><servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class><!-- 有默认的springmvc.xml 目录为WEB-INF/<servlet-name>-servlet.xml--><init-param><param-name>contextConfigLocation</param-name><param-value>classpath:springmvc.xml</param-value></init-param><load-on-startup>1</load-on-startup></servlet><servlet-mapping><servlet-name>springDispatcherServlet</servlet-name><url-pattern>/</url-pattern></servlet-mapping>
applicationContext.xml加入:
<!-- 注解扫描器 --><context:component-scan base-package="com.gjs.springmvc"></context:component-scan><!-- 配置视图解析器 --><bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"><property name="prefix" value="/WEB-INF/view/"></property><property name="suffix" value=".jsp"></property></bean>
handler类中加入:
@Controllerpublic class HelloWord {@RequestMapping("/helloWork")public String helloWord(){System.out.println("helloWord");return "success";}}
*****************************************************************************************
以上完成简单的hello word!
1 0
- hello word
- hello word
- Hello,Word?
- hello word!
- Hello Word
- hello word
- hello word
- hello word!
- hello word
- Hello Word
- hello word!
- Hello Word
- Hello word!
- Hello word!
- Hello word
- Hello Word!
- hello word!
- Hello Word!
- ValuceCK
- TLE二行轨道根数格式
- TextView中UrlSpan与文本中的超链接冲突问题
- Linux学习篇之~unit9
- 如何使线管交叉显示打断
- Hello word
- Eclipse创建Maven Web项目
- adb 静默安装apk不成功
- APP自动化测试时如何获取APK的activity和包名
- thinking in java——0411学习笔记
- ORACLE JOB创建及使用详解
- Android 虚拟按键遮住了页面内容解决办法
- 评价拟合效果
- EventBus 3.0使用说明及NoClassDefFound错误解决