Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Pass xml file as string to jsp file

Posted on 2006-06-12
2
Medium Priority
?
323 Views
Last Modified: 2006-11-18
HI,

I have a client based javascript ap, that parses an xml file.

It is something simple, but will grow... xml file

<type>
  <default>test1</default>
  <next>testing</next>
  <next>tests</next>
  </type>
- <type>
  <default>test2</next>
  <next>tested</next>
  <next>tester</next>
  </type>

I put this in a string but how do i send it to my simple jsp file so that it will then be saved on the server machine? The file will grow... so also thinking wont be able to go on the url after a few months.

My jsp file.

<%@ page language="java" %>
<%@ page import="java.io.*" %>
<%

try {
              String xmlparam= request.getParameter( "xmlparam" ); //tried various ways of passing and did not work.... this was one option
              
              BufferedWriter output = new BufferedWriter(new FileWriter("c:\\gbdafda.xml"));
              output .write(xmlparam); //can't get this to work...
              output .close();
          } catch (IOException e) {
          }
 
 
 
  %>

thanks
0
Comment
Question by:wilflife
2 Comments
 
LVL 4

Expert Comment

by:pablomorales
ID: 16889339
How are you posting the data to the server?
0
 
LVL 28

Accepted Solution

by:
rrz earned 1500 total points
ID: 16890038
pablomorales, has brought up a good point. You should change to post method for your form.  Or you could change to  enctype='multipart/form-data'  and FileUpload  see  http://jakarta.apache.org/commons/fileupload/  if you are really starting with a file at the client.  
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post, I will showcase the steps for how to create groups in Office 365. Office 365 groups allow for ease of flexibility and collaboration between staff members.
Today as you open your Outlook, you witness an error message: “Outlook is using an old copy of your Outlook Data File…”. Probably, Outlook is accessing an old OST file.
Integration Management Part 2
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

783 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question