Solved

Pass xml file as string to jsp file

Posted on 2006-06-12
2
303 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

Technology Partners: 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

Title # Comments Views Activity
JSP Popup page 2 158
JSONSerializer.toJSON in JSP generating error 8 89
Books that can get me started on JAVA 2 117
web application structure 18 112
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Read our guide on how to survive being on-call.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

756 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