How to call JSP that outputs XML without HTTP request

It should be a simple solution but I can't seem to find a concise recommendation anywhere. We are building a B2B subsytem for our app and we need to send XML to our vendor. I'm evaluating the possibility of using JSPs for that and everything looks good until the time you actually want to invoke it. It's obvious how to code the JSP itself, but I'm looking for an efficient way to call it to generate XML. We do not have an HTTP request or a servlet, the communication is on the EJB level. So I can't get a RequestDispatcher for example, and we don�t have HttpServletRequest/HttpServletResponse either. It is NOT a servlet or JSP calling another JSP, it's a regular Java class or EJB.
Ideally, I would rather bypass the whole HTTP infrastructure and just use JSP as a formatter. So it boils to a question of how to invoke it and how to pass the parameters without HTTP session or request. One of the alternatives we are reviewing is using XSP but we would prefer JSPs if we can figure out how to call it efficiently. HttpUrlConnection is not a good option, we'd like a direct call.
Any suggestions will be greatly appreciated.

Thanks for the response. Let me clarify the requirements for the question. The way we are supposed to send XML to the vendor is via CORBA (don't ask me why:-) where the only parameter essentially is a string containing the XML document. So the quesiton is not how to send it to the vendor, but how to format our JavaBeans into XML.
We can't use JAXB because it doesn't support schema. We tried a few libraries out there but they stumble on our schema and we can't change it because it comes from the vendor. So it sounds like our only choice for today is to generate XML ourselves.
The data is stored in JavaBean packet objects and that's our input. Our output should be a string with XML document conforming to the schema. Posting a request to ourselves will of course work, but that's too much unnecessary overhead. Another option is implementing HttpServletRequest and HttpServletResponse and calling service method directly. Better suggestions?

Similar Messages

  • How to map jsp in web.xml

    Hi,
    CAn anybody tell me that how to map .jsp in web.xml
    thanx
    vjoy

    Same as servlets, except that you specify jsp-file in place of servlet-class - see below
      <servlet>
         <servlet-name>MyJspServlet</servlet-name>
         <jsp-file>/jspServlet.jsp</jsp-file>
      </servlet>
      <servlet-mapping>
         <servlet-name>MyJspServlet</servlet-name>
         <url-pattern>/myJspServlet</url-pattern>
      </servlet-mapping>cheers,
    ram.

  • I've lost all my music since my last computer died. How do I get that music back without having to pay for it? I read somewhere that there is a "form to request to download iTunes purchases again", is this true?

    All of my music is missing from iTunes since my last computer died and had to get a new one.  How do I get that music back without having to pay for it again?  I've read somewhere there is a "form to request to download iTunes purchases again", is this true? 

    Media should be included with the backup of the computer that all users should be creating on a regular basis as part of basic computer/data maintenance.
    In the event that you do not have a backup (stop being lazy.... keep backups of YOUR data and other important files)
    If you are in the US and running iTunes 10.3 or later, it is possible to redownload music via iCloud from purchased history.
    If you are not in the US or for some reason cannot run iTunes 10.3 or later, contact iTunes customer support and ask very nicely for the opportunity to redownload the content.  They are not required to provide this opportunity.
    It is also possible to transfer content from an iDevice that was purchased via iTunes.  On the new computer, sign into the iTunes account, authorize the computer, connect the device then select File > Transfer Purchases.
    The simplest method of all is to transfer or copy the media (and other important files) from the old computer or the backup of the old computer.  Typing "move itunes library" into the search bar here or into google will reveal step by step instructions on how to do this.

  • My pc crashed and erased my itunes songs purchased from the itunes store. How do i get that content back without having to purchase them again?

    my pc crashed and erased my itunes songs purchased from the itunes store. How do i get that content back without having to purchase them again?

    I have somewhat of a similar problem. After iTunes last update, I am missing some of my purchased files of music,ringtones, and TV shows. Possibly movies, but just thought of that and did not look yet. Seems everytime there is an iTunes update, something happens, but usually an easy fix by just deleting music files from CD's that I loaded onto iTunes and no longer recognized after an update and reload from the hard drive. This time I do not have a current back up of all the music, ringtones, and tv shows I have purchased.
    So I am also wondering how can I redownload purchases without being charged when there is no file left on the hard drive. It just stays listed in iTunes though.

  • How to call session directly in bdc without using SM35

    how to call session directly in bdc without using SM35

    HI
    good
    you r using the sm35 to see the session for calling teh session in your report
    ATA:   messtab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE ,
    c_session  LIKE   apqi-groupid VALUE 'Z3PL_CUST' ,
    c_job      LIKE   tbtcjob-jobname VALUE 'Z3PL_JOB_CUST' ,
    c_flag     TYPE    c VALUE 'X'  ,
    g_qid      TYPE apqi-qid      .
    thanks
    mrutyun

  • Call jsp function in javascript without using Applet

    anyone knows how to call jsp function in javascript .
    just as follows:
    <%!
    public string jspcall()
    return new String("just a example");
    %>
    <script language="javascript">
    <!--
    temp = jspcall();
    //->
    </script>
    it's desn't work.
    any suggestion will help!

    it's was not able to call a jsp function in javascript.
    jsp function was on server site while javascript normally on the client site.

  • How to  call library classes threw xml

    In my flash library has "MC",
    var xml:XML=<m c="MC"></m>
    How to call MC class threw xml.

    It's a bit cryptic but I think you mean like this:
    import flash.utils.getDefinitionByName;
    import flash.display.MovieClip;
    var xml:XML = <m c="MC"></m>;
    var classRef:Class = getDefinitionByName(xml.@c) as Class;
    var movieclip:MovieClip = new classRef() as MovieClip;
    addChild(movieclip);
    Kenneth Kawamoto
    http://www.materiaprima.co.uk/

  • How to put the alv output into the spool request?

    Hi guys,
    How to put the alv output into the spool request?
    Thanks!

    Hi
    Sending an ALV List screen output to SPOOL
    Convert ALV list to PDF and send mails to respective persons
    Regards
    Pavan

  • How to call jsp from another jsp

    Hi, All,
    I have several jsp files in my pagelet. I need to put a link in one jsp file. When client click the link, it will show another jsp file. Could anybody tell me how to do that?  i have tried to use following code in page1.jsp,
    IPortalComponentURI componentURI= componentRequest.createPortalComponentURI();
    componentURI.setContextName("pagelet/page2.jsp");
    String docuri = componentURI.toString();
    <body>
    click  '<a href="<%=docuri %> ">here</a>' to link to pages.
    But it does not work. Any help will be great appreciated.
    Marea
    Message was edited by:
            Marea Yang
    Message was edited by:
            Marea Yang

    HI Yang,
    You can achieve it through eventhandliling in jspdynpage.
    Go through this link ,
    i.<a href="http://help.sap.com/saphelp_nw70/helpdata/en/2e/d2a441cd47a209e10000000a155106/content.htm">eventhandling</a>.
    ii.<a href="https://forums.sdn.sap.com/thread.jspa?threadID=103335">method to call jsp</a>.
    iii.<a href="https://forums.sdn.sap.com/thread.jspa?threadID=393522">calling  resource JSP in Portal Compoent</a>
    Hope It'll help you.
    Regards ,
    Malini.V

  • How to call jsp from web dynpro app.

    Hi Frndz,
    How can I call a JSP from my web dynpro(and here i don't want to redirect to JSP ),I want to call a JSP which can show a message window as alert on top  of WDP view.
    Here am using CE 7.2 SP1, and my requirement is to call the model(back end) for every minute interval and need to give alert that how many new records r added.With WDP java i haven't find any option to give alert r notifications about new records added, so am thinking to call JSP where I will pass the parameter which can show a alert r notification(like FACEBOOK n outlook notifications).
    Please share any ideas ti achieve this,
    Thanks in advance.
    Regrads
    Rajesh

    Hi,
    If your application should open in a new url, then you can use link to url action to open jsp.
    You can also use EPCF navigation api to call any pcd page as well external links
    i.e
      WDPortalNavigation
          .navigateAbsolute("link",[parameters]);
    Since your passing parameters, you build url in both the cases.
    Ram

  • How to call JSP page from applet?

    I have some page1.jsp from which I call applet.
    User works with this applet but some information does not in date inside applet.
    So user click on some component at applet (some button etc.) and now I would like to do this:
    1) open new window;
    2) call page2.jsp at this new window.
    The reason is that page2.jsp will read some data from database and then displays it in HTML inside page2.jsp itself. It is not necessary to pass these date back to applet for displaying them inside of applet.
    So user then can have 2 windows: page1.jsp with applet and page2.jsp with some details information.
    But I DO NOT know how to call page2.jsp from applet, and do ti in a new window. Is it possible and how?
    Thanks
    Mirek

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class MainMenu extends JApplet implements ActionListener
         private JMenuBar mbar;
         private JMenu Master,Leave,Report,Logout;
         private JMenuItem UserMaster,DeptMaster,DesignationMaster,LeaveAvailable,LeaveApply,Generate;
         private JPanel jp;
         public void init()
              mbar=new JMenuBar();
              Master=new JMenu("Master");
              Leave=new JMenu("Leave");
         Report=new JMenu("Report");
              Logout=new JMenu("Logout");
              UserMaster=new JMenuItem("UserMaster");
              UserMaster.setMnemonic('U');
              DeptMaster=new JMenuItem("DeptMaster");
              DeptMaster.setMnemonic('D');
              DesignationMaster=new JMenuItem("DesignationMaster");
              DesignationMaster.setMnemonic('D');
              LeaveAvailable=new JMenuItem("LeaveAvailable");
              LeaveAvailable.setMnemonic('L');
              LeaveApply=new JMenuItem("LeaveApply");
              LeaveApply.setMnemonic('L');
              Generate=new JMenuItem("Generate");
              Generate.setMnemonic('G');
              Master.add(UserMaster);
              Master.add(DeptMaster);
              Master.add(DesignationMaster);
              mbar.add(Master);
              Leave.add(LeaveAvailable);
              Leave.add(LeaveApply);
              mbar.add(Leave);
              Report.add(Generate);
              mbar.add(Report);
              mbar.add(Logout);
              UserMaster.addActionListener(this);
              DeptMaster.addActionListener(this);
              DesignationMaster.addActionListener(this);
              LeaveAvailable.addActionListener(this);
              LeaveApply.addActionListener(this);
              Generate.addActionListener(this);
              Logout.addActionListener(this);
              mbar.setVisible(true);
              Container con=getContentPane();
              con.add(mbar,BorderLayout.NORTH);
         public void actionPerformed(ActionEvent ae){
              if(ae.getSource()==UserMaster)
              }

  • How to call jsp /servlets running in different web application in tomcat

    hello all,
    i have 2 web applications(Charts and Reports) in the same tomcat,i want to call jsp/servlets running in the Reports webapp from Charts webapp.how do i achieve this.
    thanx
    ravi

    You can also use getContext(String context) in the ServletContext class to get a request dispatcher.
    Using the above example it would be :
    // in a servlet in the charts webapp
    ServletContext context = getServletContext();
    ServletContext reportsContext = context.getContext("/reports");
    RequestDispatcher dispatcher = reportsContext.getRequestDispatcher("/path")
    dispatcher.forward(request, response);Just note, that depending on your server's configuration getContext(...) might return null.

  • How to call jsp in PLSQL code (to upload a file in IFS)

    Hello,
    We develop our PORTAL (9.0.2) with PL/SQL way.
    We want to make a form to upload file in IFS.
    We create a form like that :
    htp.formOpen(cmethod =>'post',
         cenctype => 'multipart/form-data',
         curl => '/pls/ptlcollab/ptlcollab.GestionDoc_screenbuilder.manipTableIFS',
         cattributes => 'name="ifs"') ;
    htp.TableData(htf.FORMFILE(cname=>'file', cattributes => 'size="25"')) ;
    The manipTableIFS procedure calls a loaded java procedure which called a servlet which work with IFS.
    BUT, modplsql seems to want we directly upload the doc in a table but we want to upload the doc in iFS !!!
    So, the solutiuon seems to call a jsp (or a servlet directly from our plsql code).
    BUT, how could I do that ???
    Any help would be greatly appreciated.
    Regards.
    Luc.

    Something along these lines ought to do what you want:
    <html>
    <body>
    <form name='foobar' action='foobar.jsp'>
    <script language='Javascript'>
    function askim() {
      if (confirm('Is you sure?')) {
        document.foobar.submit();
      } else return false;
    </script>
    <input type='button' value='Submit' onClick='askim()'>
    </form>
    </body>
    </html>
    Your mileage may vary.
    But the idea here is that the Javascript merely submits the form if the user clicks "OK" on the confirmation pop-up. Otherwise, nothing happens. The form is submitted to a JSP file which accepts the request, does something (such as call your Java class), then prints out some HTML in response.

  • Beginner's question: how to call JSP

    Hi,
    Is the following a right way to call a JSP?
    GET /app/im/iClient.jsp?user=[email protected]&pass=welcome HTTP/1.1
    Host: st5.abc.com
    I am trying to manually send a HTTP request. I am sure the directory is right, but no response. Should I use "POST" instead of "GET"?
    Thank you!

    I dont believe that... If you're trying to get a response InputStream, or the response formatted as some object, for a request to an HTTP server, and you are just now writing Socket connection stuff, then you can just replace that with URLConnection and let it do the work given a URL.
    Otherwise, you should already have a class which uses Sockets internally to get what you want, and you shouldn't be asking us this question because it should take a URL and make the connection and give you what you want...
    I don't see any other possible "stage" at which you could be at that you need to a) use Sockets over URLConnections, b) need to know the details of HTTP, and c) can't change one or the other.

  • How to call JSp from Servlet??

    Hello,
    I want to call JSP page from servlet.I am using Visual Age For java 3.4. What is wrong in my code??
    if (userExists) {
    f.setErrors("userName","Duplicate User: Try a different username");
    getServletConfig().getServletContext().
    getRequestDispatcher("/jsp/forms/retry.jsp").
    forward(request, response);
    I am not able to get the o/p. Pls help.

    I can't see anything obvious, but did you take any steps towards doing output before this code (like openning an output stream)?
    Not clear what f.setErrors does - presumably stuffs the error message in an attribute of the request.

Maybe you are looking for

  • Read from text file, display in textarea

    java newbie here - I'm trying to write a chat program that checks a text file every 1 second for new text, and then writes that text to a textArea. I've got the thread setup and running, and it checks and text file for new text - all that works and p

  • Getting Error When downloading Adobe PDF Reader

    Screenshot of the error is below. I've tried every fix in the book and have had this error for months. Most frustrating part is that It's cutting into my work and Adobe has no customer service, so no direct help on that end. I am looking to see if an

  • ResultSet.getObject casts to incomplete Date

    Hi, I'm using the jdbc driver in java to copy data from an oracle database to a DB2 database. The solution is a generic one to copy all columns regardless of type (using PreparedStatement.setObject). Everything works as a charm except that the DATE c

  • Is firefox 5.0 compatible with non-intel based mac systems?

    I downloaded 5.o previously this year & it wouldn't work because after downloading I discovered that it would only work with Intel based Mac systems. Has this changed? I don't want to go thru the download process again if it won't work. Thanks.

  • WSUS error 404

    Hi All, I have a WSUS server setup on Server 2012 R2. It uses SQL Server as opposed to WID. The problem I am having is that if I navigate to: http://servername:8530/iuident.cab - nothing is downloaded (I get a 404). I've enabled directory browsing, r