qq_35081827 2016-11-30 11:14 采纳率: 20%
浏览 1140

springmvc项目访问问题

最近在自学springmvc,出现了一个问题,就是在启动项目访问的时候,必须的加上.jsp页面才访问的了,比如http://localhost:8080/SpringMVC/add.jsp.这样访问,很不好,我就想改成http://localhost:8080/SpringMVC这样的访问形式!
下面是我的web.xml配置。如何实现??

<?xml version="1.0" encoding="UTF-8"?>

SpringMVC

index.jsp
<!-- index.html
index.htm
index.jsp
default.html
default.htm
default.jsp
-->

<!--
login.jsp
-->

contextConfigLocation
classpath*:config/beans.xml


org.springframework.web.context.ContextLoaderListener


springmvc
org.springframework.web.servlet.DispatcherServlet

contextConfigLocation
classpath*:config/Springmvc-servlet.xml


1

<servlet-mapping> 
    <servlet-name>springmvc</servlet-name> 
    <url-pattern>/</url-pattern>  
</servlet-mapping>
<filter>  
<filter-name>openSessionInViewFilter</filter-name>  
<filter-class>org.springframework.orm.hibernate4.support.OpenSessionInViewFilter</filter-class>  
<init-param>  
<param-name>singleSession</param-name>  
<param-value>true</param-value>  
</init-param>  
</filter>  
<filter-mapping>
  <filter-name>openSessionInViewFilter</filter-name>
  <url-pattern>/*</url-pattern>
</filter-mapping>
  • 写回答

1条回答 默认 最新

  • 墨色烟云 2016-12-01 01:35
    关注

    可以写一个接口跳转到该jsp

    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog