Catching response of jsp into swing

hello,
After your reply about NVP API ,now i am able to make payment through PayPal API .
But now there is anew problem .
i have a Swing application and i want to capture the response of NVP into swing
is there any way to do this?
thanks
jitendra
ideavateSolution

Probably the Windows registries of some workstations in your company are messed up and don't recognize the mime-type, or are running old versions of Internet Explorer that don't understand the official mime-type (vnd.ms-excel). Try updating the Internet Explorer installation of a workstation that does not understand the mime-type and verify if it is working.

Similar Messages

  • Rendering JSP into dummy response to obtain HTML

    Is it possible to render a JSP into a mock response?
    A project I'm working on requires me to render a series of small JSPs that are currently being included into a parent JSP. I would like to be able to render each individually, and then store the resulting String from the response for later use. I don't want to actually affect the real httpservletresponse at this time, just obtain the String from the JSP, store it, and throw away the response.
    Is there an api besides requestdispatcher.forward() and .include() that can be used?
    I tried creating a simple implementation of httpservletresponse, but it actually crashed my tomcat when I tried to pass that to the requestdispatcher.
    I'm thinking about trying the mocks provided by spring, but I'm not crazy about the idea of having 'test' code within a running application ( I guess you don't have to look at it that way though).
    Someone please tell me if I'm trying to do something impossible here:)

    Directly extend HttpServletResponseWrapper. Thats what its there for!
    Actually, heres one I had floating around somewhere. I think I stole the code from somewhere around the net myself :-)
    package evnafets.util;
    import java.io.IOException;
    import java.io.OutputStream;
    import java.io.PrintWriter;
    import javax.servlet.ServletOutputStream;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.HttpServletResponseWrapper;
    * @author evnafets
        RedirectServletStream out;
        PrintWriter writer;
        public RedirectingServletResponse(HttpServletResponse response, OutputStream out) {
            super(response);
            this.out = new RedirectServletStream(out);
        /* (non-Javadoc)
         * @see javax.servlet.ServletResponse#flushBuffer()
        public void flushBuffer() throws IOException {       
            if(writer != null){
                 writer.flush();
            out.flush();
        /* (non-Javadoc)
         * @see javax.servlet.ServletResponse#getOutputStream()
        public ServletOutputStream getOutputStream() throws IOException {
            return out;
        /* (non-Javadoc)
         * @see javax.servlet.ServletResponse#getWriter()
        public PrintWriter getWriter() throws IOException {
            if (writer == null){
                 writer = new PrintWriter(out);
             return writer;
        private class RedirectServletStream extends ServletOutputStream {
            OutputStream out;
            RedirectServletStream(OutputStream out) {
                this.out = out;
            public void write(int param) throws java.io.IOException {
                out.write(param);
              public void flush() throws IOException {
                   out.flush();
    }Basically to use in your servlet/filter/whatever you are running
    FileOutputStream out = new FileOutputStream("myFile.txt");
    RedirectingServletResponse redirector = new RedirectingServletResponse(response, out);
    requestDispatcher.forward(request, redirector );Or something like that anyway :-)

  • How to catch exception in JSP????

    how to catch exception in JSP?
    I use JDeveloper 3.1
    I use connection with database .
    When I insert record in database
    when have duplicate of primary key
    how to catch this exception and
    back to previous page?
    I trying with folowing:
    <jsp:useBean id="RowEditor" class="oracle.jbo.html.databeans.EditCurrentRecord" scope="request">
    <% try {
    RowEditor.setUseJS(true);
    RowEditor.initialize(pageContext, "package2_Package2Module.Drzavi1View");
    RowEditor.setSubmitText("Save");
    RowEditor.setTargetUrl("Drzavi1View_SubmitInsertForm.jsp");
    RowEditor.createNewRow();
    RowEditor.setReleaseApplicationResources(true);
    RowEditor.render();
    catch(Exception e) {
    %>
    <script>
    alert("primary key duplication");
    history.back();
    </script>
    <% } %>
    but i't not working
    please help me

    i catch exceptions as you do, i don't have any problem...
    are you throwing the exception from your bean?
    actually i don't catch an Exception, but an SQLException...
    but it works... here is my code...
         try
    myclass.addElement(); // this is an insert into Oracle
    catch( DataBaseFailException e ) /// an exception that i throws inside after i receive an SQLException
              session.setAttribute("gMessage","e.getMessage()); // error code

  • Conversion tool from JSP to SWING

    Hi,
    I have to convert all my JSP pages into SWING. Is there any tool which can convert JSP pages into SWING?
    Thanks,
    Prakash

    You're passing the string as a number in the onclick call to ChangeAbu.
    Add quotes around the <%=PccrNumber%> to make it a string:
    So change
    > " onclick="ChangeAbu(<%=PccrNumber%>)"></td>
    to
    " onclick="ChangeAbu('<%=PccrNumber%>')"></td>
    and see if that helps

  • JSP into syand-alone application

    Is there a way to convert the servlets and JSP pages into a stand alone application?
    My application uses the JSP's for user interface only, all the functionality and DB interaction are in servlets. What I need is to convert this online application into a standalone that will run from a PC/laptop without having the user install and run a Web server and Servlet/JSP container just to access the applicaiton.
    Any help or good direction will be appreciated.
    Shai

    I have never done this, so I may not know what I am talking about, but if I was working on a project like this I would use an XML description layer and then have a class to interpret this into JSP (I believe there are XML based template systems as part of the Jakarta.apache project, although I can't remember their names off hand) and a seperate class to interpret it into Swing.
    I am guessing you are starting from existing code, so this may not be viable, but if you are not it is a very good solution.

  • To open a pdf document or word document from a JSP into a new window

    Hi,
    How to open a PDF document or word document from a JSP into a new window. i.e say from a jsp when a hyperlink or button is clicked it should open a new window with the pdf document or word document in it.
    thanks in advance,
    radki_j

    Hi ,
    when i tried to use the below code to open my word document , it will open as html and with some garbage details. Doesnt open as word document. How to solve this kind of probem?Need advice urgently.
    Open Document

  • Calling multidimensional array in JSP into other JSP

    hello friends,
         nice to c good replies over here...so i want to post my problem in JSP using multi-dimensional
    array..
    One JSP contains mutli-dimensional array and i want to call this JSP into the other JSP in which i can use the values of that array.

    i think the jsp include directive should be suitable for you. the variables from the included jsp can be used in the jsp which is including it.
    <%@ include file="whatever.jsp" %>

  • R12.0.04 -Sync responsibility role data into the WF table -affurg02.sql

    Heloo my friend ;
    I try to run the following concurrent requests :
    Sync responsibility role data into the WF table and its gives me error and the erros is :
    Cannot find file /oracle/VIS12/apps/apps_st/appl/fnd/12.0.0/sql/affurg02.sql
    Cause: Application Object Library could not could not locate the file specified.
    Action: Contact your system administrator. Verify that the specified file and
    Concurrent Manager encountered an error while running SQL*Plus for your concurrent request 4585216.
    I didnt find anything in metalink,
    Anyone has idea?
    Helios

    Run "Workflow Directory Services User/Role Validation" concurrent program instead. <<I already did it... the link whihc u send me it doesnt say nothing.. The document say it only
    STEPS TO REPRODUCE THE PROBLEM:
    Navigate > System Administrator > Requests > Run . Select Sync responsibility role data into wf tables program.
    *** 02/19/08 01:59 am ***
    *** 02/19/08 02:00 am ***
    *** 02/19/08 04:09 am *** (CHG: Sta-&gt;30)
    *** 02/19/08 04:09 am ***
    *** 02/19/08 05:50 am *** (CHG: Sta-&gt;11)
    *** 02/19/08 05:50 am ***
    *** 02/19/08 08:44 am *** (CHG: Asg-&gt;NEW OWNER)
    *** 03/06/08 09:34 am *** (CHG: Sta-&gt;30)
    *** 03/06/08 09:34 am ***
    *** 03/16/08 12:31 pm *** (CHG: Sta-&gt;33)
    *** 03/16/08 12:31 pm ***
    *** 03/30/08 10:00 pm *** (CHG: Sta-&gt;92)
    *** 03/30/08 10:00 pm ***
    There is no solution, i found this documentation already but i cant see that
    *** 03/30/08 10:00 pm *** .... i hope u have other idea... i already try what u said me my friend ..
    Helios

  • Can u Compile JSP into a Servlet?

    Hey,
    I've heard of 'compliling jsp into a servlet.' I'm not sure if this is just reffering to the fact that the jsp/servlet engine does this on the fly when serving a jsp request or if one can actully obtain a .java file out of the jsp without doing it by hand.
    If so, how do you do this??
    THANKS!
    THABARREN

    look in Tomcat's /bin directory for a script called jspc.bat (or jspc.sh) - this can be used from a command line to convert a JSP to a servlet and compile it.
    Alternatively, the web server will have a "working" directory where it puts the servlet files it creates from JSPs (in Tomcat's case it's the "/work" directory). - just look in there after the JSP has been requested by a client.

  • How can I get the value for static content of 1 jsp into another jsp

    Hi, I have a jsp which have a header ,now i want this header value in another jsp dynamically.Can u tell me how I can do it?

    What I want to know is that , is it possible to get the value of a static content of one jsp into another jsp,something like getParameter() method that we use to get the value of a field in the jsp to a servlet,or to another jsp,the only difference here is I do not have a field here but a static jsp content .

  • How to embed exsisting image into Swing programme?

    Just wondering, is there anyway to embed an exsiting image into swing programme, like a .jpg or .gif? Thanks!

    It's also nice to package it in the .jar file. If you put it in "rc/image.jpg" (relative to the root of the jar file) you can do something like this:
    new ImageIcon(getClass().getResource("/rc/image.jpg"));

  • Transforming jsp into xml

    Hi,
    I have some *.jsp files wich I have to transform into xml and xsl pages.
    Can anyone help me with his advice?
    And maybe someone knows a handy tool to transform jsp into xml?

    Refer to
    http://developer.java.sun.com/developer/technicalArticles/xml/WebAppDev2/

  • How to catch ClassCastException from JSP page?

    I get a ClassCastException within my JSP page and I know where my bug is. However, this classcastexception message is displayed in the browser and I want to catch this exception to also log it into my log file. But I can't find the place where to catch it: in my servlet's doPost() method I can't catch it - i tried it by enclosing the method body with try/catch but it isn't catched. I wonder if I can catch it at all or if this error is handled internally in the servlet engine?

    It should only be displayed in the browser if you're not catching the exception in the jsp itself. If the exception is happening in the jsp, then there's no point in trying to catch it in the servlet.
    What happens if you put a try-catch just around the actual code in the jsp? You could put it around the entire jsp, but that's not necessary.
    One problem I've encountered in catching exceptions is if there are escape sequences within the try block, for example:
    try{
       //java code
    %>
       <!--html -->
    <%
    //java
    catch (Exception e)I'm not sure if that works or not, but to be safe, make sure you're not escaping from jsp within the try block.

  • How do i retrieve information from the JSP into my SELECT statements?

    I need to retrieve the information that is being entered into JSP page.. So that i can use them to do an SQL statement.. but im not very sure if my codes are correct.. Following are my codes.. Pls help.. thx
    MyJSPPage.jsp
    <jsp:useBean id="user" class="user.User" scope="session"/>
    <form name="loanItem" method ="POST" action="user">
    <input type="hidden" name="userID" value="<jsp:getProperty name="user" property="userID"/>">
         <tr><td align=left height="34"> <b> <font size="4">Member ID:</font>
    </b> </td>
              <td height="34">
              <jsp:getProperty name="user" property="userID"/></td>
         </tr>     
    ==================================================================================
    MyManager.java --> this file is where all my SQL statements are ..
    [l]String itemType = session.getParameter("itemType");[l] (--->> is how i retrieve info from the JSP page?)
              if (itemType.equals("Book"))
                   String sqlQuery1 = "select loanDuration from ItemPolicy where itemType ='" + itemType+ "'";
                   System.out.println(sqlQuery1);
                   ItemPolicy itempolicy = null;
                   try {
                        db = new Database();
                        rs = db.readRequest(sqlQuery1);
                        if (rs != null && rs.next()) {
                             itempolicy = new ItemPolicy();
                             itempolicy.setLoanDuration(Integer.parseInt(rs.getString("loanDuration")));
                        db.close();
                   } catch (SQLException se) {
                                  se.printStackTrace();
                                  throw (new UserException("Unable to retrieve from Database!"));
                             } catch (Exception e) {
                                  e.printStackTrace();
                                  throw (new UserException("Unknow error encountered!"));
                   String dueDate = util.getDueDate(itempolicy.getLoanDuration());
              else if (itemType.equals("Magazine"))
    ==================================================================================
    Thanks in advance...

    you should change to request.getParameter("itemType").
    or just System.out.print the itemType to see it got the value.
    Hope it helps.

  • Catch problem for JSPs, can't i use Oracle9iAS for our  Application ?

    Hi,
    I have deployed .ear file by using OC4J. I am facing catch problem, in defferent situations.
    1. We used pager tag library for search nagivation, it is not working proper.
    2. 'Creation of new object(in my case enterprise,certificate,role etc.)' is not working
    properly. What ever i try to create it is giving Error in
    TrainiumPKCallBean :javax.ejb.DuplicateKeyException: Entity already exists
    3. And some of my pages not giving proper results, but if i edit that .jsp file, then it
    gives correct request for that time. If i want correct result, then again i have to edit and
    save that page.
    I belive all the above problems are coming due to catch.
    If this problem continues, we can't use Oralce9iAs.
    please give me solution..
    thanks in advance
    srinivas.

    Hi Srinivas,
    I must admit, I had difficulty understanding your question. With your
    permission, I'll try and rephrase it. Hopefully I have understood it
    correctly, and can offer something constructive.
    I assume that "TrainiumPKCallBean" is a CMP entity bean. You are invoking
    the "create()" method in that bean's home interface from your JSP, correct?
    When you invoke the "create()" method of a CMP entity bean's home interface,
    OC4J will try and insert a row into the relevant database table(s).
    A "DuplicateKeyException" means that OC4J is trying to insert a row
    that has a primary key of an already existing row in the database
    table. The only way to avoid the "DuplicateKeyException" is either
    try to use a different primary key value, or delete the row from the
    database table with the primary key that you are trying to insert.
    So I suppose that by editing the JSP, you are changing the primary
    key value to something that doesn't already exist in the database.
    Unfortunately, based on the (lack of) information you have supplied,
    I can't offer anything else -- sorry {:-(
    If you wouldn't mind supplying the following information -- it may
    help me to help you solve your problem(s).
    1. Version of OC4J
    2. JDK version
    3. Operating system
    4. Complete error message and stack trace
    5. Part(s) of the code that are causing the problem
    Good Luck,
    Avi.

Maybe you are looking for

  • Icon Preview Problem in Finder

    Hi, I've had my new MacBook for about a month now, and as my photo collection has grown I'm starting to notice that while using CoverFlow (which I have as the default view for most of my folders), there are always some icons that appear as a generic

  • Problem with Adobe convertor printer driver

    I'm having 2 separate issue with the Adobe converter printer driver. I'm trying to convert a chm file to PDF file with mixed results. 1.  after the file is converted, it doesn't do a complete job of it.  it produces a pdf file with 68 pages, there wa

  • GetColumns returns nothing

    Hi, I have two cases: 1. databasemetaData.getColumns("", "SCOTT", "TableOne",null); returns me resultset which has info about all the columns in table 'TableOne'. BUT 2. databasemetaData.getColumns("", "SCOTT", "SynonymOne",null); returns me nothing.

  • Convert DateTime to TimeStamp

    Hello all how can i convert this DateTime type value 20060610000000.000000+000 to TimeStamp Value ? Thanks

  • To Re-install or Clone?

    Looking for advice on this situation: I have what I suspect is a failing hard drive. Even though the hard drive passes the disk utility check, there are times that it sounds really bad, grinding away. This is infrequent and unpredictable but it does