Read a HttpServletResponse object

Hello !
I try to catch the html code generated by a JSP in order to put it in a file ( for download ).
At the moment I include the JSP in a servlet so the html code is in an HttpServletResponse object.
Does anybody know how to obtain the contents of such an object ? it does not have any getInputStream() method.
Any idea or proposition will be the timely...
Regards,
Vincent.

The same way you would get the HTML contents of any web page:URL jsp = new URL("http://yourwebserver/yourjsp.jsp");
InputStream is = jsp.getInputStream();
// read HTML from the input stream

Similar Messages

  • Web DynPro - HttpServletResponse object equivalent

    All,
    I was just wondering what is the equivalent of HTTPServletResponse object in Web DynPro.
    Any ideas...........
    Thanks in Advance
    JJ

    Hi JJ,
    first, welcome on the SDN forum!
    About your question:
    There is no direct equivalent. Be aware that the WD rendering is up to the WD runtime, and the client can, but does not have to be a web browser. So presenting WD within a browser is only one possibility (even the one most time used), and for that the response object in general is encapsulated.
    Anyhow, you have the possibility to reach the underlying HTTP objects, see for example Session in WebDynPro or Portal request object. or Portal Session Object in WebDynpro
    Hope it helps
    Detlev
    PS: Please consider rewarding points for helpful answers on SDN. Thanks in advance!

  • Reading from other object

    Hi Guys,
    I dont know whether am following the correct way , I have a scenerio where I have to show in the report Blocking reasons . I have a field from DS Payment Block Key which is 0PMNT_BLOCK in BI. I have 7 Blocking reasons in one table called BSEG and I have enhanced my 0FI_AP_4 DS to include this 7 fields and mapped to 7 BI Objects 0BLCKRSN_PR for price 0BLCKRSN_QL for quality....Now bringing these fileds from BSEG effecting performance as each time the exit is calling. I do have a Text data source (0PMNT_BLOCK_TEXT) which is having same data as I need...So in order to get this Blocking reasons in to my report without enahcing from BSEG table Iam trying to read it from master data . but its not allowing me to do that....When I say read from master data for one of the info object 0BLCKRSN_PR and press F4 its showing no info object available for reading of master data....Can any one tell me why its showing this error...I do have a Master data object 0PMNT_BLOCK which is having the values A B D H M P , so I want to read the above object 0BLCKRSN_PR from this Object ...as P is for Price and so on....
    Do I need to take the seven info objects as attributes of 0PMNT_BLOCK ?
    If so , I didnt find a DS for attributes in ECC , I have only Text DS 0PMNT_BLOCK_TEXT....
    Please advice me what I need to do for this...Also please shoot me a reply If you ahve any more questions....

    the join produces more rows then the sum of it's parts (e.g. 154). For example:
    select owner, name
    from all_source
    where upper(text) like '%BINARY_INTEGER%'
    633 rows selected.
    select owner, type
    from all_source
    where upper(text) like '%PLS_INTEGER%'
    926 rows selected.
    select ds1.owner, ds1.name, ds2.type
    from all_source ds1 inner join all_source ds2 on (ds1.owner = ds2.owner and ds1.name = ds2.name and ds1.type = ds2.type)
    where upper(ds1.text) like '%BINARY_INTEGER%'
    and upper(ds2.text) like '%PLS_INTEGER%'
    5710 rows selected.
    select owner, count(name) as name_cnt
    from all_source
    where upper(text) like '%BINARY_INTEGER%'
    group by owner
    OWNER NAME_CNT
    SYS 577
    WWW 56
    2 rows selected.
    select owner, count(type)
    from all_source
    where upper(text) like '%PLS_INTEGER%'
    group by owner
    OWNER COUNT(TYPE)
    SYS 909
    WWW 17
    2 rows selected.
    this could be a solution then:
    select ds1.owner, ds1.name_cnt, ds2.type_cnt
    from (select owner, count(name) as name_cnt
    from all_source
    where upper(text) like '%BINARY_INTEGER%'
    group by owner) ds1 inner join (select owner, count(type) as type_cnt
    from all_source
    where upper(text) like '%PLS_INTEGER%'
    group by owner) ds2 on (ds1.owner = ds2.owner)
    OWNER NAME_CNT TYPE_CNT
    SYS 577 909
    WWW 56 17
    2 rows selected.

  • Read-Only view object won't give me it's row

    Hi,
    I have a read only view object which when executed has one row in it, but the next method returns null.
    this is my code in the AM:
        public Row getPerson() {
            Row row = null;
            ViewObject vo = getPersonsView1();
            vo.setNamedWhereClauseParam("p_login_id", getUserPrincipalName());
            vo.executeQuery();
            System.out.println("rows:" + vo.getEstimatedRowCount());
            if (vo.hasNext())
               row = vo.next();
            return row;  
        }and the console log:
    06/09/15 10:37:57 [513] select person_id,
    login_id,
    orig_system_id,
    person_type,
    title,
    preferred_name,
    preferred_name ||' '||surname full_name,
    first_name,
    other_names,
    surname,
    phone_work,
    email_address
    from sys_persons
    where person_type = 'Staff'
    and login_id = :p_login_id
    06/09/15 10:37:57 [514] Bind params for ViewObject: PersonsView1
    06/09/15 10:37:57 [515] Binding null of type 12 for "p_login_id"
    06/09/15 10:37:57 [516] *** DCDataControl.sync() called from :DCBindingContainer.refresh
    06/09/15 10:37:57 [517] *** DCDataControl.sync() called from :DCBindingContainer.refresh
    06/09/15 10:37:57 [518] **** refreshControl() for BindingContainer :rft_ConsolePageDef
    06/09/15 10:37:57 [519] *** DCDataControl.sync() called from :DCBindingContainer.refresh
    06/09/15 10:37:57 [520] *** DCDataControl.sync() called from :DCBindingContainer.refresh
    06/09/15 10:38:00 [521] Column count: 12
    06/09/15 10:38:00 [522] ViewObject: PersonsView1 Reusing defined prepared Statement
    06/09/15 10:38:00 [523] Bind params for ViewObject: PersonsView1
    06/09/15 10:38:00 [524] Binding param "p_login_id": banstey
    06/09/15 10:38:00 rows:1
    Source breakpoint occurred at line 38 of SystemServiceImpl.java.Note above System.out.println("rows:" + vo.getEstimatedRowCount()); returns:
    06/09/15 10:38:00 rows:1
    but when i debug with a break point in the above method if (vo.hasNext()) returns false.
    I have tried doing row = vo.next(); without the if statement, but row still evaluates to null.
    The VO returns one record in the BC4J tester and I have this exact method and VO defined in another project and it works there. Tearing my hair out with this one...
    Brenden

    try RowSetIterator instead,
    RowSetIterator it = vo.createRowSetIterator("myIt");
    if(it.hasNext())
    MyVORowImpl row = (MyVORowImpl)it.next()
    //don't forget close the RowSetIterator
    I guess you use the VO.next(), but the current row of the VO is the one you get from db, and his next is null...

  • Finding Application Module name in read-only view object classes

    Hi all,
    I have a fairly basic question about finding application module name when we are coding in ViewObject java classes.
    I want to know how can I obtain <<application module>> NAME that our current view object is contained in it at run-time. I think there should be a way to find current application module NAME, when we are in ViewObject classes including View Object, View Row or view object definition classes (I've overridden all mentioned classes).
    I should notify that since our view object is read-only I may not count on view object's entity classes, coz as you know a read-only view object don't have any entity in it!
    So, if you have any idea about finding current application module name in view object java classes please let me know.
    Appreciate for your replies,
    Nasser

    Thanks guy, it was helpful:)
    Now i can access application module name through viewObject classes.
    But another question is raised...sorry if i m boring:( I promise its the final question ;)
    Is there a way to get application module name in an extended version of JboException class?
    Thanks again for your reply:)
    Nasser

  • ADF View Criteria on a Read Only View Object

    Hi,
    I have created a read only view object using a query. The query consists of analytical functions to fetch the AVG values dynamically.
    So far my approach worked fine.
    I want the Average values in my query to be calculated dynamically based on the certain view criteria.
    But after applying view criteria, my query is formulated as shown below:
    SELECT * FROM (SELECT   RECEIVED_YEAR,
               WEEK_NO,
               NO_RECEIVED,
               NO_STARTED,
               ROUND (TO_NUMBER (REPLACE (AVG_HRS_TO_START, ':', '.')),2) AVG_HRS_TO_START,
               ROUND (AVG (TO_NUMBER (REPLACE (AVG_HRS_TO_START, ':', '.'))) OVER (ORDER BY RECEIVED_YEAR),2)              OVERALL_AVG_HRS,
               GOAL_HRS,
               ROUND (AVG (NO_STARTED) OVER (ORDER BY RECEIVED_YEAR), 2) AVG_NO_STARTED,
               ROUND (AVG (NO_RECEIVED) OVER (ORDER BY RECEIVED_YEAR), 2) AVG_NO_RECEIVED
               FROM ORDERS_RCPT_TO_START_VW
    ORDER BY RECEIVED_YEAR, WEEK_NO) QRSLT  WHERE ( ( ( ( (RECEIVED_YEAR = :RecdYear ) AND (WEEK_NO <= :weekNo ) ) ) ) )
    As per this query, it is calculating the Average values first and then applying filter criteria rather than applying the filter criteria and calculating average values.
    Please help me on this.

    Entity objects are used to update/delete/insert data to the database.
    If all your base DB object offers is read then just create a read only view object.

  • Having Trouble Reading in an Object

    im trying to read in a JTabbedPane (called AZTabs) using this method:
    public void readContact(){
            in = null;
            try{
                in = new ObjectInputStream(new BufferedInputStream(new FileInputStream("files/contacts")));
                for(index3 = 0; index3 < AZTabs.getTabCount(); index3++){
                    AZTabs = (JTabbedPane)in.readObject();
            }catch(ClassNotFoundException e){
                System.out.println("Caught ClassNotFoundException " + e.getMessage());
            }catch(IOException e){
                System.err.println("Caught IOException " + e.getMessage());
            }finally{
                if(in != null){
                    try{
                        in.close();
                    }catch(IOException e){
                        System.err.println("Caught IOException " + e.getMessage());
        }whenever i run my app it give me this exception: "Exception in thread "main" java.lang.ClassCastException: javax.swing.JPanel cannot be cast to javax.swing.JTabbedPane". any1 know what i can do to solve this problem?
    thnx guys

    The data you are trying to read is a serialized JPanel.
    When it is read in, the object it produces is a JPanel.
    You cannot treat a JPanel as a JTabbedPane because it is not a JTabbedPane, it is a JPanel.
    I don't see how you're getting confused.
    JTabbedPane p = (JTabbedPane) in.readObject();
    // throws a ClassCastException at runtime because the readObject() method is returning a JPanel
    JTabbedPane p = (JPanel) in.readObject();
    // produces a compiler error because you cannot assign a JPanel reference to a JTabbedPane reference
    JPanel p = (JPanel) in.readObject();
    // should work just fine and dandy

  • OWB Issue|| ORA-12838: cannot read/modify an object after modifying it in

    Hi
    I am not able to enter the data into the staging table .
    it is also not throwing any error ,only giving warnings.
    so as a next step i just took the intermediate result generation and try to run it
    but it is giving me an error in that
    ORA-12838: cannot read/modify an object after modifying it in parallel
    Can you please help me in tthis case.
    Thanks

    Hello,
    The error ORA-12838 occurs if you try to issue SELECT/DML immediately after completing parallel DML, within one transaction - it's not permitted.
    Start another transaction - issue Commit or Rollback first.

  • Read a view Object parameter value

    can anyone tell me how to read a View Object parameter value from inside a DODML()?
    Thanks

    Please help us to understand the use case better. Can you please details the scenario? Are you looking for the bind variable value used for querying ?

  • Does acrobat has any option to read pdf content objects(stamps, layers, images etc) without using pl

    Does acrobat has any option to read pdf content objects(stamps, layers, images etc) without using plug-in in c#.net ?
    My requirement is read a pdf file and extract all the page objects(stampls, layers and images) along with its coordinates. Is it possible to get without using plug-ins in c#.net ?
    Please hlep me.

    These are very different things.
    JavaScript has some access to layers (called OCG). Layers are just names and have no coordinates to retrieve.
    Stamps may be annotations; there is some minimal access to these too I think. It may be hard to identify what is, and is not, a stamp even with a plug-in.
    Images are part of the actual page contents, and are only accessible to plug-ins.

  • Partial read-only view object. How to make it work?

    Hello,
    is there a way to have a "partial" read-only view object, where some attributes are based on an EO and some others are extracted directly from a table with no corresponding EO?
    On this view-object it should be possible to perform row insertions from an af:table, in a way that, after validation (i.e. a row selection change), the values on the attributes not based on the EO do not get lost, even if they do not have any attributes based on an EO.
    On the other hand, if I use fake EO attributes ($none$) for those read-only attributes, their values will not gest lost after validation of the new interted rows, but in this case, when the table is first rendered on the page, the table shows empty values on those items, probably because the EO attributes are empty when the query is performed.
    Note that It seems I cannot use Transient attributes where their value is calculated with a SQL statement, since it would mean I would have to perform an heavy SQL statement for every transient attribute.
    Is there any other solution, I hope the problem is clear.

    That solution does not cover the case where an attributed of one entity used as reference is calculated from a SQL expression with parameters involving the remaining attributes of the same entity.
    For example consider a reference-only entity based on a table with one field T(COD). This entity has one more attribute other than COD itself, CALCULATED_VALUE.
    How can I bind the attribute CALCULATED_VALUE to a SQL expression which is a function of COD: MyDBPackage.GetValue(COD, :environment), where :environment is bind variable?
    The frameowork always give me JBO-exception , asking to specify IN or OUT for the variable.

  • What is the best combination of read and write objects to binary files ...

    Hi everyone,
    what are the best combination of read and write objects to read/write a record of customers from a binary file. I should be able to use StringTokenizer. I am bit confused with all these Stream reader and writers.
    abdul

    You are, indeed, confused:
    o StreamTokenizer works on character input, not binary input.
    o Readers and Writers in general work on character streams, not binary.
    That leaves you various input streams and output streams for reading binary data.

  • ORA-12838: cannot read/modify an object after modifying it in parallel

    I am getting the above error when i hit this part in my load ....
    can somebody suggest me why it could be in this case ?
    MERGE INTO PART1 H
    USING (SELECT PA1,                              PART1,                                   CON1,                                   GEO1,                                   COUN1,                                   KIT1                          FROM W1 ) WH ON
                                       (H.PART1=WH.PART1)                                   --on PK darshan 01-03-2006
         WHEN MATCHED THEN
    UPDATE SET                                   H.CON1     =WH.CON1,                         H.GEO1     = FN_GETGEOCODE ( WH.GEO1 ),               H.COUN1     =WH.COUN1,                         H.KIT1     =WH.KIT1,                    H.DT1     =TO_NUMBER(TO_CHAR(FN_GETGMTDATE(SYSDATE),'YYYYMMDD')),                              H.DT_LAST1          = FN_GETGMTDATE(SYSDATE)
              WHEN NOT MATCHED THEN
         INSERT     (H.PART1,                                   H.PART2,                                   H.CON1,                                   H.GEO1,                                   H.COUN1,                                   H.KITD1,                                   H.DT1,                                   H.DT_1,                                   H.DT_LAST_1)
              VALUES(CASE FN_MERGE_COUNTER(gpi_inserting)
                   WHEN 0 THEN     WH.PART1 END,                         WH.PARTN1,                              WH.CON1,                              FN_GETGEOCODE ( WH.GEO1),                    WH.COUNT1,                              WH.KIT1,
              TO_NUMBER(TO_CHAR(FN_GETGMTDATE(SYSDATE),'YYYYMMDD')),                                   PKG_COMMONACTIVITIES.FN_GETGMTDATE(SYSDATE),                                        PKG_COMMONACTIVITIES.FN_GETGMTDATE(SYSDATE)
                                            );

    does this give you a clue?
    SQL> CREATE TABLE t AS
      2  SELECT owner, object_name FROM all_objects
      3  WHERE 1=0;
    Table created.
    SQL> INSERT /*+ APPEND */ INTO t
      2  SELECT owner, object_name
      3  FROM all_objects;
    8982 rows created.
    SQL> SELECT * FROM t;
    SELECT * FROM t
    ERROR at line 1:
    ORA-12838: cannot read/modify an object after modifying it in parallelI bet that you need a commit after loading w1.
    John

  • No authorization to read the authorization object

    Hi all,
    We have implemented (on Bw 3.0B) authorization profiles using <b>0TCTAUTH</b> and <b>0ORGUNIT</b>. It works fine, but when an user deactivates the hierarchy (by using the option on Bex), there is an error "Brain 804 No authorization to read the authorization object".
    I've seen that there is an Oss note <i>(N 844408 No Authorization after deactivating display hierarchy)</i> and it seems to be a support packages problem.
    Is there someone who could tell me if there is another solution to resolve this problem before installing Support Pakage ?
    Thank u all

    Hi Alessandro,
    You are right no way other than support packages .
    Following note may help you.
    a> 844408
    b> 695523
    Hope this will help you.
    Suneel

  • Stopping OA Output to the HttpServletResponse object

    Hi,
    We have a 3rd party tool that generates xls files (Excel files) and writes them to the response object, this, of course, causes a pop-up window to appear to the user so they can download said xls. The problem is that when we are done writing the Excel spreadsheet to the response OA goes in and writes the page with current state(typical and expected response to a post-back) to the response as well.
    We use the following method to obtain the http response object in the CO:
    (HttpServletResponse)pageContext.getRenderingContext().getServletResponse()
    The question at hand is this, is there anyway to stop any further output to the response object... to just tell OA just stop everything and return now, or continue but don't write anything else to the response.
    Thanks a lot,
    Mike

    I figured it out.
    pageContext.setDocumentRendered(false);

Maybe you are looking for

  • Album List view in iTunes is black with white text

    iTunes just started doing this yesterday. All other views appear normal. I uninstalled and reinstalled iTunes and the problem persists. Anyone have the same problem?

  • IOS 6 what's up application problem

    Hi everyone, I have iPhone 4 and update IOS 6. But I have some problem now. I'm using What's up application. I didn't pay money because when I download this application It had been free. Anyway When I start What's up I didn't see pictures other conca

  • Formula variable - Maximum Date in result output

    Hello Guys, Scenario - Data in Cube *Reseller      Sales Date* RS1          01.01.2010 RS1          01.01.2011 RS1          01.01.2012 RS2          01.01.2008 RS2          01.01.2009 RS2          01.01.2010 Required Output - Display one record for ea

  • "This entry already exists in the following table 'Vat Transactions' (OTAX)

    Hi Experts, I have  some trouble adding new invoices into SAP. Copying from the Sales order to an AR Invoice the following error occurs Firstly, I get a system message "The Customer ref. no of this type already exists" on processing it follows with a

  • Colorize option

    Many of the tools like Hue/Saturation have a checkbox for colorize? 1. why would you use one of these tools and not want the colorize option selected? 2. it seems that the tools have a color changing effect whether this checkbox is selected or not? W