Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Celinio Fernandes
Ranch Hand
Posts: 549
Eclipse IDE Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • 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: 549
Eclipse IDE Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Never mind, i think i got it :

return "/blabla/foo"; seems to do the trick
 
Tim Holloway
Bartender
Posts: 18661
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!