Saturday, July 24, 2010

Seam returns HTTP Status 404 but the page exist

Did it ever occur to you that you saw this message while are sure that particular page does exist at the given location ? :

Always keep an eye on the Seam console output, as in this case it provides the following info :

Jul 24, 2010 3:14:46 PM com.sun.facelets.impl.DefaultFaceletFactory createFacelet
WARNING: /conversations/template/template.xhtml not found at jndi:/localhost/seamdemo.ui/conversations/template/template.xhtml
The root cause for the 404 is the fact that his particular page referred to a template that couldn't be located :

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
s="http://jboss.com/products/seam/taglib"
ui="http://java.sun.com/jsf/facelets"
f="http://java.sun.com/jsf/core"
h="http://java.sun.com/jsf/html"
rich="http://richfaces.org/rich"
template="template/template.xhtml">
<ui:define name="body">
....
</ui:define>
</ui:composition>

As you can see, the template (defined in a relative way) couldn't be located from the page consuming it (located in a different folder).

3 comments:

  1. in correct : template="template/template.xhtml">
    correct : template="/template/template.xhtml">

    Regards
    Pradeep

    ReplyDelete
  2. I don't really have much idea bout this but I do appreciate your post. It seems useful for those readers related with IT.

    Janice

    Blog: rampe d'escalier 

    ReplyDelete
  3. I haven't tried this codes.
    Thank you so much for sharing, well~ I will see if this works correctly later.

    Lorena from tige filetée inox 

    ReplyDelete