webtier@glassfish.java.net

JSF - Change views directory

From: <webtier_at_javadesktop.org>
Date: Thu, 03 Jun 2010 17:09:09 PDT

Hi everyone!

I am new to Java Server Faces. I would like to ask about something what is very anoing for me.

Let's take a look at my project dirs (I am developing app with NetBeans 6.8 JSF 2.0 Hibernate)

Source Packages
|
Libraries
|
WebPages
__WEB-INF
__|
__resources
__|
__template.xhtml
__index.html

Nothing more is needed.

I've go the managedbean

settingsController

in which I've go the method index. this method should return String with template (index) name. And if it returns "index" everything is ok, but... I would like to change location for views. After my operation my project tree should looks like:

Source Packages
|
Libraries
|
WebPages
__WEB-INF
__|
__resources
__|
__templates
____|
____settings
______|
______index.html
______template.xhtml
template.xhtml
index.html

I am trying to put the views in seperate directory for each controller. I have tried to return template with directory like this:

public String index(){
return "templates/settings/index";
}

but this returns me an error

Unable to find matching navigation case with from-view-id '/index.xhtml' for action '#{settingsController.index}' with outcome 'settings/index'

Can anyone explain me how to make this working? Just for example for two cases: settings/index and user/changePass

I'll be very grateful.

Best regards

jmail
[Message sent by forum member 'jmail22']

http://forums.java.net/jive/thread.jspa?messageID=472677