zoukankan      html  css  js  c++  java
  • 伪静态

    使用urlrewritefilter-4.0.3.jar
    配置web.xml
    
      <!-- 伪静态 -->
      <filter>
        <filter-name>UrlRewriteFilter</filter-name>
        <filter-class>
            org.tuckey.web.filters.urlrewrite.UrlRewriteFilter
        </filter-class>
      </filter>
      <filter-mapping>
        <filter-name>UrlRewriteFilter</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
      </filter-mapping>
    在web.xml同级目录新建urlrewrite.xml
    
    <?xml version="1.0" encoding="utf-8"?>
    <!DOCTYPE urlrewrite PUBLIC "-//tuckey.org//DTD UrlRewrite 2.6//EN"
    "http://tuckey.org/res/dtds/urlrewrite2.6.dtd">
    <urlrewrite>
    <!-- 新闻中心开始 -->
                  <rule>
                    <from>^/web/news/newsCenter.html$</from>
                    <to type="forward">/web/news/newsCenter.do</to>
                  </rule>
    <!-- 新闻中心结束 -->
    <!-- 新闻详细页开始 -->
                  <rule>
                    <from>^/web/news/newsParticular/n_id_([-]?[0-9a-zA-Z]+)?/news_type_([-]?[0-9a-zA-Z]+)?.html$</from>
                    <to type="forward">/web/news/newsParticular.do?nId=$1&amp;newsType=$2</to>
                  </rule>
    <!-- 新闻详细页结束 -->
    </urlrewrite>
    页面
    
    <body>
      <div class="content-right fr">
                    <div class="content-right-tit">
                        <img src="web/img/t34.jpg"/>
                    </div>
        <div class="content-right-con">
                        <div class="news">
                            <div class="news-con1">
                                <p>企业公告</p>
                                <ul>
                                    <c:forEach var="item" items="${corporateActionsLists }" >
                                        <li >
                                            <c:url value="/web/news/newsParticular/n_id_${item.id}/news_type_${item.newsType}.html" var="tempNewsUrl"></c:url>
                                            <a href="${tempNewsUrl} ">${item.newsTitle }</a><span>发布时间:<i><fmt:formatDate value="${item.releaseTime }" pattern="yyyy-MM-dd"/></i></span>
                                        </li>
                                    </c:forEach>
                                </ul>
                            </div>
                            <div class="news-con2">
                                <p>行业新闻</p>
                                <ul>
                                    <c:forEach var="item" items="${tradeNewsLists }" >
                                        <li>
                                            <c:url value="/web/news/newsParticular/n_id_${item.id}/news_type_${item.newsType}.html" var="tempNewsUrl"></c:url>
                                            <a href="${tempNewsUrl}">${item.newsTitle }</a><span>发布时间:<i><fmt:formatDate value="${item.releaseTime }" pattern="yyyy-MM-dd"/></i></span>
                                        </li>
                                    </c:forEach>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
      </body>

  • 相关阅读:
    一句话说明分布式与集群的区别以及什么是分布式集群
    docker Unhandled exception: Filesharing has been cancelled
    sqlserver查询数据的所有表名和行数
    docker push失败:denied: requested access to the resource is denied
    windows docker 共享文件权限设置
    ubuntu 16.4 docker 镜像加速
    fastreport 旋转 竖排
    基于Huggingface使用BERT进行文本分类的fine-tuning
    基于Embedding深度学习算法综述
    机器学习基础知识
  • 原文地址:https://www.cnblogs.com/yang1018/p/9072898.html
Copyright © 2011-2022 走看看