Post XML to Servlet through JavaScript and reveive info back

There's a post in this forum before, but anyone know how to do this:
=========================================
MSIE5 + will let you post an XML string to a servlet. It must be done from javascript. The same javascript can also receive an xml string back from the servlet, parse it, and update dom objects in the browser, independenty of a an http post.
You can use this technique to populate ddlb based on events in the browser, or do real-time validations from the database. It works just fine, is quite fast, but is MSIE specific. If another brower is used, you must handle it some other way.
=========================================
I will use IE only.
Any help will be highly appreciated!
Charles

Thanks for your response, ddossot!
I also got something from our Microsoft team, post here to share with others who have interest in this topic. It's interesting to see IE talk with Servlet in XML, especially within a LAN.
==============================================================================
I did find a couple of things. Not sure if it is exactly what you are looking for. Let me know if it works.
function submitAsXML() {
     var theXML = document.myform.txtInXML.value;
var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
     var url = document.myform.txtURL.value;
try {
xmlhttp.open("POST", url, false);
} catch(e) {
xmlhttp.open("POST", url, false);
xmlhttp.Send(theXML);
     var xmlResp = xmlhttp.ResponseText;
     document.myform.txtOutXML.value = xmlResp;
Link to XML DOM Properties -
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk30/htm/xmproresponsexmlserverxmlhttp.asp
Regards,
Ashwin

Similar Messages

  • JavaScript and CSS info in WPC

    Hi all,
    Is it possible to keep CSS (Stylesheet) and Javascript information from older html web pages and bring them into Web Page Composer? We have some older intranet web pages which we now want to display in the portal without ofcourse using URL iViews; so the content remains local to KM and the relevant roles can be assigned to different authors and editors of the website so it can be modified through the portal and WPC?
    Any tips, hints and helpful suggestions are welcome.
    Regards,
    Tony.

    Hi Tony.
    Yes, it's possible. Read [Wiki WPC FAQ|https://wiki.sdn.sap.com/wiki/display/KMC/WebPageComposer-FrequentlyAskedQuestions+%28FAQ%29#WebPageComposer-FrequentlyAskedQuestions%28FAQ%29-WhataboutusingstandardHTMLpagesinWPC%3F].
    KM supports relative links in HTML documents so it may be necessary include any dependent files in the same folder as the HTML document.
    In case of a web page and its dependent files are stored in different folders you need editing the source html code:
    1. use Portal Drive and any text editor (I prefer Notepad++. It has the feature "Search and Replace in files") to open the html source file.
    2. search for links to dependent files and add the following pattern: /irj/go/km/docs//<path to an dependent file>/ before a filename, for example:
    You have a web page with css file. The page is stored in documents repository under the folder with ID old_pages. The css is resides in css folder.
    So the existing code
    <LINK REL=STYLESHEET TYPE="text/css" HREF="css/style.css">
    should be replaced with the
    <LINK REL=STYLESHEET TYPE="text/css" HREF="/irj/go/km/docs//documents/old_pages/css/style.css">
    Best regards,
    Aliaksandr

  • What belongs in the faces-config.xml file? Just bean and navigation info?

    I am looking for detailed information on the faces-config.xml file.
    I've used examples up to this point and I was wondering where the documentation for this configuration file was at.
    At this point, I know that bean management and navigation information is in this file, but are there other settings?
    Thanks,
    --Todd                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Pringi: The tag explantion information, why isn't that easily found on Sun's web site or document site?
    This has been the most frustrating part - finding pieces of information here and there... and not in one location.
    Thanks,
    --Todd                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to set up fax through optonline and a battery back up power supply

    I've been trying to set up the fax feature that came with this computer but, I've had a hard time because I need to have the, PPP. TCP/IP. Proxies and Modem.
    Has anyone been there and now of this information?
    Please help and tell me if it is even worth it
    Thank you
    IMac G-5   Mac OS X (10.4.8)  

    Welcome to Apple Discussions
    Tis forum is for Safari specific issues. I suggest reposting your question in the OS X Tiger: Getting Online & Networking forum. You'll receive there the help you need.
    iMac G5 Rev C 20" 2.5gb RAM 250 gb HD/iBook G4 1.33 ghz 1.5gb RAM 40 gb HD   Mac OS X (10.4.8)   LaCie 160gb d2 HD Canon i960 printer

  • Trying to buy extra storage but I get half way through process and am sent back to the beginning

    I Am trying to buy extra iCloud storage , I complete form put in card details , press buy and then it asks for card details again I cannot get past that stage

    Hi Renaissnce1950,
    If you are having issues upgrading your iCloud storage, you may find the following article helpful:
    iCloud: Troubleshooting storage issues
    http://support.apple.com/kb/TS4009
    Regards,
    - Brenden

  • Error while posting xml file to URL using URLConnection

    Hello everyone,
    I am facing an issue from long time related to URLConnection. If this would be resolved by your help then I would be very grateful to you.
    One application which posts xml file to URL hangs and after waiting for 5 mins it throws 504 error:
    java.io.IOException: Server returned HTTP response code: 504 for URL: http:hostname.
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:715)
    Same application is running fine without error on another environment from last 5 years. But on another env it is erroring out from the day 1.
    We have many workarounds in place none worked.
    I tried to use HttpClient from apache but that too hanged at URLConnection.getInputStream() method call.
    App is running on iPlanet web server 6.1 using JDK 1.4.0_03
    We still dont know why this program hangs at that particular line in only one env but many times it runs fine. That means 30% of the times it posts xml file without error but 70% times it errors out. So our program logic is to retry until post is successful.
    Once this issue is resolved we will remove the logic of trying again and agian.
    Please provide inputs.
    Thanks,
    Nitin

    The HTTP response 504 means that the server, acting as a gateway, has not received a response from an upstream server in the time it expected.
    I think this is problem is due to the remote server that receives the XML and takes too long to return a response to the local application that posted the XML.
    Try HttpClient and set the timeout variable of the HttpClient instance used.
    Here http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/examples/PostXML.java?revision=480424&view=markup
    a Post XML sample.
    NB: HttpClient > setTimeout method is deprecated. See : http://jakarta.apache.org/commons/httpclient/apidocs/index.html for an alternative
    Hope That Helps

  • Including external javascript and css files in servlet

    Hello,
    I am struggling to generate an HTML page from within a servlet using external javascript and css files. I am not sure how to point the servlet to the external files.
    Any code sample to accomplish the above will be much appreciated.
    Thanks inadvance,
    Antana.

    Can't you just include the following in your servlet?
           response.setContentType("text/html");
            PrintWriter out = response.getWriter();
            out.println("<html>");
            out.println("<head>");
            out.println("<title>Getting CSS</title>");
            out.println("<link rel='stylesheet' type='text/css' href='yourCSS.css' />");
            out.println("<script language='JavaScript' SRC='yourScript.js'></script>");
            out.println("</head>");
           //...

  • How get xml-data at servlet by http and parse it?

    hello! please help me who can, i have very urgent task but not much skilful to deal with work in web. is anywhere source code or similar example of task to get xml-data at servlet by http and parse it . thank you in advance

    here a basic code that reads and parses an remote xml file:
    import java.io.IOException;
    import java.net.HttpURLConnection;
    import java.net.URL;
    import javax.xml.parsers.ParserConfigurationException;
    import javax.xml.parsers.SAXParser;
    import javax.xml.parsers.SAXParserFactory;
    import org.xml.sax.Attributes;
    import org.xml.sax.SAXException;
    import org.xml.sax.helpers.DefaultHandler;
    public class SAXParserExample extends DefaultHandler {
         StringBuffer buffer;
         String urlString = "http://nds.nokia.com/uaprof/NN95_8GB-1r100.xml";
         public SAXParserExample() {
         public void runExample() {
              parseDocument();
         private void parseDocument() {
              // get a factory
              SAXParserFactory spf = SAXParserFactory.newInstance();
              try {
                   // get a new instance of parser
                   SAXParser sp = spf.newSAXParser();
                   URL url = new URL(urlString);
                   HttpURLConnection httpSource = (HttpURLConnection) url.openConnection();
                   // parse the file and also register this class for call backs
                   sp.parse(httpSource.getInputStream(), this);
              } catch (SAXException se) {
                   se.printStackTrace();
              } catch (ParserConfigurationException pce) {
                   pce.printStackTrace();
              } catch (IOException ie) {
                   ie.printStackTrace();
         // Event Handlers
         public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
              System.out.println("+++ start of element: " + qName);
              buffer = new StringBuffer();
         public void characters(char[] ch, int start, int length) throws SAXException {
              buffer.append(ch, start, length);
         public void endElement(String uri, String localName, String qName) throws SAXException {
              System.out.println(buffer.toString());
              System.out.println("+++ end of element " + qName);
         public static void main(String[] args) {
              SAXParserExample spe = new SAXParserExample();
              spe.runExample();
    }you have only to change the urlString and adapt to your needs.
    hope it helps

  • Javascript block through javascript.enabled false not working as expected in newer versions, any actual way?

    Since a few versions, around 24.0 or earlier, when you toggle javascript.enabled from true to false to block javascript, doesn't work after load a page.
    Further details:
    1.- load a page with javascript enabled
    2.- toggle javascript preference to block javascript (javascript.enabled from true to false)
    3.- if you interact with javascript elements = they still work
    This wasn't this way in earlier versions.
    You can check in the following page. You'll see that the only way to actually block javascript execution is to load the page with the preference javascript.enabled set to false (A.K.A. javascript blocked):
    http://www.geocities.ws/jothache/event_listener.html
    Note: to easy change javascript preferences, for those don't want to play with about:config you can use addons like QuickJava:
    https://addons.mozilla.org/en-US/firefox/addon/quickjava/
    I find that how it works now, in the latest versions, it is a VERY HUGE SECURITY ISSUE as javascript is never actually blocked when the preference is toggled and AJAX (httpXMLrequest through javascript) still works so the possibilities of lost of privacy inreases, as for example, mouse tracking and send it to the server, not only as the example scripts I posted above.
    The question is, is there anyway to really block javascript in the latests versions or should I report this as a bug?
    Regards.

    Hi guigs2,
    if there is no problem in open the bug ticket being a simple user I'll report by myself (if I haven't misunderstood you). (Confirm this and I'll do myself).
    About the AJAX problem, here we have a sample test that works after toggle the preference:
    http://www.w3schools.com/xml/xml_http.asp
    I know about noscript and I don't like it. I prefer to do manually (those measures and more). What bothered me is that even toggle the preference, what in the past did the job of stopping the execution of scripts, now doesn't. In about version 24 it was only happening to event listeners not being blocked (used nowadays for dynamic events assignments). Now is with every javascript code.
    About the tracking methods, I'm aware of HTTP tracking without any need of javascript. Even a simple "knock knock" on any kind of server leaves a trace.
    I was just pointing that this preference stopping doing its job (stopping scripts executions) has the worst sceneario in a security way with XMLHttpRequest calls.
    But one of the things that bothers me too, and it is not related to tracking, is that, in humble machines as mine, some javascript codes make drop whole performance and the preference toggle now does nothing, so the script keeps running without being able of doing anything and sometimes you don't have the option to load a page without javascript because you need some feature of that page that requires javascript what becomes "all or nothing".
    Regards.

  • How to execute workflow through javascript in CRM 2013

    Hi,
    I have created a business process and I want to execute workflow on custom button through javascript. I tried this script but this script does not run after message box show. Please tell me how to execute my workflow through javascript
    function RunWorkflow() {
        var _return = window.confirm('Are you want to execute workflow.');
        if (_return) {
            var url = Xrm.Page.context.getServerUrl();
            var entityId = Xrm.Page.data.entity.getId();
            var workflowId = '541B45C9-3F88-4448-9690-2D4A365C3172';
            var OrgServicePath = "/XRMServices/2011/Organization.svc/web";
            url = url + OrgServicePath;
            var request;
            request = "<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\">" +
                          "<s:Body>" +
                            "<Execute xmlns=\"http://schemas.microsoft.com/xrm/2011/Contracts/Services\" xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\">"
    +
                              "<request i:type=\"b:ExecuteWorkflowRequest\" xmlns:a=\"http://schemas.microsoft.com/xrm/2011/Contracts\"
    xmlns:b=\"http://schemas.microsoft.com/crm/2011/Contracts\">" +
                                "<a:Parameters xmlns:c=\"http://schemas.datacontract.org/2004/07/System.Collections.Generic\">"
    +
                                  "<a:KeyValuePairOfstringanyType>" +
                                    "<c:key>EntityId</c:key>" +
                                    "<c:value i:type=\"d:guid\" xmlns:d=\"http://schemas.microsoft.com/2003/10/Serialization/\">"
    + entityId + "</c:value>" +
                                  "</a:KeyValuePairOfstringanyType>" +
                                  "<a:KeyValuePairOfstringanyType>" +
                                    "<c:key>WorkflowId</c:key>" +
                                    "<c:value i:type=\"d:guid\" xmlns:d=\"http://schemas.microsoft.com/2003/10/Serialization/\">"
    + workflowId + "</c:value>" +
                                  "</a:KeyValuePairOfstringanyType>" +
                                "</a:Parameters>" +
                                "<a:RequestId i:nil=\"true\" />" +
                                "<a:RequestName>ExecuteWorkflow</a:RequestName>" +
                              "</request>" +
                            "</Execute>" +
                          "</s:Body>" +
                        "</s:Envelope>";
            var req = new XMLHttpRequest();
            req.open("POST", url, true)
            // Responses will return XML. It isn't possible to return JSON.
            req.setRequestHeader("Accept", "application/xml, text/xml, */*");
            req.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
            req.setRequestHeader("SOAPAction", "http://schemas.microsoft.com/xrm/2011/Contracts/Services/IOrganizationService/Execute");
            req.onreadystatechange = function () { assignResponse(req); };
            req.send(request);
    function assignResponse(req) {
        if (req.readyState == 4) {
            if (req.status == 200) {
                alert('successfully executed the workflow');

    Hi,
    I used this script for execute the workflow but its not working. When I used alert(req.status); then 500 show. Please tell me what did I mistake in my script.
    function RunWorkflow() {
        var _return = window.confirm('Are you want to execute workflow.');
        if (_return) {
            var url = Xrm.Page.context.getClientUrl();
            var entityId = Xrm.Page.data.entity.getId();
            var workflowId = '541B45C9-3F88-4448-9690-2D4A365C3172';
            var OrgServicePath = "/XRMServices/2011/Organization.svc/web";
            url = url + OrgServicePath;
            var request;
            request = "<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\">" +
                          "<s:Body>" +
                            "<Execute xmlns=\"http://schemas.microsoft.com/xrm/2011/Contracts/Services\" xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\">"
    +
                              "<request i:type=\"b:ExecuteWorkflowRequest\" xmlns:a=\"http://schemas.microsoft.com/xrm/2011/Contracts\"
    xmlns:b=\"http://schemas.microsoft.com/crm/2011/Contracts\">" +
                                "<a:Parameters xmlns:c=\"http://schemas.datacontract.org/2004/07/System.Collections.Generic\">"
    +
                                  "<a:KeyValuePairOfstringanyType>" +
                                    "<c:key>EntityId</c:key>" +
                                    "<c:value i:type=\"d:guid\" xmlns:d=\"http://schemas.microsoft.com/2003/10/Serialization/\">"
    + entityId + "</c:value>" +
                                  "</a:KeyValuePairOfstringanyType>" +
                                  "<a:KeyValuePairOfstringanyType>" +
                                    "<c:key>WorkflowId</c:key>" +
                                    "<c:value i:type=\"d:guid\" xmlns:d=\"http://schemas.microsoft.com/2003/10/Serialization/\">"
    + workflowId + "</c:value>" +
                                  "</a:KeyValuePairOfstringanyType>" +
                                "</a:Parameters>" +
                                "<a:RequestId i:nil=\"true\" />" +
                                "<a:RequestName>ExecuteWorkflow</a:RequestName>" +
                              "</request>" +
                            "</Execute>" +
                          "</s:Body>" +
                        "</s:Envelope>";
            var req = new XMLHttpRequest();
            req.open("POST", url, true)
            // Responses will return XML. It isn't possible to return JSON.
            req.setRequestHeader("Accept", "application/xml, text/xml, */*");
            req.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
            req.setRequestHeader("SOAPAction", "http://schemas.microsoft.com/xrm/2011/Contracts/Services/IOrganizationService/Execute");
            req.onreadystatechange = function () { assignResponse(req); };
            req.send(request);
    function assignResponse(req) {
        if (req.readyState == 4) {
    alert(req.status);
            if (req.status == 200) {
                alert('successfully executed the workflow');

  • Posting to a servlet from a class in a jar on the server

    I'm trying to modify a 3rd party applet that displays documents pulled from a database to post back to the server whenever the user pages up/down into a new document. The primary functionality of the applet is in place and working, the only change I am trying to make is to get the applet to post back to the server when the document being viewed changes so that we can keep track of documents open on the server side.
    The document viewer in the applet does have documented, though limited, ways to modify its functionality through properties files. I've added page up/down buttons to the correct properties file and specified button implementation classes as is dictated by their documentation. However, the problem I've run into is that since these page up/down classes are supposed to be placed in a jar file on the server and sent to the applet via the ARCHIVE parameter of the APPLET tag; these classes can not actually submit a post request back to the servlet.
    Since these classes exist outside of the world of the web app and applet, they don't have access to any of the connection, session, or cookie info in order to have an address to post back to, much less hold the correct session during the post. I tried hard-coding a URL to send the post request to for the sake of testing, but I'm still not seeing the post request being sent to the servlet. Here is the code I used to post the request, just in case it's a stupid mistake on my part.
    URL localURL = new URL("http://localhost:8080/appDir/ServletName");
                    localURLConnection = localURL.openConnection();
                    localURLConnection.setRequestProperty("method", "POST");
                    localURLConnection.setDoOutput(true);
                    Properties paramProperties = new Properties();
                    paramProperties.put("command", "nextDocument");
                    OutputStream localOutputStream = paramURLConnection.getOutputStream();
                    ObjectOutputStream localObjectOutputStream = new ObjectOutputStream(localOutputStream);
                    localObjectOutputStream.writeObject(paramProperties);
                    localObjectOutputStream.flush();
                    localObjectOutputStream.close();While searching to find out why this code isn't posting to my servlet, I've been wondering about the viability of this approach as a whole as well. Ideally if I wanted to add a post request to an event generated by the applet, then I would want to modify the applet. But since the applet is in a 3rd party jar file, I've been trying to do things their way. However, assuming I could get the page up/down action classes to post correctly, wouldn't I need some way of preserving the session that this action came from so that the right user's applet would be updated with the right document? The first thought that comes to mind on this involves writing out session/cookie data to temporary files on the server, but this sounds very ugly and insecure; plus I'd have to worry about making sure the files were uniquely named and that this unique name could be used in the page up/down classes. Is there a better way that I could be doing it?
    I apologize for the long winded explanation, but if anyone has any thoughts on either why my post request isn't going through or on the absurdity of my solution (and hopefully an alternate idea I could try), I'd be very appreciative.
    Thanks in advance.

    Well, when I've done URL connections from an applet session and cookies seem to have sorted themselves out. I'm not sure how, but there seems to be some functionality for it in the URLConnection class.
    I haven't tried setting the method like this, I always cast to HttpURLConnection and call setMethod to select POST. Your way might be right as well though.
    Have you checked the server access logs?
    It may be that your URL is rejected by the security manager for not having the same form of the hostname as the original applet retrieval.
    You should be able to get a domain name and port from the "code source" of your code, which will reference the online jar it comes from. You can generally get at this as getClass().getProtectionDomain().getCodeSource().getLocation(), or less elegantly by requesting the current class file as a resource.

  • How to parse XML in server side javascript (XSJS)?

    Hi Experts,
    I can get the XML file content through this method:var xmlString = $.response.body.asString() and I need to parse XML. If there XML parser in server side javascript? thanks very much!

    Hi Wenwen Hou,
    There is a blog available at
    Parse XML in server side javascript (XSJS)
    This can help you achieve parsing xml in server side javascript.
    Regards,
    Anjali.

  • Combo box in JavaScript and store the combo box values into database

    i am a developer, i have a task ie.. i have combo box in JavaScript and i have to store the combo box values into database through JavaServerPage..
    i please every one to have a look on this and please reply soon....

    dear sir,
    your suggestions are really greater the god.............
    i have applied as you said , now i am the page as updated and also i nform you that its multi select ....
    i will show the codings , then u will get a clear identification
    <script language= "JavaScript">
    <!--
    function one2two() {
        m1len = m1.length ;
        for ( i=0; i<m1len ; i++){
            if (m1.options.selected == true ) {
    m2len = m2.length;
    m2.options[m2len]= new Option(m1.options[i].text);
    for ( i = (m1len -1); i>=0; i--){
    if (m1.options[i].selected == true ) {
    m1.options[i] = null;
    function two2one() {
    m2len = m2.length ;
    for ( i=0; i<m2len ; i++){
    if (m2.options[i].selected == true ) {
    m1len = m1.length;
    m1.options[m1len]= new Option(m2.options[i].text);
    for ( i=(m2len-1); i>=0; i--) {
    if (m2.options[i].selected == true ) {
    m2.options[i] = null;
    //-->
    </script>
    <form method="POST" name="theForm" action="update.jsp">
    <table bgcolor="white" border="1" cellpadding="5" cellspacing="2" align="center">
    <tr><td align="center">
    <select id=menu1 size=10 multiple>
    <option>javascript</option>
    <option>php</option>
    <option>Zeo</option>
    <option>asp</option>
    <option>jsp</option>
    <option>ajax</option>
    <option>struts</option>
    </select>
    <p align="center"><input type="button" onClick="one2two()" value=" >> "></p>
    </td><td align="center">
    Languages you know:<BR>
    <SELECT NAME="language" multiple>
    <OPTION VALUE="c">C
    <OPTION VALUE="c++">C++
    </SELECT>
    <p align="center"><input type="button" onClick="two2one()" value=" << " ></p>
    </td></tr></table>
    <center><input type="submit" value="update"></center>
    </form>
    <h4><u>Back<h4>
    <script language= "JavaScript">
    var m1 = document.theForm.menu1;
    var m2 = document.theForm.language;
    </script>
    </body>
    </html>

  • Validation, Task Flow, Servlet, Pop-up, and a Managed Bean

    Hi,
    We're trying to display a PDF in a pop-up by calling a Servlet within a JSF page by using a task flow in JDeveloper 11g R2.
    The relevant JSF snippet:
    <af:inlineFrame id="if1" shortDesc="Report" source="/pdfservlet" styleClass="AFStretchWidth"></af:inlineFrame>The /pdfservlet points to a Servlet with a doGet method as follows:
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
      response.reset();
      OutputStream out = response.getOutputStream();
      FacesContext context = this.getFacesContext(request, response);
      OracleReportBean bean =
        context.getApplication().evaluateExpressionGet(context, "#{reportBean}", OracleReportBean.class);
      bean.run(context, out);
      removeFacesContext();
      out.close();
    }The Servlet attempts to get the FacesContext, but we've encountered the following exception:
    Caused By: javax.faces.FacesException: Cant instantiate class: oracle.adfinternal.view.faces.component.AdfViewRoot.We removed the following lines from the getFacesContext() method:
    UIViewRoot view = facesContext.getApplication().getViewHandler().createView(facesContext, "");
    facesContext.setViewRoot(view);This avoids the exception above, however... We're trying to get the parameters from the form that was submitted. Here is an example element from the form:
    <h:inputHidden value="MyMedicationList_Report" id="system_REPORT_RESOURCE"/>When the Servlet calls the Managed Bean to retrieve the value, it uses:
    Map<String, String[]> requestParameters = getRequestParameters();
    Parameters p = getParameters();
    for( String key : requestParameters.keySet() ) {
      for( String value : requestParameters.get( key ) ) {
        int i = key.indexOf( ':' );
        if( i >= 0 ) {
          key = key.substring( i + 1 );
        p.put( key, value );
    }Where getRequestParameters() attempts to get the external context to retrieve the request parameter values map:
    return getExternalContext().getRequestParameterValuesMap();The map comes up empty.
    I've tried following http://www.oracle.com/technetwork/developer-tools/adf/learnmore/oct2010-otn-harvest-183714.pdf by setting the web.xml to:
      <!-- JspFilter must be configured before adfBindings. -->
      <filter-mapping>
        <filter-name>JpsFilter</filter-name>
        <servlet-name>PDFServlet</servlet-name>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
        <dispatcher>REQUEST</dispatcher>
      </filter-mapping>
      <filter-mapping>
        <filter-name>adfBindings</filter-name>
        <servlet-name>PDFServlet</servlet-name>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>REQUEST</dispatcher>
      </filter-mapping>And set the data bindings to:
      <pageMap>
        <page path="/pdfservlet" usageId="ca_bcpra_promis_reporting_view_PDFServletPageDef"/>
      </pageMap>
      <pageDefinitionUsages>
        <page id="ca_bcpra_promis_reporting_view_PDFServletPageDef" path="ca.bcpra.promis.reporting.view.PDFServletPageDef"/>
      </pageDefinitionUsages>The Servlet executes, calls the instantiated managed bean, but cannot read the request parameters.
    The button used to launch the task flow in a dialog is:
    <af:commandButton text="Run Report" id="submitReport" useWindow="true"
                      windowEmbedStyle="inlineDocument" windowModalityType="applicationModal" windowHeight="500"
                      windowWidth="700" action="runReport"/>By using a task flow, the user inputs are validated before the pop-up is opened. We want to keep that behaviour. The PDF opens and then returns with a NullPointerException:
    http://pastebin.com/raw.php?i=PaM64jL4
    The Servlet, through the managed bean, makes a request to the report server to pass parameters and generate a PDF. The PDF is streamed back to the browser via the Servlet.
    What other approaches can we take to:
    1. Send user and system parameters.
    2. Generate a PDF on a remote server.
    3. Stream the PDF back to the user in a pop-up.
    Thank you.

    It is not a static PDF. The PDF is generated, dynamically, on the report server using the parameters from multiple forms on the page.
    We've leveraged the HttpSession getSessionMap() object for now. When combined with a Method Task Flow, we can transfer the data (and FacesContext) to the report Servlet. For example, the following code exposes objects that the Servlet needs through the session:
      public void initReport(String reportName) {
        FacesContext context = FacesContext.getCurrentInstance();
        ExternalContext ec = context.getExternalContext();
        OracleReportBean bean =
          context.getApplication().evaluateExpressionGet(context, "#{reportBean}", OracleReportBean.class);
        bean.setFacesContext(context);
        ec.getSessionMap().put("reportBean", bean);
        ec.getSessionMap().put(Parameters.PARAM_REPORT_RESOURCE, reportName);
      }This means the Servlet can use the object:
      protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.reset();
        // Find the bean from the session.
        OracleReportBean bean = (OracleReportBean)request.getSession().getAttribute("reportBean");
        OutputStream out = response.getOutputStream();
        bean.run(out);
        out.close();
      }This allows the bean to generate reports.

  • Post XML from HTTPs server

    How do I get the HTTPs server to send/post the XML file to user's mailbox?
    The situation is like this: User from System A need to send XML file to User in System B. These 2 can't communicate directly.So the XML file will be posted to an HTTPs server. This HTTPs server will then post the XML to the recipient based on the mailboxid. This mailboxid is specified in the XML. How do i send the XML to the designated mailbox?

    You write something that runs on the server, receives
    the uploaded XML file, attaches it to an e-mail
    message, and sends that message. Since you ask in the
    Java context, that something could be a servlet. (You
    will notice that this applies equally well to files
    that aren't XML.)Hi there! Thanks for the feedback. So I need to create a servlet in the HTTPs server which upon receiving of the XML file, servlet need to read the XML content to get the mailboxid then attach the XML file to that mailboxid? All these can be done in one servlet? Please correct me id I'm wrong. Your feedback is highly appreciated. Thanks..:)

Maybe you are looking for

  • HTMLDB_ITEM.SELECT_LIST_FROM_QUERY - not found error

    Hi! I am trying to use HTMLDB_ITEM.SELECT_LIST_FROM_QUERY in a page source and getting the error message: ORA-06550: line 2, column 4: PLS-00221: 'SELECT_LIST_FROM_QUERY' is not a procedure or is undefined. This is HTMLDB 2.0 on Oracle 10.2.0.1.0 on

  • How to Type Farsi in Illustrator CS6

    Hi, Having Adobe Illustrator CS6 Installed on my 64 bit windows 7 and enabling windows Farsi keyboard and installing Farsi fonts on my computer, I am having issues on typing farsi in illustrator and words aooear seperatly from Left to Right(Please be

  • Value only article(IS Retail)

    Hi Can anyone help me to know the Value only article process in SAP Retail system . How in POS level the keys associated with Merchandise category post an issue in SAP central system . The significance of inventory profile maintained in the site mast

  • Process in memory after System.exit(0)

    I still see the process in memory after I exit the app. Do you think it is a JWS side effect? Platform: W2K Cheers, Ivan

  • Project Server 2010 - Project Permissions - Users and Groups filter is not working

    Hi, While giving permissions from project center ribbon on a project - Users and Groups filter is not working, we are not able to filter any user. I am not sure why this error is occurring  i tried giving permissions by opening the project  but still