• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

[JSF 2.0] Basic question about view returned by a method

 
Ranch Hand
Posts: 563
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have a very basic question about JSF 2.0

My faces-config.xml file is empty.
In my Managed Bean, I need to return a String that points to the XHTML view.

The problem is that this view is located in a folder:
blabla/foo.xhtml

The current view is not located in the blabla folder.
How do i point it to the blabla folder in my method ?



thanks for helping.
 
Celinio Fernandes
Ranch Hand
Posts: 563
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Never mind, i think i got it :

return "/blabla/foo"; seems to do the trick
 
Saloon Keeper
Posts: 27764
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's correct, although I don't recommend it.

The idea behind faces-config is that you can use general-purpose components and wire them together in any way you like. When you you hard-code the wiring into Java source code, you're trading off that flexibility for a more "Git 'R Dun!" approach.

If you really just want to slam out code as fast as possible, Java probably isn't the platform you should be using. There's a whole raft of options (mostly using scripting languages like Ruby and Python) that forgo all the abstractions and error-checking in favor of raw results (sometimes very raw, alas!)

The great thing about this addition to JSF is that it's another tool available when you need it. The key is knowing when you really truly need it, and not using it blindly to produce an inferior product.
 
You get good luck from rubbing the belly of a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic