如题,struts.xml
<action name="index" method="memberCenter" class="cms.xx">
<result>/WEB-INF/template/default/user/index.html </result>
</action>这个user文件夹下有index.html,有right.html
在这个index.html中<iframe src="right.html"></iframe>如果直接用ie打开这个index.html,是正常的,但如果用struts2来返回到这个页面上,iframe中显示您所访问的页面不存在。请问为什么?应该怎样解决?谢谢。
<action name="index" method="memberCenter" class="cms.xx">
<result>/WEB-INF/template/default/user/index.html </result>
</action>这个user文件夹下有index.html,有right.html
在这个index.html中<iframe src="right.html"></iframe>如果直接用ie打开这个index.html,是正常的,但如果用struts2来返回到这个页面上,iframe中显示您所访问的页面不存在。请问为什么?应该怎样解决?谢谢。
解决方案 »
- 求助struts2 配置的action路径找不到
- struts+ibatis在tomcat下做的项目,后来需要打成war包部署到websphere,结果报错,错误如下,紧急求助:
- 写了一个表格却没有办法控制它的宽度让他适应屏幕宽度
- 求高手将C#代码转换为Java代码,关于获取网页信息的代码,一些C#中的类不知道如何对应Java类
- struts 做一个更新功能 JSP页面中用了个的 link 到 action里做更新....更新完成之后回到页面, 想弹出来一个对话框,显示更新成功,该怎么做?
- 那位朋友能提供 一下JSP2.0技术手册的8-18章
- 在线等:如何在jsp文件中获得另一个jsp文件中的select表单的参数?
- 关于jsp的问题,谢谢
- javabean传递参数
- 页面中取不到班级的值
- 项目中的事务处理,急急急!!!
- 急!JSP连接数据库判断用户是否存在
<action name="index" method="memberCenter" class="cms.xx">
<result>/WEB-INF/template/default/user/index.html </result>
</action>
<action name="right" method="memberCenter" class="cms.xx">
<result>/WEB-INF/template/default/user/right.html </result>
</action> 2.Jsp写法:
index.html中 <iframe src="right.action"> </iframe>
假如你是http://localhost:8080/test/abc.action访问
虽然struts能根据配置文件找到index.html
但是index.html页面的相对路径会去找http://localhost:8080/test/下的页面。
这种方式最好是使用绝对路径,就不会出问题
感谢帮忙,如果只包个静态的html,也需要二次请求吗?
路径有问题。
根据你的 struts namespace="/"有关系。好好在看看。
<result>/template/default/user/index.html </result>
</action>这样配就好了
这个写法是错误的
默认是不能够访问web-inf下面的文件的
要访问必须要将路径写全