152-thymeleaf如何获取url与提交的参数

<script type="text/javascript" th:inline="javascript">

    //协议名称
    var scheme = [[${#request.getScheme()}]];

    //服务器名称
    var serverName = [[${#request.getServerName()}]];

    //服务器端口号
    var serverPort = [[${#request.getServerPort()}]];

    //上下文根
    var contextPath = [[${#request.getContextPath()}]];

    //获取请求参数
    var queryString = [[${#request.queryString}]];

    //获取请求路径(不带参数)
    var requestURL = [[${#request.requestURL}]];

    alert(queryString);

</script>

  

posted on 2020-04-24 17:26  十年磨三劍  阅读(3331)  评论(0编辑  收藏  举报

导航