Solved

Pass xml file as string to jsp file

Posted on 2006-06-12
2
306 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 4

Expert Comment

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

Accepted Solution

by:
rrz earned 500 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

We asked our MSP customer base what their favorite tools were and how they help them serve clients. We focused our questions on favorite tools in the following categories: >PSA tools >RMM tools >Alert management tools >Communication tools and Mo…
Deploying our service is a grudge match between customer benefits and customer pain. In one corner, rolling out fixes (yay!) and delivering new features (double yay!). In the other corner, training on new features (boo – sounds like work), and chan…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Suggested Courses

710 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