Possible to access bean property without Java Bean conventions?

Hello,
I'd like to show a component whenever there is an error message in the Faces context. Naively, I set the component's "rendered" attribute to the following:
rendered="#{facesContext.messages.hasNext}"
The object returned by facesContext.messages is an iterator, the properties of which do not follow Java Bean naming conventions. If there was a method called getHasNext() then all would be well. However as it stands, EL cannot evaluate this expression.
I realise that wrapping this up in a managed bean would solve the problem, but I'd like to avoid this if I am able to do this directly from EL.
Cheers,
Chris

Hi Juergen,
hasNext actually returns a boolean which EL understands fine. In the end I just wrapped the call within a managed bean, as you suggested, and this works a treat:
  public boolean getHasMessages() {
    // hasNext will return true if there are any messages to be displayed
    return FacesContext.getCurrentInstance().getMessages().hasNext();
  }I suppose I felt compelled to post this entry since I found myself having to write some code for an expression that could be written perfectly well in EL but was limited only by the fact that EL can only access properties that follow the Java Bean convention.
I thought that may have been some qualifier or method wrapper I could have used to mean 'take this property name literally'. Alas, it seems no such faclility exists.
Thanks for taking the time to reply,
Chris.

Similar Messages

  • Is it possible to access my bookmarks without being able to actually open firefox?

    Firefox stopped working suddenly yesterday, no error messages, no response whatsoever, it simply does not open. I don't mind reinstalling, however I would like to get to my bookmarks first. Is there any way to do this without being able to open firefox? Thanks,

    What you really need to be doing is backing up all of your user data.
    If you are backing up all of your Firefox profile to an external device your Firefox application would be protected. Bookmarks are an important asset, but so are your passwords, your options, your extensions, etc.
    You can export your bookmarks to an HTML file on a USB thumb drive and access it almost anywhere on any browser without installing it on a borrowed system. You have to export with Firefox up, and you may be able to use Firefox in Safe mode. You can fix a lot of problems from within Safe Mode, I would see if Firefox works in Safe mode.
    If the question is about where to grab your bookmarks so you can reinstall them if need be, your bookmarks are in places.sqlite along with history, but the bookmarks themselves are backed up each day you use Firefox in the bookmarkbackups directory as .json files which can be used to quickly replace all of your bookmarks in Firefox while Firefox is up.
    See
    * Browser will not start up - MozillaZine Knowledge Base<br>http://kb.mozillazine.org/Browser_will_not_start_up
    * Safe Mode - MozillaZine Knowledge Base<br>http://kb.mozillazine.org/Safe_Mode
    * Profile folder - MozillaZine Knowledge Base<br>http://kb.mozillazine.org/Profile
    * Profile folder - Firefox - MozillaZine Knowledge Base<br>http://kb.mozillazine.org/Profile_folder_-_Firefox
    * Bookmarks - MozillaZine Knowledge Base<br>http://kb.mozillazine.org/Bookmarks
    * Sorting and rearranging bookmarks - Firefox - MozillaZine Knowledge Base<br>http://kb.mozillazine.org/Sorting_and_rearranging_bookmarks_-_Firefox
    * Transferring data to a new profile - Firefox - MozillaZine Knowledge Base<br>http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox

  • Access Metadata Property from java iview

    Hi All
    i'm developing a search engine that will take into consideration some property metadata within the search.
    i have some dropdownlists in my search page and i want them to get the values from a property metadata in my KM.
    i will appreciate your help here.
    thanks in advance
    Mr. B

    Hi Jessica,
    Here's an example of getting the modified property of a document:
    IPortalComponentRequest request = (IPortalComponentRequest)this.getRequest();
    IUser aUser = (IUser) request.getUser().getUser();
    ResourceContext rContext = new ResourceContext(aUser);
    RID aRid = new RID("/documemts/Public documents/example.txt");
    IResourceFactory aResourceFactory = ResourceFactory.getInstance();
    IResource r = aResourceFactory.getResource(aRid,rContext); 
    IPropertyName modifiedName = new PropertyName("http://sapportals.com/xmlns/cm","modified");
    IProperty modifiedProperty = r.getProperty(modifiedName);
    Date modified = modifiedProperty.getDateValue();
    For more information you can check the javadoc documentation of the classes in this example.
    Hope that helps,
    Yoav.

  • Is it possible to access system api using java

    can i catch the processor( Intel Processor) id (unique no. for each processor provided by Intel)

    Not in pure java. Try using native libraries.

  • Portal runtime error: Cannot access bean property

    Dear all,
    Does anybody have a clue what problem might couse the <b>Portal Runtime Error</b> described below?
    It does seem to occur when a second user wants to access the <b>Component</b>.
    <b>Portal Runtime Error</b>
    An exception occurred while processing a request for :
    iView : pcd:portal_content/com.xxxxx.luminaires/com.xxxx.iviews/Quotations/EasyQuote
    <b>Component</b> Name : EasyQuoteDemo.EasyQuoteComponent
    Tag tableView attribute model: Cannot access bean property quotationHeader.CurrentTableModel in page context.
    Exception id: 04:50_21/09/04_0070
    See the details for the exception ID in the log file
    Thxs in advance
    Joost

    Hi Dominik,
    Having a closer look at the problem, we found it is not the number of users.
    It seems our JAVA components keeps the conenctions with SAP open and reopens a new one every time we start the component.
    If we finished solving the problem, I will publish the solution.
    Greetings,
    Joost

  • Access bean(wrapper) for EJB

    How can I develop access bean(wrapper) for EJB in JDeveloper?

    Search the Internet for a product called JACOB
    JAva COm Bridge

  • Accessing Beans

    hi!
    is there any possibility to access a bean which is bound to an component or the component itself, from an custom validator of another component?
    thanks for help!

    Yes, you can use components ID to find the needed component:
    UIInput ui = (UIInput)component.getParent().findComponent("componentID");

  • Help:accessing beans method

    hello
    i have made one application in which i have made two beans under different packages. i am trying to access beans through jsp pages. i am able to access beans and their methods but when i add new method in bean and tried to access that method with different new jsp page say page1.jsp. I am not able to access new method though i am able to access old methods of same beans with this new jsp page. then i made new bean and copied that method in this new bean . then i tried to access that method of this new bean with page1.jsp and i am able to access it can any body guide me what is the reason for this. i want to run this method in old beran rather than new bean
    my directory structure is:
    projectlms---main folder
    addstream---old jsp page
    page1---new jsp page
    web-inf/classes
    com-------main packageof beans
    ProgramManager----sub package of classes
    bean1--------old bean
    new bean------new bean just for testing
    now the problem is that i want to add one more method to bean1 and want to access it through pag1.jsp
    but i am not able to access it and same method when i take to new bean i am able to access that method through page1.jsp
    but i am able to access old methods of bean1 through page1.jsp
    thanks
    regards
    vivek

    Could be a caching issue.
    Wipe out the COMPILED jsps and try again.

  • Web Intelligence Rich Client without java - is it possible?

    Hello!
    Web Intelligence Rich Client without java - is it possible?
    How about other client as Web Intelligence Rich Client, but without java?
    Is it possible?
    Regards,
    Denis

    It's very interesting, becouse i have installed pathes: ENTERPRISECLNT03P_4-10007619.EXE, CRYSTALREPORTS03P_4-10007442.EXE, BOBJINTGRSAP03P_4-10007514.EXE and problem was solved. Moreover I have uninstalled JRE. New problem not have come.
    Regards,
    Denis

  • If I purchase something on AppleTV is it possible to access it through my iPad without syncing?

    Hello I recently purchased an iPad 3 with retina display and I'm using Apple TV and I've just bought a movie on there was wondering if it's possible to access the movie through Apple TV without syncing my iPad to my MacBook Pro? I guess I'm wondering if iCloud has a hub where it shows everything that you've purchased like Apple TV but is accessible on iPad iPhone etc to stream everything with ought having to sync it to the device itself. Sorry If this is a rather basic question I am a new user to all of this thank you for your help I appreciate it!!

    If you purchase iTunes content from any device, you should be able to download it to another device from the Purchased section of the itunes app/store. There are some restriction on Movies/TV content based on locale, but in the US it shouldn't be a problem.
    On teh iPad, open the iTunes app. Tap Purchased (bottomof screen), then Movies (or TV Shows, etc.) on teh top menu. You can view all of your purchases, or just those not on the iPad, as well as sort by Most Recent or Name.
    ~~~~~~~~~~~~~~~~~~
    Message was edited by: James Ward4

  • Is it possible to have an iphone without access to the internet?

    I would like an iphone but I don't want to have access/pay for the internet all the time. I don't know if it's even possible to but an iphone without it though.

    A carrier is not the only place to buy an iPhone. You can buy unlocked, without a SIM, direct from Apple, activate it with a borrowed SIM, then just use it on WIFi.
    Might as well just buy an iPod touch though...

  • Server Shows : Error in Accessing Beans

    here it shows the error as "Error in Accessing Beans".Anybody knows solutions pls give solutions for this.

    Hi Visakh,
                    Yes,The user is holding the permission as "Global User" in sql.Hope you help me in solve this issue
    Thanks, Quality Communication Provides Quality Work. http://siddiq-sharepoint2010.blogspot.in/ Siddiqali Mohammad .
    Hi siddiqali,
    According to the screenshot you posted above, the use account didn't have sufficient permission to open the report, please check the following prerequisites before you perform the action:
    You must use a report definition (.rdl) file as a data source. Importing from a report model is not supported.
    You must have permission to open the report under your Windows user account, and you must know the address of the report or the report server that hosts it. You can check your permissions by trying to open the report in a Web browser first.
    If the report opens, it confirms that you have sufficient permissions and the correct URL.
    Reporting Services must be version SQL Server 2008 R2 or SQL Server 2012. Those versions include the data feed export feature that streams report data in the XML data feed format. You can identify the report server by the Export as Data Feed option
    that appears in the report toolbar when you open the report in browser:
    For detail information, please see:
    Import Data from a Reporting Services Report:
    http://technet.microsoft.com/en-us/library/gg413491.aspx
    Regards,
    Elvis Long
    TechNet Community Support

  • How to access variables declared in java class file from jsp

    i have a java package which reads values from property file. i have imported the package.classname in jsp file and also i have created an object for the class file like
    classname object=new classname();
    now iam able to access only the methods defined in the class but not the variables. i have defined connection properties in class file.
    in jsp i need to use
    statement=con.createstatement(); but it shows variable not declared.
    con is declared in java class file.
    how to access the variables?
    thanks

    here is the code
    * testbean.java
    * Created on October 31, 2006, 12:14 PM
    package property;
    import java.beans.*;
    import java.io.Serializable;
    public class testbean extends Object implements Serializable {
    public String sampleProperty="test2";
        public String getSampleProperty() {
            return sampleProperty;
    }jsp file
    <%@ page contentType="text/html;charset=windows-1252"%>
    <%@ page import="java.sql.*,java.util.*"%>
    <html>
    <head>
    <title>Schedule Details</title>
    </head>
    <jsp:useBean id="ConProp" class="property.testbean"/>
    <body>
    Messge is : <jsp:getProperty name="msg" property="sampleProperty"/>
    <%
      out.println(ConProp.sampleProperty);
    %>
    </body>
    </html>out.println(ConProp.sampleProperty) prints null value.
    is this the right procedure to access bean variables
    thanks

  • Access System Resources using Java Applet via Java Script

    Hello
    I can access my Applet public methods (and this methods access system resources) via Java Script if I do the following: System.setSecurityManager(null);However, I'm making this post because I don't like this solution.
    Supposedly, setting the SM to null is like making the Applet (which is signed and was accepted by the user via a prompt from the browser) behave like a normal Java program that has no restrictions. (http://java.sun.com/docs/books/tutorial/essential/environment/security.html, second paragraph)
    However, this feels like a workaround of something that is supposed to be there (the SM).
    Also, if I make the methods invocation from inside the applet (using swing buttons and textboxes for example) I can use the standard SM without no problems.
    From my readings, the problem regarding Java Script invocation, comes from the fact that the Java Script is not a secure (not signed) source (because you can invoke public methods the way you wish from it i guess) on the contrary to the applet methods invoked by the buttons.
    Possible solutions I found in the web range from using the public static Object doPrivileged(PrivilegedAction action) method or imaginative things like creating new threads on the public method that call the private methods that access the system resources (supposedly because the new thread runs under the safe environment of the applet)
    I almost got a glimpse of hope with this post http://forums.sun.com/thread.jspa?threadID=5325271&tstart=0
    However, none of these solutions worked, the only results were with the setResourceManager(null)So, any one can contribute with a solution for this? Should I keep trying to find a solution other then the one I already have?
    Regards
    Cad

    1. yes
    2. yes
    Note for 2. the converter will run the applet with SUN jre for sure if the user has IE.
    IE will use the ActiveX technology to run the applet (as with Macromedia Flash).
    For Netscape I am not sure, but I would think Netsape will use the plug in provided by
    SUN.
    Note for SUN jre 1.3. If this applet is to be used within a company that uses a proxy with
    ntlm authentication the 1.3 applet cannot connect (to the Internet) through this proxy since
    ntlm athentication is supported since j2re1.4.2_03. There is one version before that but
    that one will pop up a window asking for the user's domain account and password wich
    is both lame and crappy.
    As for the IE settings, IE has a default setting that askes users the "do you trust"
    queston for AciveX controls within the Internet securety zone (tools -> internet options
    -> security).
    Sincy anybody can make ActiveX controls (allso sign them) a user that has a problem
    to find the "no" button will sooner or later install a malicuous ActiveX control (spy ware
    or a virus).
    If this user's desktop is within your company's network it will cause serious harm.
    This is why most company's disable this by changing the default internet expolorer
    settings. Since I assume you are writhing this applet to be used by a company I allso
    assumed that company has someone to maintain the desktops. In that case I
    assume that person would want to control the security within the SUN jre instead of
    letting the user deside what to trust and what not.

  • Is it possible to access Data Domain to retrieve records?

    Hello,
    I'm using OEID 3.1.
    Today i was asked if i know if its possible to access the records stored in the Data Domain to retrieve them.
    Actually the question was if there is a way to access the "Database" of the Data Domain to retrieve the data from there.
    Is this possible ? Is there a way to retrieve the data from the Data Domain stored?
    I can only think it would be possible to retrieve the data but without the information about the columns, only a simple retrieve of information by placing a results table and do an export but maybe there is a way to do a retrieve of the data like a sql export, including information about the metadata, etc..
    Regards and thanks for the help.

    Frederico,
    Are you trying to do it in Clover/Endeca Integrator, a portlet in Studio or your own application?
    The Endeca Server uses Web Services to serve requests for data, it's not as simple as say a REST service or writing a SQL Query (though you could make it that easy by writing a quick front-end).
    I think this question is not being answered because it's unclear what the "end goal" of what you're trying to do is and why you are trying to do it.
    If you're just looking to "play around", download SOAP UI and play around with that.  It's a great tool, regardless of what you are trying to do as it will automatically interrogate a WSDL file (the definition of a Web Service) and generate sample requests for you.
    If you're looking to export records in Clover....you are (almost certainly) using web services already in your data loading graphs.  Check out how something like InitDataDomain uses the Manage web service as an example (or LoadAttributes uses sconfig) and then drop your own web service component on a graph, switch it over to use the Conversation service and try some things.
    If you have a custom portlet or front-end looking to use Endeca Server data, Web Services support lots of (nearly all?) coding languages, platforms, etc.  It's probably outside the scope of this forum to talk about consuming Web Services in your application, since that's something that thousands of applications do and is more of a Java/C#/your language of choice question.  For example:
    How to create and consume a simple Web Service using JAX WS » the Open Tutorials
    http://wiki.servicenow.com/index.php?title=Web_Services_C_Sharp_.NET_End_to_End_Tutorial
    Hope that helps.
    Patrick Rafferty
    http://branchbird.com

Maybe you are looking for