Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java HDIV始终重定向到错误页面,错误HDIV_参数不存在_Java_Spring_Spring Security_Hdiv - Fatal编程技术网

Java HDIV始终重定向到错误页面,错误HDIV_参数不存在

Java HDIV始终重定向到错误页面,错误HDIV_参数不存在,java,spring,spring-security,hdiv,Java,Spring,Spring Security,Hdiv,我正在尝试将HDIV实现到Spring3.1应用程序中 我在pom文件中添加了依赖项,在web.xml文件中添加了侦听器和过滤器 我已经完成了如图所示的配置,当我访问应用程序时,欢迎页面正在加载,但在此之后,如果我从屏幕访问任何链接,它将重定向到errorpage 我得到的错误是“HDIV_参数不存在” 有什么问题吗 如何在请求中发送HDIV参数。我是否需要修改JSP以在请求中发送HDIV参数 web.xml: <listener> <listener-cla

我正在尝试将HDIV实现到Spring3.1应用程序中

我在pom文件中添加了依赖项,在web.xml文件中添加了侦听器和过滤器

我已经完成了如图所示的配置,当我访问应用程序时,欢迎页面正在加载,但在此之后,如果我从屏幕访问任何链接,它将重定向到errorpage

我得到的错误是“HDIV_参数不存在”

有什么问题吗

如何在请求中发送HDIV参数。我是否需要修改JSP以在请求中发送HDIV参数

web.xml:

     <listener>
    <listener-class>org.hdiv.listener.InitListener</listener-class>
    </listener>
<!-- HDIV Validator Filter -->
<filter>
    <filter-name>ValidatorFilter</filter-name>
    <filter-class>org.hdiv.filter.ValidatorFilter</filter-class>
</filter>
<filter-mapping>
    <filter-name>ValidatorFilter</filter-name>
    <!-- Spring MVC Servlet name-->
    <servlet-name>mvc-dispatcher</servlet-name>
</filter-mapping>


    <jsp-config>
         <taglib>
        <taglib-uri>http://www.springframework.org/tags/form</taglib-uri>
        <taglib-location>/WEB-INF/lib/spring-form.tld</taglib-location>
        </taglib>
        <taglib>
              <taglib-uri>http://www.springframework.org/tags</taglib-uri>
              <taglib-location>/WEB-INF/lib/spring.tld</taglib-location>
        </taglib>
         <taglib>
          <taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>
               <taglib-location>/WEB-INF/lib/hdiv-c.tld</taglib-location>
    </taglib>
</jsp-config>

您必须使用JSTL或Spring标记来创建URL:

<c:url value="/datedflight/DatedFlightSearch.htm">



否则,HDIV不能将状态标识作为参数

请您发布jsp页面的代码(部分),其中包含重定向到错误页面的链接。@拉尔夫:请查找上面的代码。我在此jsp中找不到任何链接或表单。-我要求的页面(A)包含指向另一个未显示页面(B)的链接。(A)页是我要求的。从index.jsp单击datedflight搜索链接时,它将被重定向到控制器方法datedflight SearchScreen()并加载datedflight search.jsp。现在屏幕上的datedFlightSearch.jsp没有加载,因为我预计会出现一个错误,您需要在链接url的cration中加入一些HDIV功能。即使在添加spring:url之后,也会发生同样的情况。在ValidatorHelperRequest类的restoreState(HttpServletRequest请求,字符串目标)方法中,request.getParameter(hdivParameter)返回Null
<hdiv:config excludedExtensions="css,png,gif,jpeg,jpg,js" errorPage="/errorPage.jsp">
<hdiv:startPages>/,/index.htm</hdiv:startPages>
</hdiv:config> 

<!-- Accepted pattern within the application for all editable parameters (generated from textbox and textarea) -->   
<hdiv:validation id="safeText">         
<hdiv:acceptedPattern><![CDATA[^[a-zA-Z0-9@.-_]*$]]></hdiv:acceptedPattern>     
</hdiv:validation>       
<!-- Finally, it's necessary to define editable data validation for the application -->    
<hdiv:editableValidations>         
<hdiv:validationRule url="/.*">safeText</hdiv:validationRule>     
</hdiv:editableValidations>
        <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
    <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
    <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
    <html>
      <head>
      <title>Freight Management Tool</title>
      </head>
      <body  topmargin="0" leftmargin="0" >


    <div id="header">
        <%@include file="header.jspf"%>  
    </div> 
    <div id="content"> </div>
        <table width="100%" cellpadding="0" cellspacing="0" border="0">
            <tr class="topHeading">
                <td>
                <% if (request.isUserInRole("FMT_ADMIN")) { %>
                    <spring:message code = "index.admin"/>
                <% } if (request.isUserInRole("FMT_NM")) { %>
                    <spring:message code = "index.network.mngt"/>
                <% } if (request.isUserInRole("FMT_RM")) { %>
                    <spring:message code = "index.revenue.mngt"/>
                <% } if (request.isUserInRole("FMT_SALES")) { %>
                    <spring:message code = "index.sales"/>
                <% } %>
                </td>
                <td></td>
            </tr>
        </table>
        <table width="100%" cellpadding="0" cellspacing="0" border="0">
            <br/>
            <% if (!request.isUserInRole("FMT_SALES")) { %>
            <tr>
                <td width="2%"></td>
                <td width="15%" class="blackHeading"><spring:message code = "index.welcome"/> <h1><a href="/cargoalflights/SearchCargoalFlightMaster.htm"><spring:message code = "index.cargoal.search"/></a></h1></td>
                <td width="63%"></td>
            </tr>
            <% } else {%>
            <tr>
                <td width="2%"></td>
                <td width="15%" class="blackHeading"><spring:message code = "index.welcome"/> <h1><a href="/datedflight/DatedFlightSearch.htm"><spring:message code = "index.dated.flight.search"/></a></h1></td>
                <td width="63%"></td>
            </tr>
            <% } %>

        </table>

  </body>
</html>
@RequestMapping("/datedflight/DatedFlightSearch.htm")
public ModelAndView datedFlightSearchScreen() {
return new ModelAndView("datedFlightSearch", "datedFlightDTO",
            datedFlightDTO);
}
<c:url value="/datedflight/DatedFlightSearch.htm">
<spring:url value="/datedflight/DatedFlightSearch.htm">