Tabbed menu options
Greetings, I'm looking at using tabbed menus. I really like the LF of Struts nice tabs and the DitchNet tabs. Struts Menu Nice Tabs: http://demo.raibledesigns.com/struts-menu/velocity-nicetabs.jsp?Home Ditchnet Tabs: http://209.61.157.8:8080/taglibs/ Is there any reason why I would NOT use either with JSF? Is there a JSF tab library in the works that has or could be modified to incorporate this type of chrome LF? I looked at the JSFTabs and didn't particularly like the screen shot. http://demo.raibledesigns.com/struts-menu/velocity-nicetabs.jsp?Home Maybe it can be easily modified. I downloaded the example war, but you have to modify Tomcat server.xml to install it and I'm too lazy at the moment. Maybe I'll have a look tomorrow. Any feedback is welcome. /robert
Re: [newbie] Forward to launch page (w/Tiles) [SOLVED]
Yea Robert, PLEASE put your findings in the wiki. An entry on how to get started using Tiles with JSF would be extremely helpful. Okay. I'll give it a shot. I'm going to be tapping you for tiles help now:) If I can help, I'ld be glad to. /robert Rick Reumann wrote: Yea Robert, PLEASE put your findings in the wiki. An entry on how to get started using Tiles with JSF would be extremely helpful. I'm going to be tapping you for tiles help now:) On 9/17/05, *Martin Marinschek* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: I think something like this belongs onto the Wiki if you can spare the time! would be great to have this info there ;) regards, Martin
Tiles and JSF Wiki entry
It was recommended by a few users that a wiki entry be created for my recent adventures in learning how to use Tiles with MyFaces. See the thread subject [newbie] Forward to launch page if you want all the gory details. You can find the wiki entry here: http://wiki.apache.org/myfaces/Tiles_and_JSF%2e It's my first wiki entry, so if you find some mistakes or ways to improve it, feel free to jump right in or let me know. Thanks again for all who helped me and I hope this helps others. /robert
Re: [newbie] Forward to launch page
Wow! I feel like I'm in left field here. Let me back up and tell you what I want to accomplish. I have an existing Struts application which I want to convert to using JSF. That application uses tiles and prefix mapping. I have the Struts application set up such that when the user invokes /app/launch, the Struts controller is invoked (prefix mapping for Struts servlet is /app/*), looks up the corresponding action mapping, TilesRequestProcessor resolves the tiles definition then builds my page. So far, the examples I have provided on this thread use extesion mapping. This is because I started having so much trouble with prefix mapping, that I thought if I could get my example working using extension mapping, I could simply change the mapping and I would be okay. So before I waste more bandwidth, I'm going to do some more research, because I obviously don't understand the life cycle. Thanks for all who have helped so far. /robert Volker Weber wrote: Hi, as i mentioned before: your has to made the redirect/forward link relative. I just check this out with the redirect in my application. Prefixing the redirect url with a '/' results in a HTTP Status 404 - /faces/overview/intro.jsp ! If you use absolute url you has to add the application path also. If you know the url you has to type in your browser to get your launch page, this is exactly the url to must redirect/forward to! The navigation-rules of your faces-config.xml are not needed for this, just for inner application navigation. Regards Rick Reumann wrote: Well I believe your index page of: jsp:forward page=/launch.faces/ Is going to try to find /launch.jsp in the root but you don't have launch there so make it: jsp:forward page=/pages/launch.faces/ and you should be all set. Also this rule: navigation-rule navigation-case to-view-id/pages/launch.jsp/to-view-id /navigation-case /navigation-rule I don't think will do anything since you don't have a from-outcome defined, so I'm not sure what the above will ever do. I think you are expecting the to-view-id to fire based on the forward set up in your index, but that's not the case since that forward is going to try to resolve to a jsp (which doesn't exist in your root).
Re: [newbie] Forward to launch page
Yep. Good advice. I'm backing out the JspTilesViewHandlerImpl for now and am using the default. I'll get it eventually. /robert Rick Reumann wrote: Robert, I haven't figured out Tiles yet with JSF. I got frustrated trying too many things at once, so I backed out my Tiles stuff and just tried to get a simple app working first. My next step is to learn tiles. I have the feeling using Tiles might really complicate the learning process. On 9/17/05, *Robert Taylor* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Wow! I feel like I'm in left field here. Let me back up and tell you what I want to accomplish. I have an existing Struts application which I want to convert to using JSF. That application uses tiles and prefix mapping. I have the Struts application set up such that when the user invokes /app/launch, the Struts controller is invoked (prefix mapping for Struts servlet is /app/*), looks up the corresponding action mapping, TilesRequestProcessor resolves the tiles definition then builds my page. So far, the examples I have provided on this thread use extesion mapping. This is because I started having so much trouble with prefix mapping, that I thought if I could get my example working using extension mapping, I could simply change the mapping and I would be okay. So before I waste more bandwidth, I'm going to do some more research, because I obviously don't understand the life cycle. Thanks for all who have helped so far. /robert Volker Weber wrote: Hi, as i mentioned before: your has to made the redirect/forward link relative. I just check this out with the redirect in my application. Prefixing the redirect url with a '/' results in a HTTP Status 404 - /faces/overview/intro.jsp ! If you use absolute url you has to add the application path also. If you know the url you has to type in your browser to get your launch page, this is exactly the url to must redirect/forward to! The navigation-rules of your faces-config.xml are not needed for this, just for inner application navigation. Regards Rick Reumann wrote: Well I believe your index page of: jsp:forward page=/launch.faces/ Is going to try to find /launch.jsp in the root but you don't have launch there so make it: jsp:forward page=/pages/launch.faces/ and you should be all set. Also this rule: navigation-rule navigation-case to-view-id/pages/launch.jsp/to-view-id /navigation-case /navigation-rule I don't think will do anything since you don't have a from-outcome defined, so I'm not sure what the above will ever do. I think you are expecting the to-view-id to fire based on the forward set up in your index, but that's not the case since that forward is going to try to resolve to a jsp (which doesn't exist in your root). -- Rick
Re: [newbie] Forward to launch page (w/Tiles) [SOLVED]
First, thanks again for the patience of the group on this matter and for those who helped; Rick, Wendy, and Volker. I definitely had a Struts mindset when it came to the request processing life cycle. Once I read through the spec. and understood the request processing life cycle a little better, things became more clear as to the behavior I was seeing. Here's what I ended up doing: - Used path mapping in web.xml and mapped the JSF servlet to /app/* - Defined index.jsp as a welcome page for my app. - Used a jsp:forward page=/app/launch.jsp/ in index.jsp. (Note I do not have a page launch.jsp under my web app root context). This is kind of tricky here. Since I'm using JspTilesViewHandlerImpl, it processes the request like so: - Determines that I'm using path mapping and not extension mapping - Looks for the default suffix (.jsp) - Replaces the default suffix with the default Tiles suffix (.tiles). - Looks up the Tiles definition corresponding to /launch.tiles - Dispatches to /lauch.tiles From there, Tiles does the rest as far as rendering the view. It ended up pulling my /pages/launch.jsp into a template as defined by the tile. As a couple of you already mentioned, the navigation rules did not even come into play. This is because, it was a non-faces request; meaning the request did not originate as a result of a JSF request. I also learned that the extension which the JspTilesViewHandlerImpl looks for to determine if it should be processed by Tiles, is configurable. You can define something other than the default by placing it in the web.xml init context param under the attribute, javax.faces.DEFAULT_SUFFIX. For example: context-param param-namejavax.faces.DEFAULT_SUFFIX/param-name param-value.myTilesSuffix/param-value /context-param Anyhow, I think I'm good to go for now. I'll press on with more adventures in JSF :) /robert Robert Taylor wrote: Yep. Good advice. I'm backing out the JspTilesViewHandlerImpl for now and am using the default. I'll get it eventually. /robert Rick Reumann wrote: Robert, I haven't figured out Tiles yet with JSF. I got frustrated trying too many things at once, so I backed out my Tiles stuff and just tried to get a simple app working first. My next step is to learn tiles. I have the feeling using Tiles might really complicate the learning process. On 9/17/05, *Robert Taylor* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Wow! I feel like I'm in left field here. Let me back up and tell you what I want to accomplish. I have an existing Struts application which I want to convert to using JSF. That application uses tiles and prefix mapping. I have the Struts application set up such that when the user invokes /app/launch, the Struts controller is invoked (prefix mapping for Struts servlet is /app/*), looks up the corresponding action mapping, TilesRequestProcessor resolves the tiles definition then builds my page. So far, the examples I have provided on this thread use extesion mapping. This is because I started having so much trouble with prefix mapping, that I thought if I could get my example working using extension mapping, I could simply change the mapping and I would be okay. So before I waste more bandwidth, I'm going to do some more research, because I obviously don't understand the life cycle. Thanks for all who have helped so far. /robert Volker Weber wrote: Hi, as i mentioned before: your has to made the redirect/forward link relative. I just check this out with the redirect in my application. Prefixing the redirect url with a '/' results in a HTTP Status 404 - /faces/overview/intro.jsp ! If you use absolute url you has to add the application path also. If you know the url you has to type in your browser to get your launch page, this is exactly the url to must redirect/forward to! The navigation-rules of your faces-config.xml are not needed for this, just for inner application navigation. Regards Rick Reumann wrote: Well I believe your index page of: jsp:forward page=/launch.faces/ Is going to try to find /launch.jsp in the root but you don't have launch there so make it: jsp:forward page=/pages/launch.faces/ and you should be all set. Also this rule: navigation-rule navigation-case to-view-id/pages/launch.jsp/to-view-id /navigation-case /navigation-rule I don't think will do anything since you don't have a from-outcome defined, so I'm not sure what the above will ever do. I think you are expecting the to-view-id to fire based on the forward set up in your index, but that's not the case since that forward is going to try to resolve to a jsp (which
Re: [newbie] Forward to launch page
Thanks. But I've tried redirect already. Still the same problem. I also prefer to use path mapping as opposed to prefix mapping. I'm still baffled why this simple test won't work. I'll keep banging at it. The problem has to be something simple. /robert Thomas Spiegl wrote: You could use a redirect instead. If you are using extension mapping *.jsf the following redirect should work. % response.sendRedirect(response.encodeRedirectURL(/pages/launch.jsf)); % Thomas On 9/16/05, *Robert Taylor* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Greetings, I'm a current Struts user interested in learning and using MyFaces and JSF. My dev. env. consists of Tomcat 5.5.9, MyFaces 1.0.9, JDK 1.4.2, Win2K. I've configured MyFaces to use Tiles for view-handler. What I want to do is to have my welcome page (index.jsp), forward to a launch page for the application. In Struts, I would simply use a jsp:forward page=/app/launch/. In my struts-config.xml file I has an action mapping for action path=/launch forward=launch.tile/ which forwarded to a tiles configuration which builds the page. I'm trying to do something similar with JSF, but have been unsuccessful. I removed the tiles complexity just to see if it would display a non-tiles .jsp. My wecome page consists of a single line: jsp:forward page=/app/launch/. My faces-context.xml file is as follows: ?xml version=1.0? !DOCTYPE faces-config PUBLIC -//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN http://java.sun.com/dtd/web-facesconfig_1_0.dtd; faces-config navigation-rule from-view-id/launch/from-view-id navigation-case to-view-id/pages/launch.jsp/to-view-id /navigation-case /navigation-rule /faces-config I keep getting a 404 error. The HTTP request is for /test/app/launch, but the 404 error indicates it cannot find /test/launch. The log files reflect the following: 2005-09-15 17:39:05,140 [http-8080-Processor24] DEBUG org.apache.myfaces.lifecycle.LifecycleImpl - entering restoreView in org.apache.myfaces.lifecycle.LifecycleImpl 2005-09-15 17:39:05,187 [http-8080-Processor24] DEBUG org.apache.myfaces.application.jsp.JspStateManagerImpl - No tree structure state found in client request 2005-09-15 17:39:05,234 [http-8080-Processor24] DEBUG org.apache.myfaces.application.jsp.JspViewHandlerImpl - Created view /launch 2005-09-15 17:39:05,312 [http-8080-Processor24] DEBUG org.apache.myfaces.util.DebugUtils - Newly created view UIViewRoot id=NULL family=javax.faces.ViewRoot transient=false rendered=true rendererType=NULL locale=en rendersChildren=false renderKitId=HTML_BASIC viewId=/launch/ 2005-09-15 17:39:05,359 [http-8080-Processor24] DEBUG org.apache.myfaces.lifecycle.LifecycleImpl - exiting restoreView in org.apache.myfaces.lifecycle.LifecycleImpl (-- render response) 2005-09-15 17:39:05,359 [http-8080-Processor24] DEBUG org.apache.myfaces.lifecycle.LifecycleImpl - entering renderResponse in org.apache.myfaces.lifecycle.LifecycleImpl 2005-09-15 17:39:05,359 [http-8080-Processor24] DEBUG org.apache.myfaces.webapp.webxml.WebXmlParser - adding mapping for servlet + Faces Servlet urlpattern = /app/* 2005-09-15 17:39:05,359 [http-8080-Processor24] DEBUG org.apache.myfaces.application.jsp.JspViewHandlerImpl - Dispatching to /launch 2005-09-15 17:39:05,468 [http-8080-Processor24] DEBUG org.apache.myfaces.util.DebugUtils - View after rendering UIViewRoot id=NULL family=javax.faces.ViewRoot transient=false rendered=true rendererType=NULL locale=en rendersChildren=false renderKitId=HTML_BASIC viewId=/launch/ 2005-09-15 17:39:05,468 [http-8080-Processor24] DEBUG org.apache.myfaces.lifecycle.LifecycleImpl - exiting renderResponse in org.apache.myfaces.lifecycle.LifecycleImpl Any ideas, suggestions, RTFM, etc... would be helpful. I have read through the JSF spec. regarding the navigation and I still can't figure out what I have misconfigured. I even tried removing the from-view-id/launch/from-view-id altogether to make sure the navigaction-case/ would execute but still get the same error. /robert
Re: [newbie] Forward to launch page
Hey Rick! It's nice to see a familiar name. Nice JSF example on your site. I'm using it to see where the heck I'm screwing up. Here's my directory set up: /index.jsp /css /images /javascript /pages/launch.jsp /WEB-INF Here's a snippet from my web.xml - snip servlet-mapping servlet-nameFaces Servlet/servlet-name url-pattern*.faces/url-pattern /servlet-mapping /snip Here's a snippet from my faces-context.xml file. This is really the only thing I have in it besides the doctype. -- faces-config navigation-rule navigation-case to-view-id/pages/launch.jsp/to-view-id /navigation-case /navigation-rule /faces-config Here's my index.jsp file: -- jsp:forward page=/launch.faces/ This set up produces a 404 error: --- HTTP Status 404 - /launch.jsp type Status report message /launch.jsp description The requested resource (/launch.jsp) is not available. Notices there is no mention of /pages directory in the error message. Now, if I copy or move the /pages/lauch.jsp to /launch.jsp AND make no other changes, redeploy. The page is found and is rendered. As long as launch.jsp resides directly under the webapp root context, I can even change to-view-id/pages/launch.jsp/to-view-id to to-view-id/launch.jsp/to-view-id and it is found. It's as if the /pages part of the view-id is being stripped out. I'm going to have a look at the source in org.apache.myfaces.application.jsp.JspTilesViewHandlerImpl to see if I can tell what's happening. Any ideas? Have you seen any examples where the pages reside in a subdirectory instead of directly under the web app root context? I running Tomcat 5.5.9, JDK 1.4.2, on Win2K, with MyFaces 1.0.9. /robert Rick Reumann wrote: Robert Taylor wrote the following on 9/15/2005 6:12 PM: Greetings, I'm a current Struts user interested in learning and using MyFaces and JSF. My dev. env. consists of Tomcat 5.5.9, MyFaces 1.0.9, JDK 1.4.2, Win2K. I've configured MyFaces to use Tiles for view-handler. What I want to do is to have my welcome page (index.jsp), forward to a launch page for the application. In Struts, I would simply use a jsp:forward page=/app/launch/. In my struts-config.xml file I has an action mapping for action path=/launch forward=launch.tile/ which forwarded to a tiles configuration which builds the page. I'm trying to do something similar with JSF, but have been unsuccessful. I removed the tiles complexity just to see if it would display a non-tiles .jsp. My wecome page consists of a single line: jsp:forward page=/app/launch/. My faces-context.xml file is as follows: ?xml version=1.0? !DOCTYPE faces-config PUBLIC -//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN http://java.sun.com/dtd/web-facesconfig_1_0.dtd; faces-config navigation-rule from-view-id/launch/from-view-id navigation-case to-view-id/pages/launch.jsp/to-view-id /navigation-case /navigation-rule /faces-config How's it going Robert. Good to see you here:) I'm not totally sure of the interaction/effects of using .faces (assuming you have in you web.xml: servlet-mapping servlet-nameFaces Servlet/servlet-name url-pattern*.faces/url-pattern /servlet-mapping ) but what should work is jsp:forward page=/app/launch.faces/ navigation-rule navigation-case from-outcomeapp/launch/from-outcome to-view-id/pages/launch.jsp/to-view-id /navigation-case /navigation-rule Someone please correct if what I'm doing above is the wrong approach (as I'm using it in the online example I wrote and I want to be doing the correct thing http://www.reumann.net/reumann/jsf/jsf_employees/ )
[newbie] Forward to launch page
Greetings, I'm a current Struts user interested in learning and using MyFaces and JSF. My dev. env. consists of Tomcat 5.5.9, MyFaces 1.0.9, JDK 1.4.2, Win2K. I've configured MyFaces to use Tiles for view-handler. What I want to do is to have my welcome page (index.jsp), forward to a launch page for the application. In Struts, I would simply use a jsp:forward page=/app/launch/. In my struts-config.xml file I has an action mapping for action path=/launch forward=launch.tile/ which forwarded to a tiles configuration which builds the page. I'm trying to do something similar with JSF, but have been unsuccessful. I removed the tiles complexity just to see if it would display a non-tiles .jsp. My wecome page consists of a single line: jsp:forward page=/app/launch/. My faces-context.xml file is as follows: ?xml version=1.0? !DOCTYPE faces-config PUBLIC -//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN http://java.sun.com/dtd/web-facesconfig_1_0.dtd; faces-config navigation-rule from-view-id/launch/from-view-id navigation-case to-view-id/pages/launch.jsp/to-view-id /navigation-case /navigation-rule /faces-config I keep getting a 404 error. The HTTP request is for /test/app/launch, but the 404 error indicates it cannot find /test/launch. The log files reflect the following: 2005-09-15 17:39:05,140 [http-8080-Processor24] DEBUG org.apache.myfaces.lifecycle.LifecycleImpl - entering restoreView in org.apache.myfaces.lifecycle.LifecycleImpl 2005-09-15 17:39:05,187 [http-8080-Processor24] DEBUG org.apache.myfaces.application.jsp.JspStateManagerImpl - No tree structure state found in client request 2005-09-15 17:39:05,234 [http-8080-Processor24] DEBUG org.apache.myfaces.application.jsp.JspViewHandlerImpl - Created view /launch 2005-09-15 17:39:05,312 [http-8080-Processor24] DEBUG org.apache.myfaces.util.DebugUtils - Newly created view UIViewRoot id=NULL family=javax.faces.ViewRoot transient=false rendered=true rendererType=NULL locale=en rendersChildren=false renderKitId=HTML_BASIC viewId=/launch/ 2005-09-15 17:39:05,359 [http-8080-Processor24] DEBUG org.apache.myfaces.lifecycle.LifecycleImpl - exiting restoreView in org.apache.myfaces.lifecycle.LifecycleImpl (-- render response) 2005-09-15 17:39:05,359 [http-8080-Processor24] DEBUG org.apache.myfaces.lifecycle.LifecycleImpl - entering renderResponse in org.apache.myfaces.lifecycle.LifecycleImpl 2005-09-15 17:39:05,359 [http-8080-Processor24] DEBUG org.apache.myfaces.webapp.webxml.WebXmlParser - adding mapping for servlet + Faces Servlet urlpattern = /app/* 2005-09-15 17:39:05,359 [http-8080-Processor24] DEBUG org.apache.myfaces.application.jsp.JspViewHandlerImpl - Dispatching to /launch 2005-09-15 17:39:05,468 [http-8080-Processor24] DEBUG org.apache.myfaces.util.DebugUtils - View after rendering UIViewRoot id=NULL family=javax.faces.ViewRoot transient=false rendered=true rendererType=NULL locale=en rendersChildren=false renderKitId=HTML_BASIC viewId=/launch/ 2005-09-15 17:39:05,468 [http-8080-Processor24] DEBUG org.apache.myfaces.lifecycle.LifecycleImpl - exiting renderResponse in org.apache.myfaces.lifecycle.LifecycleImpl Any ideas, suggestions, RTFM, etc... would be helpful. I have read through the JSF spec. regarding the navigation and I still can't figure out what I have misconfigured. I even tried removing the from-view-id/launch/from-view-id altogether to make sure the navigaction-case/ would execute but still get the same error. /robert