zoukankan      html  css  js  c++  java
  • SpringMVC访问WEB-INF下的jsp的方法

    当输入localhost:8080/项目名

    浏览器弹出不知道神马错误

    The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application

    出现这个问题百度的下说是将jstl-impl.jar包放到lib目录下就可以解决了,

    尝试后确实可以解决问题。

    然而,当我把这个jar包从我项目中删除后再访问又出现不一样的报错

    java.lang.NoClassDefFoundError: org/apache/taglibs/standard/tag/rt/core/SetTag

    也是缺少jatl-impl.jar包但是你给我报不一样错误干嘛呢

    Message:The server encountered an internal error that prevented it from fulfilling this request.

    大概意思是:服务器遇到内部错误,阻止其执行此请求。

    项目中web.xml配置。只需要看<welcome-file></welcome-file>

    因为是SpringMVC项目,我就想输入网址请求时候由Controller返回页面到浏览器不是更好吗,这就不需要找jar包那么麻烦了

    定义一个映射

    这样当输入localhost:8080/项目名    ==》servletDispatcher将这个请求发送到这个方法,然后返回页面就可以了。

    @RequestMapping(value = "")

    public String welcomeHandler()

    {

      return "WEB-INF/views/login.jsp"

    }

  • 相关阅读:
    MediaInfo代码阅读
    HEVC与VP9之间的对比
    x264阅读记录-3
    x264阅读记录-2
    x264阅读记录-1
    Linux脚本程序
    VS2015 ASP.NET5 Web项目结构浅析
    VS2015 Apache Cordova第一个Android和IOS应用
    VS2015 C#6.0 中的那些新特性
    aehyok.com的成长之路三——框架结构
  • 原文地址:https://www.cnblogs.com/gne-hwz/p/7771885.html
Copyright © 2011-2022 走看看