How to send/receive XML using JSP

Hi,
I'm new to all this JSP/XML stuff so apologies if this is trivial.
I'm trying to send an XML file via HTTP POST using JSP. Anyone know how to do this?
Once the XML has been sent, how do you use JSP to request the XML file? I've figured out how to parse it already.
Also, is it possible to call xsql directly within JSP?
Thanks!

I'm trying to send an XML file via HTTP POST using JSP. Anyone know how to do this?The question is, does anybody understand what you mean by this. Let me take a guess. You want to upload an XML file to a server. If this guess is right, then the answer is don't use JSP to do that. JSP is for generating output to be sent to a client. Use a servlet to handle an upload. And you don't need to write it yourself, there are already several file-upload servlets available on the web.
Second guess: you have a POST request that asks your server to send an XML file back to the client. If it's a static XML file you don't need a JSP or a servlet or anything, just let your web server handle it just like any other static file. If it's dynamically generated then there's an answer worth giving, but I doubt that this is your question. But if it is, let us know.

Similar Messages

  • How to send E-mails using JSP

    I developed a system where users can login and check for updated information and documents. But the changes are made once or twice in a year. I want to send email after changing the documents. I stored email addresses in the DB. Now the question is how to send e-mails to concerned users without using external software (Outlook, etc.). [Considering same subject and message for all e-mails.]

    Go to Java Mail forum:
    http://forum.java.sun.com/forum.jsp?forum=43

  • [HTTP Sender]How to send different XML using static URL

    Hi all,
    I have a problem, my legacy system send XML messages to SAP XI by HTTP, I know that I need to use HTTP Sender adapter, the problem is that legacy system support only a static URL. I have more than one interface, how could I fix this problem?
    Can I send the XML message to SAP XI without define INTERFACE on URL? How can I handle this?
    Thank in advance,
    Daniel Torres

    Hi Srinivas,
    The legacy system is a java application, that send XML messages to SAP XI server using HTTP protocol. So I just ask to legacy system team to change the application to add <b>server</b>, <b>namespace</b> and <b>interface</b> attributes to the URL querystring.
    So for each XML message you should especify mesage interface that it belongs to. You do it by especifying on URL as message atribute for exemple:
    HTTP://[SAPXISERVER]:80[SYSTEM ID]/sap/xi/adapter_plain?service=[BS SERVICE]&namespace=[MESSAGE INTERFACE NAMESPACE]&interface=[MESSAGE INTERFACE]
    So if you have for example information belows:
    <b>MESSAGE INTERFACE</b> = MI_MYMESSAGEINTERFACE_IB
    <b>MESSAGE INTERFACE NAMESPACE</b> = urn:teste:mymessageinterface
    <b>SERVICE</b> = MY_LEGACY
    <b>SYSTEM ID</b> = 10
    <b>SAPXISERVER</b> = MYSAPXI
    Your url should looks like: http://MYSAPXI:8010/sap/xi/apadter_plain?service=MY_LEGACY&namespace=urn:teste:mymessageinterface &interface=MI_MYMESSAGEINTERFACE_IB
    You should have a different message interface for each XML that you send to SAP XI.
    Message was edited by:
            Daniel Torres
    Message was edited by:
            Daniel Torres

  • How to send different XML using static URL

    Hi Guys,
    I have the problem, my legacy system sends xml messages to XI by HTTP, my legacy system support only a static url http://host:8000/sap/xi/adapter_plain
    I have more than one interface, how did u fix this problem. I need to send xml to XI with out defining INTERFCAE on URL.
    can anybody explain how to handle this issue, help would be really appreciated.
    Thanks,
    k s reddy

    You have two options:
    1. use enhanced receiver determination (but for that, you'll have to use java mapping from input message to receivers), it will only work from 3.0 SP16 / 7.0 SP7;
    2. use a generic interface, where you define all possible message type tags with occurrence 0...1.
    Regards,
    Henrique.

  • How to send a Mail using JSP using browser.

    Dear friends
    I could write a code to send a mail and execute it from a command prompt using a class file, but the same code, I converted into a JSP tags to run from a browser. I am getting compilation error. Can you please help me in solving this problem.
    I am using javamail API 1.3,JAF1.0.2
    Win2000,Websphere 3.5,HostPublisher server 3.5,IE6.0
    I shall be thankful if someone shows me the solution.

    Hello
    I hope that this is useful
    I'm using Tomacat 4.0.4 and J2SDK1.4.0_01
    Setting on conf\Server.xml
    <Resource name="mail/Session" auth="Container"
                        type="javax.mail.Session"/>
              <ResourceParams name="mail/Session">
                <parameter>
                  <name>mail.smtp.host</name>
                  <value>your hostmail server</value>
                </parameter>
              </ResourceParams>Setting on web.inf/web.xml
    <servlet>
        <servlet-name>SendMailServlet</servlet-name>
        <servlet-class>SendMailServlet</servlet-class>
      </servlet>
    <servlet-mapping>
        <servlet-name>SendMailServlet</servlet-name>
        <url-pattern>/SendMailServlet</url-pattern>
      </servlet-mapping>
    <resource-ref>
        <res-ref-name>mail/Session</res-ref-name>
        <res-type>javax.mail.Session</res-type>
        <res-auth>Container</res-auth>
      </resource-ref>jsp page example:
    <html>
    <head>
    <title>Example Mail Sending Form</title>
    </head>
    <form method="POST" action="../../SendMailServlet">
    <table>
      <tr>
        <th align="center" colspan="2">
          Enter The Email Message To Be Sent
        </th>
      </tr>
      <tr>
        <th align="right">From:</th>
        <td align="left">
          <input type="text" name="mailfrom" size="60">
        </td>
      </tr>
      <tr>
        <th align="right">To:</th>
        <td align="left">
          <input type="text" name="mailto" size="60">
        </td>
      </tr>
      <tr>
        <th align="right">Subject:</th>
        <td align="left">
          <input type="text" name="mailsubject" size="60">
        </td>
      </tr>
      <tr>
        <td colspan="2">
          <textarea name="mailcontent" rows="10" cols="80">
          </textarea>
        </td>
      </tr>
      <tr>
        <td align="right">
          <input type="submit" value="Send">
        </td>
        <td align="left">
          <input type="reset" value="Reset">
        </td>
      </tr>
    </table>
    </form>
    </body>
    </html>SendMailServelet.java:
    import java.io.IOException;
    import java.io.PrintWriter;
    import javax.mail.Message;
    import javax.mail.Session;
    import javax.mail.Transport;
    import javax.mail.internet.InternetAddress;
    import javax.mail.internet.MimeMessage;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.servlet.RequestDispatcher;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    public class SendMailServlet extends HttpServlet {
        public void doPost(HttpServletRequest request,
                           HttpServletResponse response)
            throws IOException, ServletException
            // Acquire request parameters we need
            String from = request.getParameter("mailfrom");
            String to = request.getParameter("mailto");
            String subject = request.getParameter("mailsubject");
            String content = request.getParameter("mailcontent");
            if ((from == null) || (to == null) ||
                (subject == null) || (content == null)) {
                RequestDispatcher rd =
                    getServletContext().getRequestDispatcher("/jsp/mail/sendmail.jsp");
                rd.forward(request, response);
                return;
            // Prepare the beginning of our response
            PrintWriter writer = response.getWriter();
            response.setContentType("text/html");
            writer.println("<html>");
            writer.println("<head>");
            writer.println("<title>Example Mail Sending Results</title>");
            writer.println("</head>");
            writer.println("<body bgcolor=\"white\">");
            try {
                // Acquire our JavaMail session object
                Context initCtx = new InitialContext();
                Context envCtx = (Context) initCtx.lookup("java:comp/env");
                Session session = (Session) envCtx.lookup("mail/Session");
                // Prepare our mail message
                Message message = new MimeMessage(session);
                message.setFrom(new InternetAddress(from));
                InternetAddress dests[] = new InternetAddress[]
                    { new InternetAddress(to) };
                message.setRecipients(Message.RecipientType.TO, dests);
                message.setSubject(subject);
                message.setContent(content, "text/plain");
                // Send our mail message
                Transport.send(message);
                // Report success
                writer.println("<strong>Message successfully sent!</strong>");
            } catch (Throwable t) {
                writer.println("<font color=\"red\">");
                writer.println("ENCOUNTERED EXCEPTION:  " + t);
                writer.println("<pre>");
                t.printStackTrace(writer);
                writer.println("</pre>");
                writer.println("</font>");
            // Prepare the ending of our response
            writer.println("<br><br>");
            writer.println("<a href=\"jsp/mail/sendmail.jsp\">Create a new message</a><br>");
            writer.println("</body>");
            writer.println("</html>");       
    }Ciao
    Riccardo

  • How to send an email using XML Publisher

    Can any body help me how to send an email using XML Publisher.
    Regards,
    Suresh

    Sorry ,
    when a http://blogs.oracle.com/xmlpublisher/newsItems/departments/documentDelivery
    this it show this not answer the question.
    Thanks
    Welcome to Oracle Blogs
    Welcome to the Oracle blogging community, where Oracle executives, employees, and non-employees exchange views about customer requirements and best practices.
    We're sorry, the weblog you requested cannot be accessed.
    - You may not have the necessary permission for access the weblog.
    - This weblog does not exist.
    You may wish to try again using one of the tools below.
    - Check the URL and contact your System Administrator for access.
    - Or click here to go back to Oracle Blogs homepage.
    Powered by
    Movable Type and Oracle
    The views expressed on this blog are my own and do not necessarily reflect the views of Oracle. Terms of Use

  • How to send an email in jsp

    hei evryone!
    can anyone pls help me on how to send an email in jsp. I mean i have a webpage wherein you submit data , upon submission or after the submit button is clicked i need to send an email to a person regarding the data sumitted on the form , i dunno how to do this, can anyone please help me on how to use Javamail, or can anyone post a sample code or site of a tutorial .. thx!

    There are some quite good examples on the use of Javamail on the Sun website. No, we're not going to write your application for you, unless you're willing to pay consultancy fees in real money.
    http://java.sun.com/products/javamail/index.jsp
    http://java.sun.com/products/javamail/FAQ.html
    http://java.sun.com/products/javamail/reference/techart/index.html

  • How to send picture message using J2ME sms APIs?

    Hi,
    I experiment with SMS APIs, i successfully send simple text message. now i want to send picture message, how to send picture message using J2ME APIs.
    please guide me.
    guna.

    I experienced in coding sending and receiving sms in J2ME. Besides, I also esperienced in coding reading a binary file in a applicaition jar. But I never done these both together. Hence Im not sure it works or not. Below is the example to open and read a binary file:
    InputStream oInputStream = getClass().getResourceAsStream( "/picture.png" );
    if(oInputStream == null) {
    //File does not exist;
    throw new Exception("File not found");
    //Read the binary file and copy it to a byte array
    byte[] abyPicture = new byte[oInputStream.available()];
    oInputStream.read(abyPicture );

  • HT5225 unable to send receive mail using Mail 2.1.3

    Ever since iCloud took over, I am no longer able to send/receive mail using Mail 2.1.3 on my 10.4.11 version.  I didn't think it would affect it.  Someone please help as to how I can rectify the issue!

    Hi,
    Please review the following note:
    Note: 371830.1 - Notification Mailer Does Not Start, Remains In Status Starting
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=371830.1
    If the above does not help, I suggest you run "Workflow Diagnostics" test and see if it returns any error/warning messages.
    Note: 274764.1 - Oracle Workflow Cartridge Workflow Java Mailer Setup Test
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=274764.1
    Note: 378281.1 - How Does One Verify The Notification Mailer Is Functioning Properly?
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=378281.1
    Regards,
    Hussein

  • I have BIS but can't surf, send/receive email, use apps

    i have BB Curve 8520. My BIS was running smoothly (sending and receiving emails real time and surfing the net through BIS), until i noticed when i tried to reply to an email that came in, it won't send. i noticed that it's fluctuating. i was able to send the email after a few minutes... then a few minutes later, i received a replied email from my friend, and when i tried to send my reply, i wasn't able to. also, i can't surf using the browser with the "internet browser" as default. i tried using my wifi and then suddenly all my emails started coming in, all emails that were not able to go through hours ago. my big question was why do i need to turn on wifi just to receive emails. but since i had my BIS for 2 months now, i can send and receive emails and surf through BIS itself without turning on the wifi.  also, i can't use any of my apps like facebook, twitter, yahoo messenger, etc.  They used to work fine with BIS... but now, i have to turn on the wifi connection, so i could log in with them.  aren't these supposed to be running through BIS only?
    I have GPRS on top, not gprs. my carrier says i have active data plan/BIS. but under Services Status..it says Blackberry Internet Service:  Connection:  not connected...
    so, i wiped out my BB and deleted all third party apps. when this was done, i received emails telling me "Your handheld has been registered with the wireless network" and even got "Activation Server" emails telling me that the emails that i have previously set up are now up and running. so i thought my BB is now ok.. i tried surfing, it was okay. after like about 5 minutes, it was down again. tried sending email but can't... i turned on the wifi and boom! the emails started coming in again.i have the Host Routing Tables and my Service Books in my BB. I have GPRS (not gprs) on top which means i have active BIS.  i have registered my HRTs several times... and resending my service books... same thing...
    the big mystery is when i turn on the wifi, the emails suddenly go through and i can send emails. i can open apps that used to only run on BIS. this is ok i guess, but i could never do any of these if i'm not connected to wifi.
    my sister and i have the same BB... i removed my sim and inserted it to her BB and the BIS worked fine... i was able to surf and use apps.. but when i put my sim back on my phone, the problem still exists.  i even used a different sim card that is also subscribed to BIS/data plan, and it still has the same problem... my guess is my carrier is right that my data plan is working ok and that my handheld itself has the problem... 
    i updated my OS, same problem.. wiped it out... used BBSAK, reinstalled OS... numerous battery pulls... same thing... i can receive the HRTs and service books, but after that can't do anything else like i used to... (send/receive emails, use apps like facebook, twitter, ym, etc., can't surf with internet browser - except when wifi is on everything else work fine even emails and apps).. 
    i would really appreciate your help guys.. thanks!

    Hi tarifiq and welcome to the BlackBerry Support Community Forums!
    Can you send me a private message with your PIN so I can check this out for you?
    Thanks
    -CptS
    Come follow your BlackBerry Technical Team on twitter! @BlackBerryHelp
    Be sure to click Kudos! for those who have helped you.Click Solution? for posts that have solved your issue(s)!

  • How to send meeting invites using Exchange Email Account

    Does anybody know how to send meeting invitations using the 3.0 software update?
    My corporate email is set up with an Exchange ActiveSync account, but I can't figure out how to send meeting invites?
    Is it a function solely of the iPhone 3.0 OS, or is it dependent on the Exchange setup.
    Any insight would be appreciated.
    David

    That is what I was afraid of...the good thing is that is the only feature (besides battery life) that I miss from my Blackberry. Thanks.

  • How to send secure email using JavaMail

    Hi, anyone out there know how to send secure email using Java Mail? Greately appreciated.

    For starters, if you have not already done so, read about it in the JavaMail design specifications.
    Search for Message Security in the said document.

  • How to send CC email using SO_DOCUMENT_SEND_API1

    Hi,
       How to send CC email using SO_DOCUMENT_SEND_API1.  Any sample code is very much appreciated.
    Cheers

    Please check In this function there is a flag in RECEIVERS table for sending mail as COPY or BLIND COPY

  • How to send sms,Email using java

    how to send sms,Email using java

    Hi,
    There are many sms gateways that have their own api to send sms. You can use them for sms. (They will charge you for the sms!!!)
    Moderator edit: Link removed
    Thanks
    Edited by: PhHein on 20.10.2010 16:11

  • Hi can anyone explain me how to  syncronize two database using jsp?

    Hi can anyone explain me how to syncronize two database using jsp?

    I thinking than you really need the jsp page for calling the java methods whith sincronize the database.You think wrong.
    You wrote a bad question.What was bad about it?
    You need a java method for sincronize the two databases using a jsp page.No you don't, see my answer.

Maybe you are looking for