473,474 Members | 1,669 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

send XML Request string using POST

The JSP page needs to send XML request string to another JSP page when the
user clicks submit button, I wonder how to get started because when user
click submit button, it will send the form to page2.jsp.

<form action="page2.jsp" method="POST">
Name: <input type="text" name="fname">
//etc.. controls
<input type="submit">
</form>
Jul 20 '05 #1
2 10297


Matt wrote:
The JSP page needs to send XML request string to another JSP page when the
user clicks submit button, I wonder how to get started because when user
click submit button, it will send the form to page2.jsp.

<form action="page2.jsp" method="POST">
Name: <input type="text" name="fname">
//etc.. controls
<input type="submit">
</form>


I am not sure what the problem is, in page2.jsp you want to build an XML
request string and post it to another page?

If you expect the browser to build an XML request then you would neeed
XForms not HTML forms.
--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2
You can create XML (a JDOM Element) right from the request object ...
<%@ page import="java.util.Enumeration"%>
<%@ page import="org.jdom.Element"%>
<%!

public Element Create( HttpServletRequest request )
{
Element command = new Element("xml_data");
Enumeration enum = request.getParameterNames();
while ( enum.hasMoreElements() ) {
String sKey = (String) enum.nextElement();
String [] temp = (String[]) request.getParameterValues(sKey);
int iLen = temp.length;
for ( int j=0 ; j < iLen ; j++ ){
String sVal = temp[j] ;
String sName = sKey;
command.addContent(new Element(sName).addContent(sVal));
}
}
return command;
}
%>
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Kassam | last post by:
Hi MVPs out there. I have constructed an order form and the users will enter the informtion. I now need to send the filled out form as an e-mail (body being the HTML with the fille din data) to...
1
by: malborg | last post by:
I have simple form in PHP with two input types as text to input login name and password.PS: They use POST method. (index.php) The other script(logowanie.php) checks if login and password is...
6
by: DigitalRick | last post by:
I have been running CDONTS in my ASPpages to send emails to me sent from my guestbook. It had been working fine untill I upgraded to Server 2003 (I am also running Exchange 2003) all locally. I...
2
by: Fatih BOY | last post by:
Hi, I want to send a report from a windows application to a web page like 'report.asp' Currently i can send it via post method with a context like local=En&Username=fatih&UserId=45&Firm=none...
3
by: ME | last post by:
Hi; I am getting "Unhandled Exception: System.Net.WebException: The remote server returned an erro r: (401) Unauthorized." when I am trying to get a page via post. Code follows...
1
by: khawar | last post by:
the following code seams to be sending a silent post. how can we not make it send a silent post but regular post where along with the post the control should also be transferred over to the other...
9
by: eswanson | last post by:
I have a web page I need to post a file plus some other fields to it. How can I do this from a asp.net page. I know I can send individual fields to the other page, but how do I send a file to the...
2
by: Andrew Hunot | last post by:
I have VB code in VS2003 which creates a HttpWebRequest and performs a POST operation to a remote URL (an https site), which runs fine and receives a valid response. However exactly the same...
3
by: keith.schincke | last post by:
I know I must be missing something basic. I am developing of Firefox 1.5 and am trying to to send a basic QUERY_STRING to a test CGI that will print the data back to the brower: I can print my...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.