如何在jsp中将一个表单数据发送到多个网页? [英] How to send one form data to multiple webpages in jsp?

查看:137
本文介绍了如何在jsp中将一个表单数据发送到多个网页?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!我希望你会帮助我,但它太紧急我需要尽可能快的解决方案。

我的问题是:

i有一个项目,它的网页是:index .jsp,project.jsp,performance.jsp和teacher.jsp

有一个表格

< form name =myFormaction =method =Post >

输入您的ID:< input type =textname =id>

输入您的姓名:< input type =text name =FirstName>

< input type =submitvalue =submit>

< / form>



如何在其他所有网页上发送或显示数据,因为它们是project.jsp,performance.jsp和teacher.jsp

有什么办法,所以请尽快帮助我。在此先感谢

解决方案

表单提交的HTTP请求只包含一个由属性 action 定义的URL。例如,如果您的代码示例,则无法发送表单数据;它的提交按钮将无效。 :-)



发送一些具有多个URL的相同请求(为什么?为什么?!不会因为您网站设计不当而导致滥用?) ,您可以使用Ajax:

http://en.wikipedia.org/wiki/ Ajax_%28programming%29 [ ^ ],

http://www.adaptivepath.com/ideas/ ajax-new-approach-web-applications [ ^ ],

http:// www。 dmoz.org/Computers/Programming/Languages/JavaScript/Ajax [ ^ ],

http://www.xul.fr/en-xml-ajax.html [ ^ ]。



发送HTTP请求使用Ajax,您将不需要任何表单。只需从一组控件中选择一些数据,形成一个HTTP请求,然后在循环中多次发送,在每次迭代中只更改URL。



< DD> -SA

Hello Guys! i hope you will help me, but its too much urgent i need the solution as quick as possiple.
My problem is:
i have a project its web pages are: index.jsp, project.jsp, performance.jsp and teacher.jsp
there is a form
<form name="myForm" action="" method="Post">
Enter your Id:<input type="text" name="id">
Enter your Name:<input type="text" name="FirstName">
<input type="submit" value="submit">
</form>

How want to send or show the data on other all webpages, as they are project.jsp, performance.jsp and teacher.jsp
is there any way, so plz help me as quickly as possible. Thanks in advance

解决方案

A form submits an HTTP request with just one URL defined by the attribute action. For example, in case if your code sample, you send your form data nowhere; its submit button will have no effect. :-)

To send some identical request with multiple URLs (why? why?! won't it be just the abuse due to bad design of your site?), you can use Ajax:
http://en.wikipedia.org/wiki/Ajax_%28programming%29[^],
http://www.adaptivepath.com/ideas/ajax-new-approach-web-applications[^],
http://www.dmoz.org/Computers/Programming/Languages/JavaScript/Ajax[^],
http://www.xul.fr/en-xml-ajax.html[^].

To send an HTTP request using Ajax, you won't need any form. Just pick some data right from some set of control, form an HTTP request, and send it several times in a loop, in each iteration changing only the URL.

—SA


这篇关于如何在jsp中将一个表单数据发送到多个网页?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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