使用隐藏的iframe提交数据 [英] Use hidden iframe to submit data

查看:88
本文介绍了使用隐藏的iframe提交数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要向servlet提交一些信息。提交此信息后,我将根据数据从servlet收到PDF。我知道我可以使用HTTP GET构造URL并将参数传递给它。假设我的表单数据太大。那么使用隐藏的iFrame可以做到这一点吗?我将使用隐藏的iFrame提交参数,在我的servlet中,我将PDF写入响应流。这会有用吗?如果有效可以有人请建议我怎么做?

I need to submit some information to my servlet. Once I submit this information, I'll receive a PDF from the servlet based on the data. I know I can construct the URL and pass parameters to it using HTTP GET. Suppose my form data is too large.So is it possible to do this using a hidden iFrame? I'll submit the parameters using the hidden iFrame and in my servlet, I write the PDF to the response stream. Will this work? If it works can someone please suggest me how to do this?

推荐答案

你需要将目标设置为iframe你想要提交给。

You'll need to set the target to the iframe you want to submit it to.

<form action='...' name='theform' target='theiframe'>
  . 
  .
  .
  <iframe name='theiframe' src='...'> 
  </iframe>
</form>

此论坛帖子有一些细节: http://forums.powweb.com/showthread.php?t=77213

This forum post has some details : http://forums.powweb.com/showthread.php?t=77213

这篇关于使用隐藏的iframe提交数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆