- This topic has 6 replies, 3 voices, and was last updated 17 years, 1 month ago by Riyad Kalla.
-
AuthorPosts
-
iangregsonMemberHi 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
ernestzMemberYes, 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.
iangregsonMemberThanks … 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
iangregsonMemberin 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….
Riyad KallaMemberiangregson,
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.
iangregsonMemberdamb! that was it.. i was looking at the left hand side of the screen rather than the right!!! whoops.. thanks for the confirmation…
Riyad KallaMemberNo problem, I’m glad it’s working now.
-
AuthorPosts