Solved

Pass xml file as string to jsp file

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

743 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now