facebook

code behind for JSF /Facelets?

  1. MyEclipse Archived
  2.  > 
  3. Web Development (HTML, CSS, etc.)
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #276678 Reply

    iangregson
    Member

    Hi there,

    i wonder if anyone can help?

    I have managed with a little help from people here to get my myeclipse working with jsf …. everything renders ok… Coming from a VS.net background we have what is called a code behind file for asp.net … i believe the same (or similar) is true for JSF. I looked over the tutorials again but can’t seem to find what i should do

    Basically i have JSF and Facelets capabilities added to my project and i have a test MyXhtml.xhtml … how do i add code to this file… i don’t want to mix my code as in <% %>… but would like to insert into a code behind file…

    i did a search here for code behind but didn’t find anything but there again code behind is probably not the correct terminology for java..

    I am guessing here… but i presume i can add a manged bean or something… but where would i associate a managed bean with a xhtml (.faces) page??? i presume i would need to add it to the faces-config.xml or something.-…

    Any help or ideas reallyl appreciated

    #276680 Reply

    ernestz
    Member

    Yes, you associate managed beans and navigation from faces pages within the faces-config.xml.

    Check out the JSF/Facelets tutorials provided with MyFaces help … Using MyEclipse 6.0 use menu items Help -> Help Content , from Contents menu, select MyEclipse Learning Center, click Server Side Tools, then scroll through the JSF section.

    #276722 Reply

    iangregson
    Member

    Thanks … ok think i have that now.. i notice that from the tutorial i can use xhtml or jspx … they seem to be a little different… what is the difference??

    Also i can’t seem to add a managed bean… i use NEW and i can add seesion bean, entity bean and meessage driven bean..

    another thing i am a little confused with is… the bean is activated when i click submit on .faces page??? do it not have a PAGE_LOAD event or something …..

    THanks

    #276723 Reply

    iangregson
    Member

    in the tutorial it states

    Facelet pages can either be written as XHTML or JSPX documents. In MyEclipse 5.5, to take advantage of all editing features you will need to create your facelets pages as XHTML.

    i am using myeclipse 6.0 … but they both open in a JSF ediiting page….

    #276805 Reply

    Riyad Kalla
    Member

    iangregson,
    Please be sure you read through the tutorial ernestz mentioned. When you add a managed bean, you do so by opening your faces-config.xml file, then from the outline view (clicking the Down Arrow in the top right) you can add the different kinds of assests this file contains. One ofthem is a managed bean.

    #276816 Reply

    iangregson
    Member

    damb! that was it.. i was looking at the left hand side of the screen rather than the right!!! whoops.. thanks for the confirmation…

    #276819 Reply

    Riyad Kalla
    Member

    No problem, I’m glad it’s working now.

Viewing 7 posts - 1 through 7 (of 7 total)
Reply To: code behind for JSF /Facelets?

You must be logged in to post in the forum log in