Referring OAPageLayoutBean through servlet.

Hi,
I want to refer to OAPageLayoutBean object from my Servlet or normal java class file.Any idea ..Can that be done.?
Thanks

Any requests made to a JSP are of a certain content. Generally you make a request to a JSP page it sends back a "text/html" document. There is noi binary data as such just text.
Images on a page are displayed because the "src" attribute of the image tag points to a server location. This in turn returns content of type "image/*".
A servlet can retrieve/generate your images for you for example you could point to a servlet:
<img src="/system/imageServlet">
I guess a JSP can do the same (I've never tried it) just remember to set the response.contentType to "image/gif"/"image/jpg".....
Cheers,
Anthony

Similar Messages

  • Not able to retrieve data from database through servlet

    Hi friends,
    I am trying to open a excel sheet through servlet. In this servlet i am retriving data from mssql database.I am not getting any error but no data is retrived
    i m also pasting the code here
    // Decompiled by Jad v1.5.8f. Copyright 2001 Pavel Kouznetsov.
    // Jad home page: http://www.kpdus.com/jad.html
    // Decompiler options: packimports(3)
    // Source File Name:   EmployeeData.java
    import java.io.*;
    import java.sql.*;
    import javax.sql.*;
    import javax.servlet.ServletException;
    import javax.servlet.http.*;
    public class EmployeeData extends HttpServlet
        public EmployeeData()
        public void service(HttpServletRequest httpservletrequest, HttpServletResponse httpservletresponse)
            throws ServletException, IOException
            httpservletresponse.setContentType("text/html");
            httpservletresponse.setHeader("Content-Type", "application/excel");
            httpservletresponse.setHeader("Content-Disposition", "filename=reports.xls");
            PrintWriter printwriter = httpservletresponse.getWriter();
            try
                javax.servlet.http.HttpSession httpsession = httpservletrequest.getSession(true);
                int i = 0;
             /*   Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();
                Connection connection = DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:3413;DatabaseName=newreportsodbc", "reportuser", "cisco");*/
                String url="jdbc:odbc:newreportsodbc";
                Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
                Connection connection = DriverManager.getConnection("jdbc:odbc:newreportsodbc","reportuser","cisco");
                Statement statement = connection.createStatement();
                printwriter.println("<b><center><u> Search Results </u></center></b>");
                printwriter.print("<table><tr><th color=brown background-color=#fff000>  No.  </th>");
                printwriter.print("<th> DateTime      </th></tr></table>");
           ResultSet resultset = statement.executeQuery("SELECT * FROM t_Call_Type_Half_Hour");
                boolean flag;
                for(flag = false; resultset.next(); flag = true)
                    i++;
                    SerialNo = resultset.getString(2);
                    printwriter.print((new StringBuilder()).append("<table><tr><td> ").append(i).append("</td>").toString());
                    printwriter.print((new StringBuilder()).append("<td> ").append(SerialNo).append("</td></tr></table>").toString());
                if(!flag)
                    printwriter.println("<h1> No records selected </h1>");
            catch(Exception exception)
                System.out.println((new StringBuilder()).append("SQLException: ").append(exception).toString());
        static String empid1;
        static String empid;
        static String SerialNo;
        static String designation;
    }thanks in advance. i just feel there is something to be done with connection string.

    post the table format in SQL

  • Store Image through Servlet

    I want to store a JPG image into database column through Servlet
    and dispaly it on a JSP page through Beans
    how can i ?

    Any requests made to a JSP are of a certain content. Generally you make a request to a JSP page it sends back a "text/html" document. There is noi binary data as such just text.
    Images on a page are displayed because the "src" attribute of the image tag points to a server location. This in turn returns content of type "image/*".
    A servlet can retrieve/generate your images for you for example you could point to a servlet:
    <img src="/system/imageServlet">
    I guess a JSP can do the same (I've never tried it) just remember to set the response.contentType to "image/gif"/"image/jpg".....
    Cheers,
    Anthony

  • Problem in opening .ics and .vcs file types through servlet in IE browser.

    I'm having problem in downloading an .ics and .vcs file through servlet in I.E browser. It is happening fine in Mozilla firefox(they both are getting opened in OutLook), but in IE it says as undefined file type.
    I'm using Content Type as : 'text/Calendar' and then setting header as :
    response().setContentType("text/Calendar");
    response().setContentLength(file.length());
    response().setHeader("Content-Disposition", "attachment;
    filename="+filepath);
    and after that i'm writing it to OutPut stream.
    Plz Help.

    Hi,
    On page load check whether the session values are there. If not redirect the user to the login page.
    Hope this helps,
    Regards,
    Sammani

  • Objects through servlet

    How to pass the object through servlet?

    I can venture a guess that the OP wants to 'send' an object as a request parameter or a form field.
    You'd have to turn the object into some data representation that can later on be translated back into the object; serialization comes to mind. It might be easier to just send the properties of the object as seperate request/form fields though!

  • Insert Arabic through Servlet

    Hi,
    I am able to read Arabic characters through servlets and able to display in a browser .
    But when I try to insert Arabic characters to Oracle Database through servlets ,
    it is saved as ??????? or inverted question marks
    Kindly help me resolve this issue.
    Thanks and Regards
    Jailani

    and since email replies won't work with the "<>" chars in them:
    in application.cfm
    <cfset setEncoding("url","UTF-8")>
    <cfset setEncoding("form","UTF-8")>
    <cfcontent type="text/html; charset=UTF-8">
    at the top of your cf pages add:
    <cfprocessingdirective pageEncoding="UTF-8">

  • Oracle NoSQL through Servlet.

    Hello Everyone,
    I am trying to execute the nosql operations on server through servlet. I want to make an client server application but dont know why the CONNECTION TO KVSTORE IS NOT ESTABLISHED WHILE EXECUTING ON SERVLET.
    So is there any separate configuration needed to do so?
    Thanks In Advance.

    Could you be more explicit please?  What is the exact error you are seeing?
    Please explain in detail what is the issue you're facing.
    If you want to access an Oracle NoSQL Database KVStore through a servlet the best way would be to use a ServletContextListener in your web app that gets the KVStore handle and places it in application/context scope as an attribute (so that all servlets and JSPs would have access to it) and also closes the handle when the web app gets shut down.  You could even supply the store name, store host name and store host port (the helper host port -- hostName:hostPort) through the web.xml web app config file.
    Here is a simple example of such a ServletContextListener:
    import javax.servlet.ServletContext;
    import javax.servlet.ServletContextEvent;
    import javax.servlet.ServletContextListener;
    import javax.servlet.annotation.WebListener;
    import oracle.kv.KVStore;
    import oracle.kv.KVStoreConfig;
    import oracle.kv.KVStoreFactory;
    * KVStoreClientContextListener implements ServletContextListener, hence it will be
    * invoked when the application context is initialized and destroyed.
    * @author Andrei Costache
    @WebListener
    public class KVStoreClientContextListener implements ServletContextListener {
        @Override
        public void contextInitialized(ServletContextEvent sce) {
            ServletContext sc = sce.getServletContext();
            KVStore ondbstore = null;
            try {
                // Try to get the store name, store host name and store host port from web.xml,  as context attributes.
                // If they are not available, then default to the values specific to a default KVLite instance.
                String storeName = (String) sc.getAttribute("storeName");
                String hostName = (String) sc.getAttribute("hostName");
                String hostPort = (String) sc.getAttribute("hostPort");
                if (storeName == null) {
                    storeName = "kvstore";
                if (hostName == null) {
                    hostName = "localhost";
                if (hostPort == null) {
                    hostPort = "5000";
                // Get the KVStore and place it as an atribute in application/context scope.
                ondbstore = KVStoreFactory.getStore(new KVStoreConfig(storeName, hostName + ":" + hostPort));
                sc.setAttribute("ondbstore", ondbstore);
            } catch (Exception e) {
                sc.log("Could not get a KVStore instance");
        @Override
        public void contextDestroyed(ServletContextEvent sce) {
            KVStore ondbstore = null;
            ServletContext sc = sce.getServletContext();
            try {
                ondbstore = (KVStore) sc.getAttribute("ondbstore");
                if(ondbstore != null) {
                    ondbstore.close();
            } catch (Exception e) {
                sc.log("Could not successfully close the KVStore handles");
    In your servlets or JSPs you will simply retrieve the KVStore handle from the servlet context, where it is found as a context scope attribute:
    KVStore ondbstore = (KVStore) getServletContext().getAttribute("ondbstore");
    and do whatever operations you want using the KVStore handle.
    You will need the NoSQL Database kvclient.jar -- either your web container / application server can load it, or you could copy it under the WEB-INF/lib directory so that it gets loaded when your web app gets deployed and started.  (kvclient.jar is found under kv-M.N.P/lib).
    Regards,
    Andrei

  • Running an executable file through servlet

    Hello People,
    I tried searching about this on the Forums, but could not find the right solution.
    Please donot get annoyed if you find this to be a repeted topic, which I am sure is not.
    I want to run a .sh file in Unix environment through servlet.
    Actually i want to do this inorder to schedule a report servet to run a report and generate the output in a particular format on a click of a button.
    I tried using Runtime.getRuntime().exec method, (which I know through forum is unreliable)
    Can anyone suggest me a method through I can achieve this?
    Any suggestion is appreciated.
    Regards,
    Rohan Kamat

    Hi MOD,
    Thanks for the quick reply.
    Heres what I am doing to schedule.
    1) The client selects the necessary parameters from the front end and then saves it in a table.
    2) This he will be doing for as many reports as he wants, on an average there will be 200 reports daily.
    3) Once he has selected all the parameters for all the reports, he will go to the next screen and fire a script to run the reports at a time.
    4) This script will be fired only once. And once it is fired it will generate a PDF files of the reports.
    5) On the front end the screen will be refreshed showing the users the status of the reports that he has scheduled to be run
    I am using Servlets 2.0 version, and jdk.12
    Regards,
    Rohan Kamat

  • Working with markups through servlet

    Hello,
    There is several problems with using Autovue through servlet.
    Fabula:
    Servlet receives http request, connect to the vue server (vue servlet via ServerControl), load .dwg file into
    vuebean by vuebean.setFile(new DocID(fileName)) and load markup by simple calling markupbean.readMarkup(FileInputStream instance) method.
    I get a markup file name by parsing 'markups.map'. Servlet modifies markup by http request parameters (set new FillColor, for example) and saves markup file -
    markupbean.writeMarkup(FileOutputStream) - very simple process.
    Problems:
    1. After markup changing i need to open dwg with markup (in applet), but i don't know how i can to do this. jVue.openMarkup() doesn't work - i don't understand what parameters are needed.
    2. When markup open via jVue applet GUI, changed TextBox elements are not visible, but presents in markup items list.
    If TextBox is selected it becomes visible! If I change the text or position of TextBox, it will become visible (without selection). This situation applies only to TextBoxes.
    Any suggestions how I can load markups into GUI and fix visibility of TextBoxes after saving via FileOutputStream.

    Hello,
    May I point out some issues where you are implementing code that is not supported nor documented (and probably will not) and consequently help on those topics is not available
    1. I get a markup file name by parsing 'markups.map' -> not documented, not supported, could change on any release.
    2. markupbean.writeMarkup(FileOutputStream) -> where? local datastore is not documented, will need synching, writing to it directly not supported, could change on any release.
    Stating it as a simple action is probably not the best way to describe a over-complicated solution piggybacking on a closed (undocumented) implementation
    Hence my recommendation for an open and properly documented platform
    Perhaps you should have started by describing what you are trying to do
    If what you want to implement is to save markups with a predefined name, then your solution is an overkill (and goes in the wrong direction)
    If you would be kind enough to
    1. follow this forum's rules ie https://forums.oracle.com/forums/ann.jspa?annID=1527
    2. properly state what you are trying to implement in another thread, if possible as it will make search/review easier to the rest of the community
    3. Have a tittle that is descriptive enough
    4. is this solution required to work on a cluster (ie more than one AV server)?

  • Displaying Images through Servlets

    I am using Servletrunner utility to run my servlets. How can I display Images along with other HTML text, to the Browsers through Servlets?

    Print out the <img> tag. The URL you use may in turn reference another servlet that produces an image. You can look at the Java2D (and perhaps Java3D, if you want 3D images) to help you produce the images.

  • Padding in excel  output through servlet,jsp

    Hi ,
    i want response through servlet in excel format.i am using the code lines below.
    response.setContentType("application/vnd.ms-excel");
    response.setHeader("Content-Disposition", "attachment; filename=pif_excel_asp.xls");
    Now i am unable to pad the string with spaces which i am getting through database.can anyone help me.?Thx in advance
    Cheers:
    Akash

    Hi,
    Did you solve your problem? I have the same problem.
    The report fails to run and I get Java error when I follow the example shown in Oracle® Reports Building Reports 10g Release 2 (10.1.2) Chapter 29 to build a jsp.
    Regards,
    neemin

  • Changing referer inside a servlet

    Hi,
    I have a servlet which send some html content to the client browser. from there it gets redirected to some site where i get the referer and the Url address of my servlet. Is there any was by which i can change the referer inside my servlet or the html content i send. so that after the redirection from the browser i need to see the referer which i have set.
    Thanks in advance !
    Pushpak

    try this:
    String referer = "blablabla";
    response.setHeader("Referer", referer);
    NB: you must do this before writing the content of your response body.

  • How to populate the Referance Field Through the Auto Invoice in credit memo

    HI ,
    I m populating the records in RA_INTERFACE_LINES_ALL and creates the cr Memo through the Auto Invoice ,
    but i m like to populate the Referance Field which is exist in Header part of the Cr Memo (Benith the TYPE).
    So plz help me,
    that which column of the RA_INTERFACE_LINE_ALL populates ,that gave me a data in the Referance Field .
    However this referance field is carried out from the table.Column =RA_CUSTOMER_TRX_ALL.ct_reference
    Plz Help..
    Regards,
    DK

    what you did?

  • Problem in loading the library through Servlet

    Hello,
    When i wrote an application which accesses my java component that has native methods and it loads the library that has the implementation of these methods, it works perfectly fine.
    But now when i am trying to access the same component through a servlet it is giving an error saying : "no library xyzDLL (xyzDLL.dll) in java.library.path" . When i have my component, servlet code and the DLL in the same directory.
    The code that is there in the component is :
    public class MyComponent {
         public native int create(double id, int a) ;
         static {
              System.out.println("loading the Library ...." ) ;
              System.loadLibrary("xyzDLL") ;
              System.out.println("Library Loaded successfully") ;
    And when i try to access the method in the servlet like :
    MyComponent com = new MyComponent() ;
    com.create(12.5,4) ;
    Can anyone please help me out how this can be solved. I feel like i have to keep the components and the DLL at a proper directory location. Can anybody help me out where should i keep these.
    I am using IBM Websphere Standard edition.
    Thanks in advance,
    patro

    Hi,
    The DLL needs to accessible in the environment of the server. I have not used websphere, but if there is a bat file that is used to start it, then put the directory where the DLL is in your PATH. Or change the system settings to have the directory in the PATH env variable. This will enable websphere to get at the DLL.
    hth
    rahul

  • Disable Save, copy option of PDF through servlet

    Hi,
    I have a servet which displays the pdf files which is stored in a server. That is happening perfectly. But now i need to disable the pdf save copy all those options is that is possible through my servlet. i can control right click and ctrl c using java script but i don't know how i can handle the save as copy option. Any idea ???
    Regards
    Rasa

    rasa wrote:
    I too hate :-)
    But it is a client reqment.
    I am not using itext or pdfwriter calss. as i told i am just reading the file and just showing the user through a servlet. But still let me try the options which you have givenThe base Java libraries can't do what you want. As Saish indicated either the Adobe or iText libraries will be needed. Adobe doesn't sell their libraries separately - you'd have to purchase their giant application server to use it.

Maybe you are looking for