How can I read the ServletInputStream from a JSC application ?

I have asked this question in a number of different ways on the forum without getting a solution that works. What I am trying to do should be a common thing in any business application, I just want to get the data posted to my application, which has been posted as an XML document.
Methods like getRequest(), getRequestParameterMap(), and getRequestMap() are just not doing it. These are not parameters sent with the URL, or parameters at all really, it is just an XML document sent in the body of the post request.
I have been trying to drill down to something that extends HttpServlet in the JSC architecture. I've done a lot of drilling, and haven't hit oil yet !
Joe Paladin

I tested it, and it worked ! I made some minor modifications, and corrected a little typo here and there, so I figured I would post the actual code that I have so far in my page's preRender() that goes and gets the data posted to the page. One improvement I still need to make is getting the actual length of the content, for some reason I had trouble calling getContentLength(). This should really get people going though who might be doing similar work with XML Servlets :
try {
HttpServletRequest httpreq = (HttpServletRequest)FacesContext.getCurrentInstance().getExternalContext().getRequest();
httpreq.getInputStream().readLine(inputbytes, 0, 100);
postData3 = new String(inputbytes);
} catch (Exception e) {
// report error
postData3 = "Error reading post data";
}

Similar Messages

  • How can I read the image from database into form

    hi everyone
    if I have table like this
    create table test
    (id number(10),
    pic long raw);
    in this table record
    in form If I have block non database
    how can i read the image into non database item
    I try with this code but no good
    select pic into :photo from test where id=5;
    photo its non database item kind image
    how can i invoke image into item
    thanks alooooooot

    Hello,
    You can't select image with select query. You need to create another database block from test table which has item binds with database pic column. Now in where condition in test block's property you have to write id=5. Change test block's properties UPDATE ALLOWED, INSERT ALLOWED, DELETE ALLOWED to NO. Only Query allowed property set to YES.
    Now in your particular trigger write the code
    GO_BLOCK('test');
    Execute_Query;
    please mark if it help you or correct
    Regards,
    Danish

  • How can I read the voltage from a serial port

    I am fairly new to LabView and I am having trouble figuring out how to read the DC voltage coming out of an RF Power Supply through a serial port so that I can monitor the voltage every few seconds. In order to do this do I need to purchase a DAQ card or anything like that?

    You would not need a DAQ card to read data over the serial port. You would, however, need a serial port. That may sound sarcastic, but it's not, since many manufacturers are ditching serial ports on computers. If you don't have a serial port then you would need to get something like a USB<->serial adapter or a serial port card that you plug into an expansion slot in your computer.
    Assuming you've got that then you need to find the command set for the RF Power Supply, and write drivers for it so you can send the command to read the voltage, and then read the resposen. I would suggest looking in the Instrument Driver Network to see if a driver for your supply has already been written. 

  • How can i read the data from attached file?

    using javamail i receiving a mail with attachment
    but unable to read the content of the file
    Plz help me out
    thanks in advance

    The answer is in the JavaMail FAQ.

  • How can I restore the data from a single application in icloud?

    Here is my situation. My iPad2 is constantly crashing. Whenever I use an app it runs for about 30 seconds and then the screen blinks black and I go back to my my home screen. At first I erased all the data and settings and tried to restore my backup from icloud. When I did this, it started crashing again right away. Then I erased all the data and reset it to run as a new ipad. In doing this, I redownloaded all my apps and everything is working fine. However, I have about a years worth of data in NoteShelf (note taking app) that is on icloud but that I cannot access. How can I just restore the data from that one app?

    Welcome to the Apple Community.
    Unfortunately you cannot selectively restore from a backup, it's either all or nothing.

  • How can i Read the Data from such Excel files?

    Dear All,
            Here I am attaching an excel file in which all the datat cells have more than one data, can anybody tell me, how to read from such kind of excel files?
    Thanks in Advance & Happy New Year,
    Rujuta

    Greetings Ruju,
    Here is what I do to read such a file:
    I first save the Excel file (xls) as CSV file (which is easier to handle: Comma Seperated Values) .. Open the file using Excel and save it CSV.
    Then using the code attached I get all these values in a string array.
    Hope this helps
    Ayman Mohammad Metwally
    Automation Engineer
    Egypt - Cairo
    Attachments:
    CSV2ARRAY.vi ‏29 KB

  • How can I read the datecode from captured DV Footage?

    Hi. I have some footage captured from MiniDV tapes as DV. Is there a way to see the Date/Time stored in the datacode of Dv Footage in Final Cut Pro (or any other mac app/plugin)? The data is in the stream I just can't find a way to show it. thanks in advance.
    -Juan

    In FCP? No.
    In FCP via a plug-in? No.
    Outside of FCP in a separate app? Yes.
    Which ones?
    - CatDV
    - iDive

  • How can I read the data from PS/2 port in order to store timing of mouse click?

    I am using LabView 5 and later.

    Another method would be to use an event. The event would start a timer, or store a timer value based on the event. Of course, this is only available in LabVIEW 6.1, so you would have to upgrade.
    The only possible issue with this is that you would have to deal with the resolution of the system clock, which isn't that good in Windows systems.
    Let us know some specifics, and we may be able to help more. It would help to know why you are doing this, or what your exact requirements are (i.e. timing precision, what you are trying to time the mouse click with, etc.)

  • How can we read the screen field values from the report selection screen wi

    Hi expart,
    How can we read the screen field values from the report selection screen with out having an ENTER button pressed  .
    Regards
    Razz

    use this code...
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_posnr.
    **Read the Values of the SCREEN FIELDs
    CALL FUNCTION 'DYNP_VALUES_READ'

  • How can I read text files from LAN if I only know the hostname?

    I'm new in Java Developing, and dont know the written classes yet. I need help, how to do the following steps?
    <p>1. How can I read text files from LAN if I only know the hostname, or IP address?
    <p>2. How to read lines from text files without read all lines from the beginning of file, just seek to a position.
    (ex. how can I read the 120th line?)
    <p>Please help!
    <p>sorry for the bad english

    I'm new in Java Developing, and dont know the written classes yet. I need help, how to do the following steps?
    1. How can I read text files from LAN if I only know the hostname, or IP address?You need to know the URL of the file. You need to know the hostname, port, protocl and relative path.
    The hostname is server, not file.
    2. How to read lines from text files without read all lines from the beginning of file, just seek to a position.Use the seek() to get to a random byte.
    (ex. how can I read the 120th line?)The only way to find the 120th line is to read the first 120 lines. You can use other file formats to find the 120th line without reading the whole file but to need to be able to detremine where the 120th line is

  • How can we read some bytes from every line of the file

    How can we read some bytes from the every line of the file moving on to the next line
    without using the read line

    Actualiy readLine() takes more execution time
    for reading a part of line if we can do so without
    readLine() we can save some time...Well, if you knew, beforehand, the length of each line, you could use RandomAccessFile and its seek method, but, since you don't, you would have to read the rest of the line character-by-character, checking to see if it is a newline, in order to place the "cursor" at the beginning of the next line in order to read the next few characters you want.
    So, as you can see, you will need to read the entire line anyway (and if you do it yourself you also have to do the checking yourself considering all three possible end-of-line sequences), so you just as well use readLine().
    Some people may suggest Scanner and it's nextLine() method, but that also needs to read the rest of line (as evidenced by the fact that it returns it), so that is no different than the readLine() (or read it yourself) solution.

  • I got new hard driver for my MacBook I don't have the cd but I do have flash drive that has the software I need help because when I turn on my laptop it shows me a file with question mark how can I install the software from the flash driver?

    I got new hard driver for my MacBook I don't have the cd but I do have flash drive that has the software I need help because when I turn on my laptop it shows me a file with question mark how can I install the software from the flash driver?

    Hold down the Option key while you boot your Mac. Then, it should show you a selection of devices. Click your flash drive and it will boot from that.

  • How can I print the calendar from my iPad?

    How can I print the calendar from my iPad/iPhone 4?  I would like each month on a separate 8 1/2 x 11 sheet of paper.  Thanks!

    What print app do you have? I think that you need certain printing apps in order to print the iPad calendar. The print feature is not built into the app itself ...As far as I know.

  • How can i detach the video from a clip so i can only use the audio when using imovie?

    how can i detach the video from a clip so i can only use the audio when using imovie?

    First, go to iMovie/Preferences and enable the Advanced Tools.
    Import the video clip into an iMovie Event. When you get ready to use it in an iMovie Project, select the clip in the Event and drag & drop it on top of a video or photo clip in the project at the place where you want it to begin. When the pop-up menu appears, choose Audio Only.

  • I have lost my phone IMEI  Number 012546005322381, Serial Number 87******A4S, is there a way it can be tracked? Also, how can one remove the device from the itunes account

    I have lost my phone IMEI  Number 012546005322381, Serial Number 87******A4S, is there a way it can be tracked? Also, how can one remove the device from the itunes account
    <Serial Number Edited By Host>

    If you enabled Find my iPhone then you should use that. If not, I'm afraid you're out of luck for finding it. 
    To manage your devices, go to Your Account in iTunes.

Maybe you are looking for

  • When target DB is down in which table is the data from source is stored, also where are the error messages stored in ODI

    When target DB is down in which table is the data from source is stored, also where are the error messages stored in ODI( I am not getting any error message in E$_TARGET_ANI_TEST). When i am running the interface i am getting the below error against

  • How to export just a little piece of a comp?

    Can I export just a little piece of the comp rather than "Export active comp to new track" which delivers the whole comp? After I comp my take and then listen to it again, sometimes I just want to go back and change one little part. The workflow woul

  • Trying to restore my MacBook....

    I saw a few post saying to hold down the option key & a recovery HD or something of that works would pop up but it isn't on mine. Is there an other way around it? I really don't want to pay for support over the phone.

  • Replacing a 250G Hard drive on Mac Pro

    Does anyone have a good idea on how I can replace my modest 250G hard drive with a new 500G WD without having to reload all the software. In other words just mirror the drive to the new one? Thanks.... MAC PRO 2.66 8G of RAM   Mac OS X (10.4.9)   FCP

  • UCS 6248 Fabric Interconnect loud fan RPM noise

    Hello, Our currently installed 6248 Fabric Interconnect pair are generating a loud FAN noise. Is there any way to reduce theirs RPM? So then can be quieter? The server room have proper air conditioning. Some logs as bellow: FABRIC-A(nxos)# show envir