Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

two important questions on jsf  RSS feed

 
Yucca Nel
Ranch Hand
Posts: 147
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I am new to JSF and have the following related questions.
1. Am I right in thinking that the same rules to JSP appply to JSF? IOW a JSP include into a JSF will translate the included code as if it were hardcoded into current page?
2. I would like to internationalize some gifs or pngs, ahould I be using ice faces or can this be done with any JSF implementation because my first attempt failed, but was unsure as to how I would map imagex_en and imagex_no (both located in resources/images package in a way that is successful? I think that jstl set bundle is limited to prop files or am I wrong?

warm regards, Yucca
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For question #1, no, JSF and JSP are not trivially interchangeable. JSPs server as their own controllers (and servlets), JSF requires the FacesServlet to act as a controller.

Or, to put it another way, JSPs are compiled to produce programs, whereas JSF views are used as data by the FacesServlet program.
 
Yucca Nel
Ranch Hand
Posts: 147
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi and thank you. Could you perhaps(or anyone else) share some light in why only some of my (i8n) messages are rendered? I think it may have to do with inline and block elements but am not sure, I suppose that my properties file is not relevant as not much can go wrong, but here it is:


welcome=Welcome to the jar bar
mainBannerHome=Takes you to the home page of the jar bar
bannerAltImage=Please refresh browser(F5) to load image or report with id # headerBanner(image)if broken
aboutSite=Please make yourself at home and explore the site.\n To get you started, here is an overview of the menus above as well as some temporary links below.
tutorialTitle=learn with Java,Linux and windows when you click here.
tutorialAltImage=Please refresh browser(F5) to load image or report with id # tutorialHomeBanner(image)if broken
mainHomeTitle=clicking here takes you to the jar bar home page
downloadTitle="links to downloads and useful stuff
downloadAltImage=Please refresh browser(F5) to load image or report with id # downloadHomeBanner(image)if broken
contactTitle=click here to contact the jar tender kk
contactAltImage=Please refresh browser(F5) to load image or report with id # contactHomeBanner(image)if broken
aboutSite1=This site belongs to the
jartenderLinkTitle=meet the jartender(Yucca Nel

and the code <f:view>


 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You would have been better off asking that question in a new message thread, with an appropriate title so that people who are more knowledgeable about JSF and I18N would notice it.

I don't see obvious JSF problems, but it's not really a good idea to mix JSF and HTML, and if you do, you're better off using the <div> (or span) element than the <p> element.

You seem to have an unterminated <p>, so it's possible that the JSF parse tree builder is getting confused.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!