`
blues1021
  • 浏览: 135518 次
  • 性别: Icon_minigender_1
  • 来自: 南宁
社区版块
存档分类
最新评论

Struts中的Action二次请求不认路径../的解决方法

    博客分类:
  • SSH
 
阅读更多

地址栏没有了项目名称:http://localhost:8088/searchBuildingInfo.do?method=searchBuildingInfo2
报错:
Apache Tomcat/6.0.13 - Error report
<h1 font-familytahomaarialsans-serifcolorwhitebackground-colordfont-sizepx h font-familytahomaarialsans-serifcolorwhitebackground-colordfont-sizepx h font-familytahomaarialsans-serifcolorwhitebackground-colordfont-sizepx body font-familytahomaarialsans-serifcolorblackbackground-colorwhite b font-familytahomaarialsans-serifcolorwhitebackground-colord p font-familytahomaarialsans-serifbackgroundwhitecolorblackfont-sizepxa color blackaname color blackhr color d-->--&lt;

HTTP Status 404 - /searchBuildingInfo.do


type Status report

message /searchBuildingInfo.do

description The requested resource (/searchBuildingInfo.do) is not available.


Apache Tomcat/6.0.13

<!--从管理员页面查询进入searchhouseinfo.jsp页面后使用相同的:-->
<a href="http://jeromecen1021.blog.163.com/blog/.. /searchBuildingInfo.do?method=searchBuildingInfo2">更多楼盘信息</a>型路 径出错。
<!--项目布局如下:-->

2011年06月25日 - JeromeCen - JeromeCen

 解决办法:这样的问题猜想是struts中的path路径或代码中变量名称的错误,后面将:
<a href="http://jeromecen1021.blog.163.com/blog/../searchBuildingInfo.do?method=searchBuildingInfo2">更多楼盘信息</a>
后面尝试改为了:
 <a href="http://jeromecen1021.blog.163.com/blog /${pageContext.request.contextPath} /searchBuildingInfo.do?method=searchBuildingInfo2">更多楼盘信息</a>
或者使用项目名称绝对路径,都是无法解决。
最后是将其改为:
<html:link page="/searchBuildingInfo.do?method=searchBuildingInfo2">更多楼盘信息</html:link>
将问题解决,
为何第一次action跳转使用../path.do?可以实现跳转,而跳转后再使用就无法实现正确的解析action路径?那是因为struts用do请求跳转后第二次不能处理../的缘故。
这时改用struts标签可以从跳转后的文件夹里面的jsp文件实现正确的解析actio路径。

当然合理的使用/Unity3dHouse4/${pageContext.request.contextPath}/**.do?还是可以实现的。

分享到:
评论

相关推荐

    filedown-struts2.rar_../../../etc/passwd_../../etc/passwd_../etc

    struts2技术的文件下载程序,filedown-struts2轻量级demo应用

    struts-2.1.8.1-src.zip

    Apache Struts Copyright 2000-2007 The Apache Software Foundation This product includes software developed by The Apache Software Foundation (http://www.apache.org/). Dojo (http://dojotoolkit.org/). ...

    struts-2.3.15.3-apps.zip

    Apache Struts Copyright 2000-2011 The Apache Software Foundation This product includes software developed by The Apache Software Foundation (http://www.apache.org/). Dojo (http://dojotoolkit.org/). ...

    struts2.1.6+spring2.0+hibernate3.2常用配置包

    spring版本有2.0,2.5的,hibernate版本较多些至3.2,首先选版本就选择最优的,struts2没的选只有2.1.6版的,所以先导入struts2支持,然后是spring选的是2.0,问题就出在struts2中spring的插件上了,没有从MyEclipse...

    struts2-core-2.3.15.3.jar

    Apache Struts Copyright 2000-2011 The Apache Software Foundation This product includes software developed by The Apache Software Foundation (http://www.apache.org/). Dojo (http://dojotoolkit.org/). ...

    struts-2.5.13-docs

    Apache Struts Copyright 2000-2011 The Apache Software Foundation This product includes software developed by The Apache Software Foundation (http://www.apache.org/). Dojo (http://dojotoolkit.org/). ...

    Struts2漏洞检查工具2019版 V2.3.exe

    Struts2漏洞检查工具2019版 警告: 本工具为漏洞自查工具,请勿非法攻击他人网站!...S2-005 CVE-2010-1870 Struts 2.0.0-2.1.8.1 http://struts.apache.org/release/2.2.x/docs/s2-005.html 未添加,S2-016范围内

    JBPM4.3 整合SSH part1 JBPM4.3 整合 struts2 hibernate spring 请假实例

    JBPM4.3 整合struts2 hibernate spring 请假实例, lib下载,在我的另外资源,路径: http://download.csdn.net/source/2485359 http://download.csdn.net/source/2485373 http://download.csdn.net/source/2485385 ...

    Struts2漏洞检查工具2018版.exe

    增加安恒信息研究员nike.zheng发现的S2-045,jakatar处理复杂数据类型时,异常处理不当,导致OGNL代码执行,通过在请求的Content-Type头中构造OGNL表达式来执行Java代码。http://struts.apache.org/docs/s2-045.html...

    Struts2.rar

    S2-046 CVE-2017-5638 Struts 2.3.5-2.3.31,Struts 2.5-2.5.10 http://struts.apache.org/docs/s2-046.html 和S2-045一样 S2-045 CVE-2017-5638 Struts 2.3.5-2.3.31,Struts 2.5-2.5.10 ...

    Struts2升级到2.5.30,问题解决及过程记录

    Struts2升级到2.5.30,问题解决及过程记录, 文章详见:https://blog.csdn.net/sinat_36743893/article/details/124582101

    commons-dbcp-1.2.1.jar commons-pool-1.3.jar struts-legacy.jar

    commons-dbcp-1.2.1.jar commons-pool-1.3.jar struts-legacy.jar

    搭建struts2框架

    struts2框架的详细搭建 &lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" ... &lt;/action&gt; &lt;/package&gt; &lt;/struts&gt;

    struts2实例 学生信息管理系统

    &lt;/action&gt; &lt;action name="delete" class="cn.fjnu.edu.action.AddAction" method="deletestu"&gt; &lt;result name="success"&gt;list.jsp&lt;/result&gt; &lt;/action&gt; &lt;action name="update" class=...

    struts2中json依赖包

    logging-1.1.1.jar/ezmorph-1.0.6.jar/freemarker-2.3.22.jar/javassist-3.11.0.GA.jar/json-lib-2.4-jdk15.jar/log4j-api-2.2.jar/log4j-core-2.2.jar/ognl-3.0.6.jar/struts2-core-2.3.24.jar/xwork-core-2.3.24....

    用户注册和登录是每个系统的必须存在的一部分,基于Dwr+Struts2+Spring+Hibernate写了一个用户登录注册系统

     压缩文件中不包含Jar文件(由于全部的Jar将近12M,不能全部上传),所用到的Jar目录为,工程中再也不会出现由于MyEclipse自动整合而出现的大量Jar文件 : Java代码 1. //如果不用,启动时不会出错,但使用Dwr时,会...

    org.apache.struts缺少所需包

    import org.apache.struts.action.ActionForm;import org.apache.struts.action.ActionForward;import org.apache.struts.action.ActionMapping;import org.apache.struts.actions.DispatchAction等缺少

    struts2配置2.5版

    &lt;constant name="struts.devMode" value="true" /&gt; &lt;package name="default" namespace="/" extends="struts-default"&gt; &lt;action name="helloworld" class="com.mytest.HelloWorldAction"&gt; &lt;result&gt; /result....

    Spring4.0+Hibernate4.0+Struts2.3整合案例

    Spring4.0+Hibernate4.0+Struts2.3整合案例:实现增删改查。... 可以解决办法是:当方法不需要事务支持的时候,使用 Session session = sessionFactory.openSession()来获得Session对象,问题解决!

    quartz2.2/struts2/spring的整合demo

    quartz2.2/struts2/spring的整合demo,包含一个job和多个job的创建,已经测试过了,可以使用........ quartz2.2/struts2/spring的整合demo,包含一个job和多个job的创建,已经测试过了,可以使用........ quartz2.2/...

Global site tag (gtag.js) - Google Analytics