How get ServletContext from within JSP-page

Hi! I was wondering how to get the ServletContext from within a JSP-page?
/Ernstad

The "application" implicit scripting variable is the same thing. e.g
application.getAttribute(...);

Similar Messages

  • Can EJB's be called from within JSP pages?

    Hi,
    (This is a general question, not necessarily related to OAS in any way...)
    I have read/heard conflicting reports pertaining to calling EJBs from within JSP pages.
    Can anyone tell me if it's possible to reference an EJB session bean from a JSP page? Can anyone point me to some documentation on the topic?
    Any help would be appreciated. Thanks!
    David Christopher
    [email protected]

    Hi,
    Check the following code: http://www.jguru.com/jguru/faq/view.jsp?EID=5314 for ejb example.
    -Ruchi
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Davidc:
    Hi,
    (This is a general question, not necessarily related to OAS in any way...)
    I have read/heard conflicting reports pertaining to calling EJBs from within JSP pages.
    Can anyone tell me if it's possible to reference an EJB session bean from a JSP page? Can anyone point me to some documentation on the topic?
    Any help would be appreciated. Thanks!
    David Christopher
    [email protected]<HR></BLOCKQUOTE>
    null

  • How get data from another web page?

    I have my own interface..after i key In a keyword and click search, method post will post the data to server and server will response.write a HTML page that display the result based on the keyword i Key In. The problem is i want the result display on my own page. So how can i read the search result from the HTML page and display on my own design page? I use JSP to built my page. thanks

    I dont know the following solution would solve ur problem, atleast u will get basic idea.
    1st method
    Create an inline frame (IE-IFrame etc), On pressing submit button, Post the data to required page (it might be some page on another server)and specify post target is ur inline frame.
    if u want filter the result data and want to display in ur own way then send ur POST request to ur own JSP and use Http classes to read resend those data to other page (another server) and capture the results implement ur own logic to get desired data and resend to the requested browser
    I hope it would solve ur problem
    Cheers
    Rajendra Bandi

  • Can a servlet get paramters from two jsp pages?

    Hi all,
    I am writing a servlet to get the parameters from two different jsp pages, but I can not find any solution for this problem. Is there any way to solve this problem ?
    Any suggestion ?
    Thanks in advance.

    I am writing a servlet to get the parameters from two
    different jsp pages, what do you mean by that?
    please elaborate your question.

  • How to retrieve the parameter names from a JSP page ? Urgent Please

    Hello,
    Can anybody tell me how to retrieve the parameter names from the JSP
    page. (without using getParameterNames() method.)
    The problem with the getParameterNames() method is I get the Jumbled output.
    I need it very badly
    With regards
    Ananth R
    email:[email protected]
    [email protected]

    Dear duffymo,
    My primary intention is to convert the JSP form information into a XML file.
    If I do not get the Parameter names in the correct order how can I maintain
    tag order in XML file.
    For ex: (JSP PAGE VIEW)
    Name--
    FirstName
    MiddleName
    LastName
    Address--
    Street1
    Street2
    City
    Country
    &so on
    (XML File to be generated)
    <Name>
    <FirstName>Value</FirstName>
    </Name>
    <Address>
    <street1>value</street1>
    </Address>
    & so on
    If I use getParameterNames() to get all the parameter names(Which form the tag names in the XML file ) the Enumeration object it returns will not be in the same order as the text fields in JSP.From this I can not construct a meaningful XML file.
    order means: Order of entry on the page, from top to bottom
    That's it
    Waiting for your responses

  • How to develop and Run .jsp page from Jdeveloper 10g

    Dear All,
    I need to develop one small JSP page using Jdeveloper10g. pls share information How to develop and Run .jsp page from Jdeveloper 10g.
    Thanks in Advance,
    Hanimi.

    Hi Gyan,
    Any Idea how to get DB connection for JSP Pages.
    Our Java guys developed one JSP page for Login page.
    After Log in instead of standard responsibilites page we calling custom jsp page, For getting DB connection they defined one properties file and hard coded DB details on that file and calling, but client is not accepting hard coding.
    Pls give any idea for getting DB connection directly in JSP pages.
    Hanimi.

  • How do I call a 10g report from a jsp page securly?

    How can I call a report from a jsp page securly? We are migrating from 10g forms to J2EE, and we want to keep using our reports. In forms we were able to do this using a cookie. How can I pass a users credentials to reports without the user having to connect to the database? Single Sign-on isn't an option either.
    Thanks,
    Jim

    Hi Jim,
    If you want to pass the user credentials to the report dynamically, then SSO (Single Sign-On) is the only option I can think of.
    If the user credentials can be hard-coded, then the following 2 solutions are possible:
    1. Use cgicmd.dat file, and write the user credentials in the file.
    2. In your report JSP itself, you could write the following:
    <rw:report id="report" parameters="userid=scott/tiger@mydb">
    Navneet.

  • How to call a report from a jsp page

    Hi
    1) Can anyone please tell me how can i view Discoverer report from a jsp page instead of opening it directly thru plus/viewer.
    2) Please clarify do i need to install Infrastructure and OID for it.
    Please advice.
    Thanks

    You need the AS infrastructure if you want to use connections. If you do not intend using connections, you do not require the infrastructure.
    Note that you cannot pass in passwords in the URL any longer. You do not need to pass passwords if you pass in a Discoverer connection id (but then again - if you don't use connections, then you do need to still pass in the connection information - username, password, database, language, EUL)
    I have a post on my blog that describes how to pass a password using an HTML Form submit - http://oraclebi.blogspot.com/2005/08/passing-password-to-viewer.html
    Thanks
    Abhinav
    Oracle Business Intelligence Product Management
    BI on Oracle: http://www.oracle.com/bi/
    BI on OTN: http://www.oracle.com/technology/products/bi/
    Discoverer: http://www.oracle.com/technology/products/discoverer/
    BI Software: http://www.oracle.com/technology/software/products/ias/devuse.html
    Documentation: http://www.oracle.com/technology/documentation/appserver1012.html
    BI Samples: http://www.oracle.com/technology/products/bi/samples/
    Blog: http://oraclebi.blogspot.com/

  • How to get result from another JSP file?

    I have to write a jsp (my.jsp) to get information from another jsp file (other.jsp).
    The other.jsp return integer value (0 / 1) so that user can tell if certain service is available or not. And in my.jsp I need to collect such result and other information from a text file to make up of a XML string.
    How can I call other.jsp to get the result? Thanks a lot.

    Hi, I think I didn't describe the problem clearly
    enough. In fact, there is a JSP file, and if our
    database is currently connected, the JSP will return
    value 1, otherwise, it will return 0. My java program
    need to get that result, and then form an XML string,
    and send the string back to the client. I'm just
    wonder how can I write such a program to read result
    from JSP file. Thanks a lot.Why is this function implemented as a JSP file? It should be implemented as a bean. It would be simple to get the information you require from that bean.

  • I have CS 6 installed on a Win 7 OS machine. I can not connect to the internet to get updates from within the program. How do I fix this?

    I have CS 6 installed on a Win 7 OS machine. I can not connect to the internet to get updates from within the program. How do I fix this?

    IP routing doesn't work the way many folks might initially think it does; functional IP routing requires manual configuration and the establishment of static routes and default routes specific to the local network configurations, and it's very easy to get it wrong, or to get the default route swapped. Multiple NIC boxes don't magically work, either. (Been there, done that, wondered what happened to my network when the paths got reordered or my route settings were messed up, etc.)
    Routing configuration errors can be quite subtle, too. (Again, voice of experience. Ever had a thousand-seat office LAN accidentally routing through your desktop? As the, um, unnamed guilty party discovered, getting into that configuration was subtle. Seeing the performance crater on the fellow's box and on the LAN was obvious.)
    Knowing how IP routing works is a prerequisite to getting this configuration to work; there's manual configuration required. Clearly something has gone weird here.
    What to do? Read up on IP routing. I'll again suggest the threads and the manual mentioned earlier.
    And in general, I prefer to avoid using my comparatively expensive Mac boxes as sub-optimal IP routers or as firewall boxes. General-purpose operating systems and generic x86 boxes are going to be inherently poor IP routers. Dedicated routers (or embedded or surplus x86 boxes with routing software loaded) offload the Mac boxes here, and are also typically easier to configure manage. And "real" IP routers can have hardware specific to efficiently routing packets. Use of an outboard firewall or firewall-router box also greatly simplifies gateway routing, too; it's a configuration that many folks and many businesses tend to use.

  • HOW DO I STOP MY JSP PAGE FROM INSERTING DATA IN DATABASE EACH TIME REFRESH

    Hi,
    HOW DO I STOP MY JSP PAGE FROM INSERTING DATA IN DATABASE EACH TIME REFRESH?
    Thanks

    emekaco wrote:
    Hi,
    HOW DO I STOP MY JSP PAGE FROM INSERTING DATA IN DATABASE EACH TIME REFRESH?
    ThanksSTOP SHOUTING!
    now, while displaying the form generate some random number, or take the current time in millis or whatever. Put that number in a hidden field. Insert that unique number along with the real data into the database, but before you do check if the number already exists. If it does you can be pretty sure this is a resubmit of the same data, so don't allow it. This is one way of many to prevent resubmission of existing data.
    A good way to prevent a refresh from resubmitting altogether is to do a redirect to a result page right after you deal with the POST request. When the user presses refresh then, he/she will refresh the redirect and not the form submit.

  • How to set title of jsp page from resource bundle

    hi ,
    How to set title of jsp page from resource bundle....

    Depends on how you configured and declared the resourcebundle in your JSP. The usual way is just<title>${resourceBundle.messageKey}</title>

  • How to print report in jsp page?

    excuse me,i am new to jsp
    may i know how to pritn report in jsp page or html?
    tq

    here is a hacked up example.. i ripped out a lot, so it may not compile, but you get the idea... the full version is really long and not much new info.. just all awt/display stuff...
    package rowe;
    import javax.swing.*;
    import java.util.*;
    import java.awt.*;
    import java.awt.image.*;
    import java.awt.event.*;
    import java.sql.*;
    import utility.*;
    import java.awt.print.*;
    public class rowePrint extends JFrame implements ActionListener, Printable{
         String printType = "";
         static JButton j = new JButton("Print");
         FontMetrics fm;
         String jID, promotion, product, jComments;
         public void getInfo(int jid) {
              ResultSet rs;
              try {
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   Connection conn = DriverManager.getConnection("jdbc:odbc:rowe");
                   Statement stmt = conn.createStatement();
                   rs = stmt.executeQuery("select j.id as jID, j.comments, p.title as pTitle, p.product, p.packagingCartonCost, p.foldingQuarterCostPerM, p.foldingQuarterCostPerM, j.customizationOption as setupFee, p.perMcost, p.qtyCarton, d.name as dName, d.contact as dContact, d.email as dEmail, d.address as dAddress, d.city as dCity, d.state as dState, d.zip as dZip, d.phone as dPhone, d.fax as dFax, r.name as rName, j.totalQty, j.orderIn, j.estFreight, j.miscCost, j.coverSelection, j.imprintSelection from jobs j, promotions p, dealers d, reps r where j.promotion = p.id and j.dealer = d.id and j.rep = r.id and j.id = " + jid);
                   rs.next();
                   jID = rs.getString("jID");
                   jComments = rs.getString("comments");
                   promotion = rs.getString("pTitle");
                   product = rs.getString("product");
              } catch (Exception e) {
                   System.out.println("getinfo: " + e);
       public void actionPerformed(ActionEvent e) {
            if (e.getSource() instanceof JButton) {  
                   wookie();
         public void wookie() {
              PrinterJob printJob = PrinterJob.getPrinterJob();
              Paper paper = new Paper();
              PageFormat page = new PageFormat();
              paper.setImageableArea(0, 0, 600, 780);            
              page.setPaper(paper);
              printJob.setPrintable(this, page);
              try{
                   //printJob.pageDialog(page);
              //     if (printJob.printDialog()) {
                        printJob.print();
              } catch (Exception e) {
                   System.out.println("wookie1" + e);
         public static void main(String[] args) {
              rowePrint at = new rowePrint("Invoice");
              at.getInfo((new Integer(args[0])).intValue());
              at.drawShapes();
         //     at.wookie();
         public void drawShapes() {
              setBounds(0, 0, 670, 550);
              addWindowListener(new WindowAdapter() {public void windowClosing(WindowEvent e) {System.exit(0);}});
              j.setBounds(10, 10, 10, 10);
              j.addActionListener(this);
              getContentPane().setLayout(null);
              getContentPane().add(l);
              getContentPane().add(j);
              show();
         public rowePrint(String s){
              printType = s;
         public void paint(Graphics g) {
              g.setFont(new Font("Serif", Font.BOLD, 18));
              g.drawString(promotion, 20, 30);
              g.setFont(new Font("SansSerif", Font.PLAIN, 4));
              g.drawString("" + new java.util.Date(), 20, 37);
              g.setFont(new Font("Serif", Font.BOLD, 21));
              g.drawString("Rowe Furniture", 440, 35);
              g.fillRect(440, 40, 145, 25);
              g.setColor(Color.white);
              fm = g.getFontMetrics(new Font("Serif", Font.BOLD, 21));
              g.drawString(printType, 512 - (fm.stringWidth(printType) / 2), 60);
        public int print(Graphics g, PageFormat pf, int pi) throws PrinterException {
            if (pi >= 1) {
                return Printable.NO_SUCH_PAGE;
              paint(g);
            return Printable.PAGE_EXISTS;
    }

  • Writing XML file from a jsp page

    how can i write a xml file from my jsp and store the values and after sometime, for example when the user clicks on the submit button, i check the values from xml file and compare those values from the data base.
    it means both writing and reading xml file from a jsp page...
    urgent help needed......thanks

    You need some API like XSL or JDOM to read data from/to XML file
    you can get a best tutorial from
    http://www.javaworld.com/javaworld/jw-05-2000/jw-0518-jdom.html
    and
    http://www.javaworld.com/javaworld/jw-07-2000/jw-0728-jdom2.html
    after reading both articals you will be able to do both the tasks

  • Opening a seeded OAF page from custom JSP page.

    Hi All,
    We have requirement to open a seeded OAF page from custom JSP page.
    When we try to open URL of an OAF page after passing URL input parameters, we are always getting following error:
    'You have insufficient privileges for the current operation. Please contact your System Administrator.'
    On directly accessing the seeded OAF page, its encoding all the input parameters passed in URL. Also some more encoded parameters are getting added to the URL dynamically.
    Is there any standard way exists to invoke seeded OAF pages without passing encrypted parameters to it? Also where can we get more details about
    encrypting OAF URL parameters.
    Any pointers would be appreciated.
    Thanks in advance!
    Saurabh

    Have you duplicated entire Customer Service module's menu in your responsibility?
    or Also ping me the menu name..
    --Prasanna                                                                                                                                                                                                                                                               

Maybe you are looking for

  • Windows 8.1 error when printing photsmart B110 all in one series

    When going to print a document of more than one page the system goes into print mode but after a short delay the windows error screen appears saying there was an error to the printer. Howvever the printer some times prints the whole document or only

  • FIREFOX 3.6 PROBLEM WITH STAY ON TOP BUT 3.5 WORKS FINE

    WHEN I USE FIREFOX 3.6 OR ANY VERSION OF THE 3.6 AND I SELECT STAY ON TOP (I HAVE A THIRD PARTY PROGRAM THAT ALLOWS THIS) AFTER I MINIMIZE THE WINDOW THEN IT WILL LOOSE THE STAY ON TOP COMMAND. ALTHOUGH WITH FIREFOX 3.5 VERSIONS IT KEEPS IT'S STAY ON

  • Very Urgent::Compression of Cube affecting other Job in Batch

    Hi All, I have started compression of cube for 5 requests.But all the other jobs like delete overlapping requests, ODS activation, drop index, create index, roll up that started after compression job, are taking unusually more time in daily process c

  • Unable to insert a table in DW MX 6.1.1842.0

    I have read a number of posts on this subject but none of the advice I have followed has rectified the problem. I hope someone here will be able to help. I am able to insert 'Table Objects' from the 'Insert Menu' in code view but am unable to insert

  • Website not asking permission for using location services in Safari iOS 6

    Website is not asking permission for using location services when using Safari mobile  on iOS 6.0 (iPhone 4s) Steps to replicate: 1. Go to http://maps.google.com using Safari 2. Choose "allow" to use location services 3. Close Safari and wait 1-2 min