就是在Struts中如何得到在action中设定的地址

解决方案 »

  1.   

    我在action中是这样设定的:
    <action path="/index"
            forward="index.jsp"/>我在地址栏输入:http://localhost:8080/index.html
    我的index.jsp:
    <%out.println("Request  URI:"+request.getRequestURI());%>但得到的是: Request  URI:/index.jsp
    而不是:Request  URI:/index.html
      

  2.   

    request.getRequestURI()  ==> request.getHeader("Referer");
      

  3.   

    Request  URI:null
    为什么啊????
      

  4.   

    index.html
    <a href="/index.jsp">index.jsp</a>indexAction.java
    ...
    String url = request.getHeader("Referer");
    System.out.println(url);
      

  5.   

    index.html我是在action中做的影射,并没有这个文件啊!郁闷,请帮忙!