aspose file tools*
The moose likes Struts and the fly likes Sending and receiving xml files using struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Sending and receiving xml files using struts" Watch "Sending and receiving xml files using struts" New topic
Author

Sending and receiving xml files using struts

Kwstas Gewrgiadis
Greenhorn

Joined: Apr 04, 2011
Posts: 2
Hello everyone,

This is my first post.I have some questions regarding struts and xml.
I want to create a web application that sends and receives xml files.
What's the best possible way?I haven't found much regarding a specific question.
We make a request to a remote server by posting some parameters(not xml,but some parameters) and the server replies with an xml string.
And here lies my question:
i)How can I get this xml?
The xml is in string format,therefore I can get it with setter and getter.However the problem is that I do not know the name of the string in order to catch it with a getter.
ii)what's the best possible way to handle xml exchange using struts?

Thanks in advance
xsunil kumar
Ranch Hand

Joined: Dec 14, 2009
Posts: 129
Web service is better option to sending XML over HTTP. But any how you are using Struts. then you can save that XML as string in one object and that object you can store in request/ session.

On Jsp you can get that String which is nothing but a xml.

-Sunil
Kwstas Gewrgiadis
Greenhorn

Joined: Apr 04, 2011
Posts: 2
Hello Sunil,

Thanks for the response.
I'm sorry ,I do not quite follow.Let me give you an example:

I have an action which posts input data to one of my actions.There,I get these input parameters with setters(extends ActionSupport) and afterwards I post them to a known url with getters
via an shtml form(basically with a .vm file,I use velocity).Everything works perfect until this point.
Then the server response to my page sending an xml string.How can I get this?
You said to save it as a string in one object.But how?I do not know the name of that string.
I'm sorry if I don't understand something.
Could you please provide me with a small example?

Thanks again for your reply.

Kwstas
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Sending and receiving xml files using struts
 
Similar Threads
Private/Public DSA key question
Reflection in Webservice ?`Beginner's question
.net client invoking java code on server
Just took the IBM 000-142 assessment test for $30 - and passed.
Prepared JDBC statements in Servlets?