How to get accessed to pagecontext in a tag file in JSP2.0

I am writing a custom tag using JSP 2.0 to clean up the JSP pages for a big website.
Now a question comes up. I need to access pageContext variable in my tag file since I need to get the bean using a lookup method. I know in JSP2.0 there is jspContext implicit object instead of pageContext. But this is not the end of the story.
then I read Denis' post. and his solution are these two line codes:
<%
PageContext pageCtx = (PageContext)jspContext;
tagBean.init(pageCtx);
%>
I am confused here what the tagBean here. Is that a webBean? and how can I get this object in my tag so that I could initialize the pagecontext and reference it?
thanks in advance

The lookup method just returned me a null. So I believe that there is
some trick behind this simple cast.First I would double check your basic assumptions.
Is the attribute you are looking up actually there? That would be a simpler explanation for why the lookup method returned null.
Try a jspContext.findAttribute() , specific request/session.getAttribute() to see if you actually retrieve anything.
Also be aware that the RequestUtils.lookup() method has been deprecated in Struts 1.2, in favour of org.apache.struts.taglib.TagUtils.lookup().
Cheers,
evnafets

Similar Messages

  • How to get access to PageContext in a java class (.java file)?

    Hi all,
    I am trying to get access to PageContext from inside a java class, and it doesn't seem to work.
    I could get the PageContext from a jsp page, at the object instantiation, through the constructor, but my class is not called by a jsp page.
    Any ideas?
    Thanks,
    Paul

    Basically I do not need to change any attributes from pageContext. However I need the pageContext object because I am using a third party component that is initialized with the pageContext .
    I cannot change the implementation of that component: it is a black box to me, I simply need the pageContext in my java class that uses the component.
    Any thoughts based on this clarification?
    Thanks,
    Paul

  • How to get access to my iCloud back up when setting up a new iPhone 5s which needs the newest version of iOS7 first?

    how to get access to my iCloud back up when setting up a new iPhone 5s which needs the newest version of iOS7 first?

    Set up the new phone as a new iPhone (without using your backup), then update it to the latest iOS (7.1.2).  Then go to Settings>General>Reset, tap Erase All Content and Settings, go through the setup screens again and when given the option, choose Restore from iCloud Backup and follow the prompts.  This process is explained in more detail here: iCloud: Restore your iOS device from iCloud.

  • I loos my APPLE ID, I have a new one, how can get access to data stored in the old one?

    I loos my APPLE ID, Now I have a new one, how can get access to data stored in the old one?

    Do you have the email & password of the old Apple ID?

  • Photostream Issue - I have had several phones over the years all backing up via iCloud/Photostream. It seems that the oldest of my photos and videos are simply gone and I cannot seem to figure out how to get access to them. Why is this happening?

    Photostream Issue - I have had several phones over the years all backing up via iCloud/Photostream. It seems that the oldest of my photos and videos are simply gone and I cannot seem to figure out how to get access to them. Why is this happening? Is there anything I can do to get them back? I'm freaked out by the thought that I am paying for what I thought was a safe place for my photos to be stored and accessed later but now see that there are nearly 500 pictures/videos gone from my photostream folder. Any help would be greatly appreciated. Thank you. - Michael

    Hi newmarket,
    Photo Stream is not a respository for archiving photos. It is a cloud storage device that will store the last month or last 1000 photos taken by any device on the same Apple ID, and then will "share" those photos with all other devices that have Photo Stream turned on,and that are logged onto the same Apple ID.
    iCloud backups will contain all of the photos that were on your camera roll the last time you backed up your device.
    If you have photos outside of the Photo Stream parameters, and they are not all on your current camera roll, then you have no way to retrieve them unless you have imported them to the computer you sync with or have uploaded them to some other cloud service like DropBox.
    Sorry,
    GB

  • Qosmio G30-126 - How to get access to the bios!

    I have a laptop Qosmio G30-126 and I don't know the key for entering the bios to change to properties for the HDD or any thing... so how to get access to the bios? what is the key for the bios??

    Hi
    Try to press the F2 button while powering the unit.
    Older Toshiba notebooks supported the ESC and then F1 button
    So these two options are possible

  • How to get access to the OCM toolkit  ?

    how to get access to the OCM toolkit  ?
    the full version not the demo !

    I need to know how to do a complex query my task is to find out the names of people allergic to paracetomol and penicilllin from a list of names??? I REALLY NEED HELP ITS DUE IN TODAY!
    TASK: show the Pupils: forename, Pupil surname, Year group, teacher in charge to all children allergic to penicillin and paracetmol from the table of names (not everyones allergic) How do I query it!?????????
    <a href="http://www.ornsoft.com/">Custom software development</a>
    <a href="http://www.aconsultancy.co.uk">Acquisition Search Warwickshire</a>

  • How to get access to the HTTP-Manager Tomcat ?

    How to get access to the HTT-Manager Tomcat ?
    Whe i do:
    http://localhost:8080 - i have access to the Kablink.
    How i can get access to the Tomcat Manager ??
    Serg

    Originally Posted by skoltogyan
    How to get access to the HTT-Manager Tomcat ?
    Whe i do:
    http://localhost:8080 - i have access to the Kablink.
    How i can get access to the Tomcat Manager ??
    Serg
    Hey Serg,
    I don't think that's possible with the tomcat config that is supplied with Vibe.
    You might get a better answer in the community space for Vibe/Kablink at vibe.novell.com, direct link being atm: https://vibe.novell.com/ssf/a/do?p_n...beonprem_url=1
    Cheers,
    Willem

  • How to get access to my contact list?

    I have successfully (?) installed Skype on my Galaxy tablet and logged in using my account name from my laptop version. But I cannot find my contact list. How to get access to that! Even my photo is present!

    Hello Everyone, I'm trying to access my Skype contact list on my Galaxy S3 so that I can edit it, but I do not seem to be able to.  I've gone to the help page to try and find out where it is, but the steps say to tap the three dots in the upper right corner for "More"...but I do not have that emblem?!?!  Has this issue been resolved, or are people still unable to access their contacts?

  • Suddenly user account login requested, but was newer created (OS X 10.5.6), how to get access again

    suddenly user account login requested, but was newer created (OS X 10.5.6), how to get access again?

    No account ever created, or what?
    If not 1.6 Server, then...
    Reset OS X Password Without an OS X CD...
    http://theappleblog.com/2008/06/22/reset-os-x-password-without-an-os-x-cd/
    Admin Hack...
    http://www.hackmac.org/?q=node/4
    Starts up like the first time you buy a new Mac, but after filling in all that info again, you should have access to the computer and the other Users & files will still be there... give the new User a different name than an existing one.
    http://www.macyourself.com/2009/08/03/how-to-reset-your-mac-os-x-password-withou t-an-installer-disc/

  • How to get the attribute value of an XML file??

    How to get the attribute value of an XML file??
    For example, how to get name and age attributes?
    <student name="Joe" age="20" />

    What are you using to read the XML file??
    On the assumption of JDOM - www.jdom.org. Something along the lines of:SAXBuilder builder = new SAXBuilder(true);
    Document doc = builder.build(filename);
    Element root = doc.getRootElement();
    List children = root.getChildren();
    Element thisElement = (Element)children.get(n);
    String name = thisElement.getAttributeValue("name")
    try
         int age = Integer.parseInt(thisElement.getAttributeValue("age"));
    catch (Exception ex)
         throw new InvalidElementException("Expected an int.....");
    }Ben

  • How to get HTTP session in Applcation Module IMPL file

    Hi Guys,
    Can any one tell me how to get HTTP session in Applcation Module IMPL file ?
    thnks

    You can, but that's not a best practice.
    Re: How to reach HttpContext from model Project

  • Programming help - how to get the read-only state of PDF file is windows explorer preview is ON?

    Programming help - how to get the read-only state of PDF file is windows explorer preview is ON?
    I'm developing an application where a file is need to be saved as pdf. But, if there is already a pdf file with same name in the specified directory, I wish to overwrite it. And in the overwrite case, read-only files should not be overwritten. If the duplicate(old) file is opened in windows (Win7) explorer preview, it is write protected. So, it should not be overwritten. I tried to get the '
    FILE_ATTRIBUTE_READONLY' using MS API 'GetFileAttributes', but it didn't succeed. How Adobe marks the file as read-only for preview? Do I need to check some other attribute of the file?
    Thanks!

    Divya - I have done it in the past following these documents. Please read it and try it it will work.
    Please read it in the following order since both are a continuation documents for the same purpose (it also contains how to change colors of row dynamically but I didnt do that part I just did the read_only part as your requirement) 
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f0625002-596c-2b10-46af-91cb31b71393
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d0155eb5-b6ce-2b10-3195-d9704982d69b?quicklink=index&overridelayout=true
    thanks!
    Jason PV

  • How to get list of drives present in local file system?

    Hi all,
    I want to show all drives and their contents using JTree.
    Does anybody know how to get list of drives present in local file system?

    Thank you!
    I have new question.
    I want to disply size and file type. Can you give ur suggestion in order to do that?
    I want to provide following using JTree
    + root <Dir> 50KB
    - file1 <txt> 10KB
    - file2 <bmp> 20KB
    + root2 <Dir> 200KB
    -file1 <jpeg> 50KB
    Is this possible?
    Plz reply..........
    bye

  • How to get a text between two XML tags?

    Hello everybody!
    I've got a problem! How can I extract a text that is between tags, like <myTag> My text </myTag> I have no problem to get the attributes inside the tags, however, i don't know how to get some text that is between tags. Here is my xml:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <tangram_request service_id="3">
    <send keep_session="nada">
    <source></source>
    <destination>3196931566</destination>
    <channel_id>2</channel_id>
    <text>Teste ServerSocket!!!</text>
    </send>
    </tangram_request>
    Now, there's a fragment of my code, which gets some tags' attributes:
    DOMParser parser = new DOMParser();
    InputSource resp = new InputSource(new StringReader(XML));
    parser.parse(resp);
    Document doc = parser.getDocument();
    Node node =(doc.getElementsByTagName "tangram_request")).item(0);
    if (node instanceof Element)
    Element el = (Element) node;
    service_id = el.getAttribute("service_id");
    System.out.println("\n\nService_id="+service_id);
    }else{System.out.println("Erro");}
    node = (doc.getElementsByTagName("send")).item(0);
    if (node instanceof Element)
    Element el = (Element) node;
    keep_session = el.getAttribute("keep_session");
    System.out.println("keep_session="+keep_session);
    }else{System.out.println("Erro");}
    Now, I want to get the texte between <destination> ... </destination>
    How could I do that?
    Thanks a lot
    Calegari

    Thanks... It worked fine!!!
    Now how can I get lots of <desctination>... I did something that haven't worked...
    node = (doc.getElementsByTagName("destination")).item(0);
    while(node.hasChildNodes())
    destination = node.removeChild(node.getFirstChild()).getNodeValue();
    System.out.println("destination="+destination);
    And now, my XML is like:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <tangram_request service_id="3">
    <send keep_session="nada">
    <source></source>
    <destination>3196931566</destination>
    <destination>3196931567</destination>
    <channel_id>2</channel_id>
    <text>Teste ServerSocket!!!</text>
    </send>
    </tangram_request>
    Thanks so much!
    Calegari

Maybe you are looking for

  • Error occurred during initialization of VM

    im new to jdeveloper please anyone help me... Starting WLS with line: C:\Oracle\MIDDLE~1\JDK160~1\bin\java -client -Xms256m -Xmx512m -XX:CompileThreshold=8000 -XX:PermSize=128m -XX:MaxPermSize=512m -Dweblogic.Name=DefaultServer -Djava.security.policy

  • Loading XSL file in XSL Transforam action at run time

    Hello everyone , I want to use XSL Transforamtion action in weblogic integration and name of XSL file should pick at run time from a variable. I am using :"com.bea.wlxt.repository" package APIs for connecting to repository & get the XSL file from it.

  • Not able to print full pages via wireless

    Hello, I am looking for some assistance to troubleshoot an issue I am having printing from a computer using wireless to my wireless connected HP Officejet 4632. When I open a .pdf, for example, on a PC that is hardwired into my router, I can print th

  • Restarting issue after updating to v22

    I recently updated my N97 to the latest firmware v22. I have the problem now that when I switch the phone off and switch it on again, that the phone won't restart. I get the white screen with the blue nokia writing and around the time when the pin re

  • Any reason NOT to reinstall OS X?

    I just got my PB back from repair. I guess when they put in the new harddrive they just "registered" it as ( ...a's PowerBook... ) I went to change that to (.. Spencer's Powerbook...) but now it seems that some things recognize "Spencer's" and some r