jsp页面中某个src,如某个iframe的src,应该填写什么?可以是html、jsp、servlet、action吗?是如何加载的?
2016-08-10 10:47
861 查看
jsp页面中某个src,如某个iframe的src,应该填写什么?可以是html、jsp、servlet、action吗?是如何加载的?
如有个test工程,其某个jsp中有个iframe,代码如下:
<div class="tc1" style="padding-left: 10px">
<iframe src="${contextpath}/main/getIframeJsp" width="220" height="120px" marginwidth="1" marginheight="1" name="test" id="test" border="0" frameborder="0"></iframe>
</div>
iframe的src为:${contextpath}/main,完整链接为http://127.0.0.1:8080/test/main/getIframeJsp
===1可以是html 2可以是其他工程的html==
参考链接:http://www.w3school.com.cn/tags/att_iframe_src.asp
src 属性规定在 iframe 中显示的文档的 URL。
规定显示在 iframe 中的文档的地址。
可能的值:
绝对 URL - 指向其他站点(比如 src="www.example.com/index.html")
相对 URL - 指向站点内的文件(比如 src="index.html")
===可以是本工程或者其他工程的,action、servlet==
参考链接:http://zhidao.baidu.com/link?url=SgvyO2Hj2b9AQbSmRmOPspYLMNqw_6XpiQY2VwiYLj8yG08dkOk-l4HF7A7nB9ZeSRGsuZDjJMvp5Aw4RuAVd3YIrb0xhQfXUF9vj55sbg7
答:可以的。
设置iframe的src=‘xxxxx / yyy.do’,在对应servlet中,类似下面写法跳转:request.getRequestDispatcher("/a/b.jsp").forward(request,response);
===总结
可以理解为,src是一个url请求,如这个:<div class="tc1" style="padding-left: 10px">
<iframe src="${contextpath}/main/getIframeJsp" width="220" height="120px" marginwidth="1" marginheight="1" name="test" id="test" border="0" frameborder="0"></iframe>
</div>
src是http://127.0.0.1:8080/test/main/getIframeJsp,其执行的过程跟在浏览器中输入http://127.0.0.1:8080/test/main/getIframeJsp的执行过程一样,执行test工程mainAction类的getIframeJsp方法,并将执行结果在iframe位置显示。
如有个test工程,其某个jsp中有个iframe,代码如下:
<div class="tc1" style="padding-left: 10px">
<iframe src="${contextpath}/main/getIframeJsp" width="220" height="120px" marginwidth="1" marginheight="1" name="test" id="test" border="0" frameborder="0"></iframe>
</div>
iframe的src为:${contextpath}/main,完整链接为http://127.0.0.1:8080/test/main/getIframeJsp
===1可以是html 2可以是其他工程的html==
参考链接:http://www.w3school.com.cn/tags/att_iframe_src.asp
src 属性规定在 iframe 中显示的文档的 URL。
规定显示在 iframe 中的文档的地址。
可能的值:
绝对 URL - 指向其他站点(比如 src="www.example.com/index.html")
相对 URL - 指向站点内的文件(比如 src="index.html")
===可以是本工程或者其他工程的,action、servlet==
参考链接:http://zhidao.baidu.com/link?url=SgvyO2Hj2b9AQbSmRmOPspYLMNqw_6XpiQY2VwiYLj8yG08dkOk-l4HF7A7nB9ZeSRGsuZDjJMvp5Aw4RuAVd3YIrb0xhQfXUF9vj55sbg7
问: iframe中的src能否是servlet,再将servlet跳向的jsp显示在iframe中?
答:可以的。设置iframe的src=‘xxxxx / yyy.do’,在对应servlet中,类似下面写法跳转:request.getRequestDispatcher("/a/b.jsp").forward(request,response);
===总结
可以理解为,src是一个url请求,如这个:<div class="tc1" style="padding-left: 10px">
<iframe src="${contextpath}/main/getIframeJsp" width="220" height="120px" marginwidth="1" marginheight="1" name="test" id="test" border="0" frameborder="0"></iframe>
</div>
src是http://127.0.0.1:8080/test/main/getIframeJsp,其执行的过程跟在浏览器中输入http://127.0.0.1:8080/test/main/getIframeJsp的执行过程一样,执行test工程mainAction类的getIframeJsp方法,并将执行结果在iframe位置显示。
相关文章推荐
- jsp页面中某个src,如某个iframe的src,应该填写什么?可以是html、jsp、servlet、action吗?是如何加载的?
- java web开发中,jsp使用了frameset框架,如何实现整个页面跳转,并且同一个表单中可以提交两个action
- 如何在页面加载完成后再去做某事?什么方法可以判断当前页面加载已完成?
- JSP页面加载直接跳转到Servlet,以及html页面加载跳转到另一个页面
- html嵌套iframe如何实现等iframe页面加载完进行下一步调用
- 如何在加载JSP页面时,同时调用servlet中的方法
- 高性能web开发 - 如何加载JS,JS应该放在什么位置?
- struts2中action如何获取jsp页面参数
- action中的list在JSP页面如何显示问题的总结
- struts2中action如何获取jsp页面参数
- 高性能web开发 如何加载JS,JS应该放在什么位置?
- 如何加快HTML页面加载速度
- 高性能web开发 - 如何加载JS,JS应该放在什么位置?
- servlet2.4与jsp2.0之前jsp页面中如何解析EL
- 网站性能优化-如何加载JS,JS应该放在什么位置?
- 高性能web开发 - 如何加载JS,JS应该放在什么位置?
- 高性能web开发 - 如何加载JS,JS应该放在什么位置?
- html页面中,表格数据可以固定表头,表数据部分做滚动条显示,如何实现
- 可以自动跳转到出错页面的servlet/jsp框架
- struts2中action如何获取jsp页面参数