The "application" object

the "application" object can be called within a JSP file.
What if I wanna call it within a JavaBean class? How do I instantiate it?

The application object is the servletcontext that is passed to the servlet/JSP by the server during initialization. If you want to use it in a JavaBean you'll have to pass it in.
<jsp:useBean id="myBean" scope="session" class="beans.MyBean" />
<% myBean.setApplication(application); %>
and in MyBean
import javax.servlet.*;
public class MyBean {
   ServletContext sc;
   public MyBean() { }
   public void setApplication(ServletContext inSC) { this.sc = inSC; }
}

Similar Messages

  • How to add a fade effect to the Application object ?

    Hy,
    i want to add a fade effect to the Application object, but my code does not work, can you take a look please:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"                              
                                usePreloader="false"
                                mouseDown="stage.nativewindow.startMove()"
                                layout="absolute"
                                width="304"
                                height="527"
                                alpha="0"
                                creationComplete="init()">
            <mx:Script>
                    <![CDATA[
                            private function init():void
                                    application.setStyle("showEffect",fade)        
                    ]]>
            </mx:Script>
            <mx:Fade id="fade" duration="1000" />
    </mx:Application>
    Thanks

    Hi,
    Here is an example of how to add effect to a button: http://livedocs.adobe.com/flex/3/html/help.html?content=behaviors_06.html

  • How to create Illustrator COM application Object  in Invisible manner?

    Hi,
    I added CS6 COM reference in my VB.NET application and after that I have the following basic object creation in order to convert a eps file to svg. But for some reason when I create this COM object it is launching the Adobe Illustrator application. Why it is doing like this? It’s a simple COM object why it is interacting with Illustrator Editor?  Could you guide me how to take care this issue please?
    Thanks
    SG

    I am going to post a reply here from our other posts... http://forums.adobe.com/message/4692998#4692998
    your last post from other message:
    Let’s forget about VB part, even in Java script how do we create the Illustrator instance without bring Illustrator IDE up when you create the application object. It’s a COM component right, why would it bring up the UI? Do you have any simple example in Javascript please?
    To the best of my knowledge in order to access the Illustrator object model that the application must be running through JavaScript since scripts are run via the UI.
    I did find this in the documentation in refference to VB.
    CreateObject launches Illustrator as an invisible application if it is not already running. If Illustrator is
    launched as an invisible application you must manually activate the application to make it visible:
    Set appRef = CreateObject("Illustrator.Application")
    So instead of "As New" try "CreateObject"...
    Just a guess really

  • Access jsp's application object from an .java file?

    Hi,
    I hava a .jsp page and an import statement to a .java file. How can I access the application object in this .java file?
    I want to make an initialization function that I want to be called in every .jsp of the WEB application and to store this function in a .java file.

    The only way to get a hold of the application object would be to pass it to java code as a parameter to a method.
    ie public class Util{
    public void initialiseJSPPage(ServletContext application){
      // do stuff in ServletContext
    }and then in the JSP call it via
    <% Util.initialiseJSPPage(application); %>
    You could manually include this code on every JSP.
    A better alternative is that in web.xml you can configure an automatic include (See JSP.3.3.5)
    What is it you are trying to accomplish by doing this?
    Would a Filter be a more appropriate tool in this case? That would let you run java code before selected requests are handled.
    Cheers,
    evnafets

  • Random application object lost in Portal

    Hi people,
    I'm having a problem with the application object.
    Some times, in a random way, i'm losing the state of the application object between request's.
    This appens when I'm using the BSP application in the SAP Portal.
    Thanks,
    Paulo Ruivo

    Hi,
    the problem is that in the url I pass a parameter that in the bsp page copy to an attribute of the application.
    Then in the controler i try to read this value and it is empty, all the information in application object is lost.
    This appens during one single request.
    I have several Iviews pointing to the same BSP application, the diference between the content that is shown is controled by the parameter passed in the URL.
    Is it possible that while navigating between iviews, the info in the BSP application is mix up. Something like the aplication start (iview open) and then been close (previous iview close)?
    Thanks for the help.
    Paulo Ruivo

  • Application Object In Servlets

    First off, I'm new to writing servlets so forgive my ignorance...
    How do I get the application object within the init method of an HttpServlet? I want to call some methods on it (e.g. getRealPath) but I get compile errors because I'm not sure how to get the application object.

    public void init(ServletConfig config) {
      ServletContext sc = config.getServletContext();
      String path = sc.getRealPath("/"); // or something like that
    }

  • Application Object - ApplicationData

    Hello All:
    I am trying to set retreive an Application-wide variable from the Application object from within a P.E.I. using the ApplicationData object.
    I see the GetApplication() that returns a com.plumtree.uiinfrastructure.web.IApplication object but the methods there dont seem to be what I am looking for.
    Anyone run into something similar?
    Thanks.

    The GetCachingManager method on IApplication gives you a CachingManager class on which you can set and get data.

  • How do I: Loop through Application objects

    How would I loop through the application object?  My goal is to see if the object is a label and change its font size.
    pseudocode would look like this:
    function setsize(change int) {
      for each obj in application {
        if obj is of type label {
          set font size to font size + change
    Once I got that working, I'd add other objects that display text.  The "change" would be a number to increase (positive) or decrease (negative) the size.
    Thanks,
    Jerry

    I have this:
              <mx:HBox id="resultTextBox"
                  width="100%"
                  verticalScrollPolicy="off" horizontalScrollPolicy="auto">
                  <mx:Label id="resultPotentialResultsLabel"
                      text="Food Stamp potential eligibility for household, estimated monthly benefit amount "
                      styleName="textNormal"
                      toolTip="Results message"
                      tabIndex="200" tabEnabled="true"  fontSize="40"/>
                  <mx:Text id="resultPotentialResultsData"
                      styleName="resultNumberNormal"
                      toolTip="Final results"
                      tabIndex="202" tabEnabled="true" />
              </mx:HBox>
    When I expand the font size it pushes the "resultPotentialResutsData" to limbo.  I tried adding the horizonal scroll bar to allow the user to still see the results,  The scroll doesn't appear.
    1) is there a way to get the box to expand to fix the content?
    2) is there a way to get the scroll bar to appear when needed?
    3) is there a way to wrap the text (in this case the second field) in the HBox?

  • [CS3] Extending the Document Object Results an Error

    I'm trying to extend the Document object:
    Document.prototype.myOwnMethod = function() {
    /* some code here */
    but I'm getting a Document is undefined error in Illustrator CS3
    I tried extending the Application object:
    Application.prototype.myOwnMethod = function() {
    but I don't get any error.
    How can I resolve this?
    Thanks in advance....
    -- Jeff

    very old post, but not answered.
    PathItem.prototype.nick ="pfad"
    will work if a single Path is initialized before:
    var p =activeDoc.selection.. or something
    ,otherwise not
    to solve this i create my own obj.:
    function Pfad(obj){
         this.nick = "bla";
         this.ai = obj; // to store the original Obj
    var p = new Pfad(pathItem);
    //then :
    p.nick;
    p.ai.fillColor;
    my question is: is this the best solution or could it be done better?
    thank you
    Chris

  • BDT-DC is not prepared for this application object

    Hi,
    I am getting this the error message:
    BDT-DC is not prepared for this application object
    when I try to create an extension.
    I cam across the following thread:
    EEWB
    In this thread it is given:
    Hi,
    The xdcflag in the table TBZ1 needs to be set.
    Please follow the steps mentioned below.
    1. Start the transaction SM30.
    2. Enter the name of the Table/View as V_TBZ1_DC.
    3. Press the 'Maintain' button.
    4. Double click on the Application Object you are trying to extend(for
    e.g., BUPA)
    5. Mark the checkbox 'Active in DC' under the section 'BDT DC Settings'.
    6. Save the data.
    You can refer to note 955236.
    When i follow the above steps it says that:
    Do not make any changes (SAP entry).
    Please Guide.
    Regards
    Shilpi

    Hi Smita,
    I am unable to start the wizard.When i choose Start Wizard I get this error message and the wizard is not started.
    Regards
    Shilpi

  • 'MAPI Session Handle' of the NGW 'Object Request Broker' could not be accessed (0x80004005) on attempt to get an address book

    Hi!
    When I try to access GW address book by calling
    DIGWAccount6::GetSystemAddressBook, or DIGWAccount6::AddressBooks, or even
    DIGWMessage::Send, I'm getting messagebox with title "Address Book Error"
    and message: "The 'MAPI Session Handle' of the Novell GroupWise 'Object
    Request Broker' could not be accesses. The address book cannot run (error:
    status: 0x80004005)."
    I'm using .NET and I only get this error when I create a console
    application. With windows application everything goes fine.
    I've tried reinstalling GW client, running fixmapi utility, installing
    different versions of MAPI CDO, but still got this problem.
    Any ideas?

    In the Application object.
    >>> On Monday, July 26, 2010 at 4:16 PM,
    shutchinson<[email protected]> wrote:
    > Where would we set this?
    >
    > Thanks!
    >
    > Scott
    >
    > Preston Stephenson;1755943 Wrote:
    >> Do you need to use the MAPI address book providers?
    >> Can you use MultiLogin and set MultiLoginAddressBookSupport = TRUE?
    >>
    >> Preston
    >>
    >> >>> On Tuesday, November 11, 2008 at 4:22 AM, Vladimir
    >> Iofik<[email protected]>
    >> wrote:
    >> > Hi!
    >> > When I try to access GW address book by calling
    >> > DIGWAccount6::GetSystemAddressBook, or DIGWAccount6::AddressBooks, or
    >> even
    >>
    >> > DIGWMessage::Send, I'm getting messagebox with title "Address Book
    >> Error"
    >>
    >> > and message: "The 'MAPI Session Handle' of the Novell GroupWise
    >> 'Object
    >> > Request Broker' could not be accesses. The address book cannot run
    >> (error:
    >>
    >> > status: 0x80004005)."
    >> > I'm using .NET and I only get this error when I create a console
    >> > application. With windows application everything goes fine.
    >> > I've tried reinstalling GW client, running fixmapi utility,
    >> installing
    >> > different versions of MAPI CDO, but still got this problem.
    >> >
    >> > Any ideas?

  • Select several application object to create as duplicate

    Hi,
    At the school I work at we are currently running Netware 6.5 SP7 and Zenworks 4.01 ir7.
    Our Board currently has two different Novell trees, one of the trees were for our slow link schools and the other tree was setup for our fast link schools.
    Now that all our schools are high speed we are in the early stages of getting rid of the slow link tree.
    I was asked to start the early phase and was asked to duplicate all the application objects of one of the schools currently in the high speed link tree and duplicate all the application objects to the recently created Organizational Unit objects of the new schools put into the tree.
    I know how to do this is Console One but it is very tedious and slow because I have to duplicate one application object at a time. Also, this will take long to do because i have to dupliacte about 75 Application Objects.
    Is there a way to select all the application objects I want to duplicate at once or do i have to do one at a time? Also, i there a tool I can use to accomplish this?
    If I can select all the application objects to duplicate at once this will save a lot of time!
    Thanks!

    Pilonbrad,
    > IS THERE A WAY TO SELECT ALL THE APPLICATION OBJECTS I WANT TO
    > DUPLICATE AT ONCE OR DO I HAVE TO DO ONE AT A TIME? ALSO, I THERE A
    > TOOL I CAN USE TO ACCOMPLISH THIS?
    Your shift key seems stuck :) Have you checked the JRB utilities?
    - Anders Gustafsson (Sysop)
    The Aaland Islands (N60 E20)
    Discover the new Novell forums at http://forums.novell.com
    Novell does not monitor these forums officially.
    Enhancement requests for all Novell products may be made at
    http://support.novell.com/enhancement

  • Extracting URL From Application Object

    If I type http://mymachine.com/myapp?a=aaa&b=bbb in my browser (to access application "myapp") how do I extract just the http://mymachine.com/myapp part from the application object? I would have figured that the code below would allow me to construct that string but these methods instead return the stuff in comments...
    URL theURL = application.getResource("/");
    theURL.getProtocol(); // jndi
    theURL.getHost(); // null
    theURL.getPort(); // -1
    theURL.getFile(); // org.apache.naming.resources.FileDirContext@!8bf135
    URL theURL = application.getResource("/myapp");
    theURL.getProtocol(); // null pointer exception
    theURL.getHost(); // null pointer exception
    theURL.getPort(); // null pointer exception
    theURL.getFile(); // null pointer exception

    tech note... HttpUtils is depricated for newer Servlet APIs (2.3+). Instead, you would use the same methods in the HttpServletRequest:
    URL theURL = new URL(request.getRequestURL().toString());

  • Globals.jsa application object problem

    Hi...
    I have tried the following code:
    <event:application_OnStart>
    String str = "test";
    application.setAttribute("str",str);
    </event:application_OnStart>
    in the globals.jsa and I get a method not found for the setAttribute method, can anyone help ? My environment is iAS (win)

    try to launch cmd.exe /C
    it has help me to quit fine cmd...
    Tell me,
    Buddy20x
    www.buddy20x.com
    > Hi-
    >
    > I have an application object that points to a batch file. The batch
    file
    > basically just does a map del, map, sets a few variables and then calls
    a
    > Cobol executable. This works fine under NT4.
    >
    > However, on XP, the first time I click on the application object, the
    dos
    > box opens and hangs after the map command, but does map the drive (can
    be
    > seen through explorer). The second time I click on the object, it now
    > works and the cobol program loads. (because the drive is now already
    > mapped)
    >
    > If I put a pause in the batch file after the map command, everything
    works.
    > So, the problem seems to be some sort of timing issue with getting the
    > network drive mapped or having it visible to that ntvdm/cmd.exe session.
    >
    > Also, if I don't use the application object and just click directly on
    the
    > batch file, it works fine on XP ??
    >
    > What is it about the application object calling the batch file and
    loading
    > cmd.exe that could cause such a problem? We lock down our users so they
    > can't run files/programs directly so I have to give them an application
    > object to start this app?
    >
    > Any ideas?

  • Recordset - updating 2 tables with 1 recordset using application object update record

    I have a recordset that uses a field from 2 different tables
    with a select statement where clause that joins a userid. I can
    display the field’s data just fine. Now I want to use the
    Application object “update record” so I can modify
    either of the fields. The problem is the Application object
    “update record” only allows you to update one table.
    How does Dreamweaver mx 2004 allow me to update 2 tables with one
    recordset and 1 submit button? Currently using php.
    Example of where:
    Where member.userid = member_detail.userid
    I tried creating the one form with the field from the first
    table and that works just fine. I added the other field from the
    other table into the form but ofcourse there isn’t any code
    that will update the second table so it won’t work.
    My application requires me to update alot of fields between 2
    tables at the same time.
    Does anyone know a way using Dreamweaver mx 2004 to do this?
    I don’t have much php experience.

    jon-rookie wrote:
    > DreamerJim,
    >
    > I am sorry but I don't think you are correct. I just
    can't believe that with
    > all the powers to be at Macromedia and now Adobe can't
    figure out how to update
    > two tables at once. There are millions of db's out there
    that require this. I
    > spent several hours today perusing lots of posts on the
    internet. It seems I
    > am not the only one out there that has asked this
    question. Unfortunately
    > there are no good answers yet to my surprise.
    >
    > I did find a Dreamweaver extension that does exactly
    what I myself and many
    > others want. The problem is it is no longer available
    unless you purchase a
    > bundle of software from Adobe.
    >
    > I have not looked into it in detail so I am not 100%
    sure that is accurate!
    >
    > Still, alot of php programmers do this all the time
    without much trouble. I
    > just want to know if Dreamweaver mx 2004 has the
    capability if a person knows
    > the right steps.
    >
    > Hopefully a Dreamweaver expert will post something to
    let us know for sure.
    > Until then I am stuck.
    >
    Not even CS3 has this built in, you will either have to code
    it yourself
    or buy the extension you have found. Dreamweaver gives you
    basic
    features to help you develop applications, but if you want to
    do
    anything really clever you have to do it yourself.
    One thing to consider is maybe creating an SQL view that is
    can be
    updated. I am pretty sure it exists, then you use the view
    instead of
    the table in the update behaviour. I have never done it
    myself, but I am
    sure it can be done.
    Steve

Maybe you are looking for

  • How do I add roboform app to my safari toolbar

    how do I add roboform app to my safari toolbar I added roboform to fill forms on the web The app needs to be added to the toolbar to safari but I cannot find a way to add it. I use this app on my yahoo desktop and it has a toolbar but safari will not

  • ABUMN- Assets transfer between assets class within company

    hi i am using the T. code ABUMN for Assets transfer between one class to other with thin the same cpmpany  for the assets purchased during currenting year not posting give error message AA417, for old assets it is working. pls help to solve this issu

  • How to make crosstab dynamic?

    I have this crosstab query by using DECODE function: select engid, max(decode(srv_period, '2012-1', Q1_Percentage, 0)) as "2012-1", max(decode(srv_period, '2012-2', Q1_Percentage, 0)) as "2012-2" from +(+ select a.srv_year || '-' || a.srv_month as sr

  • Vpn-framed-ip-address issue

    Hi Guys, I'm using a cisco 5510 ASA at the headoffice to provide the VPN (remote access vpn) connectivity to the branch offices. My local network is - 192.168.30.0 /24 and I've used a part of same segment for the vpn_pool as well ( i.e 192.168.30.152

  • Using eStorage flags as unknown access from the US

    Hi, Google flagged I had some unusual activity against my account, which appears to be hp.com.. It appears this is from using eStorage to scan and upload some documents yesterday (I live in the UK). I'm assuming eStorage attempts to access your accou