Odd, I posted this yesterday but it still hasn't made it to the list. Please ignore if this ends up a duplicate.

-------- Original Message --------
Subject: [solved] Re: [SHALE] Still not getting to resulting page based on navigation rules
Date: Thu, 25 Aug 2005 16:41:37 -0400
From: Rick Reumann <[EMAIL PROTECTED]>
To: Struts Users Mailing List <user@struts.apache.org>
References: <[EMAIL PROTECTED]>

I knew I was trying to combine to many different things at once
(MyFaces/Shale) but it took Craig to wake me up to realize it and
recommended I go back to starting small. I backed out the Shale stuff
and said let me go back to just MyFaces. By comparing my web.xml with
the MyFaces example web.xml, I realized that I had somehow left out:

<!-- Listener, that does all the startup work (configuration, init). -->
    <listener>
<listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
    </listener>

What's odd is thte application was sort of working without it. My
navigation rules weren't working without it though. I put back the shale
stuff and now I both are behaving nicely.

Oh well, thanks for all your patience. When I finally get a handle on
this, I'll have a simple MyFaces/Shale app that will be VERY basic that
others will hopefully get some use from when just starting out. I'll try
to write it up in a step-by-step guide at some point.

Rick Reumann wrote the following on 8/25/2005 3:03 PM:
Once again I'm stuck and I'm not sure what the problem is. Not sure if this is Shale or MyFaces related, but I'll post here first.

Before the problem some background:

<faces-config>
    <navigation-rule>
      <navigation-case>
         <from-outcome>success</from-outcome>
         <to-view-id>/employeeForm.jsp</to-view-id>
      </navigation-case>
   </navigation-rule>

    <managed-bean>
      <managed-bean-name>employees</managed-bean-name>
      <managed-bean-class>net.reumann.Employees</managed-bean-class>
      <managed-bean-scope>request</managed-bean-scope>
   </managed-bean>

    <managed-bean>
      <managed-bean-name>employee</managed-bean-name>
      <managed-bean-class>net.reumann.Employee</managed-bean-class>
      <managed-bean-scope>request</managed-bean-scope>
   </managed-bean>
</faces-config>


index.jsp
--------
<jsp:forward page="/employees.faces"/>


Employees.java
--------------
backing bean
has prerender()
getEmployees() //returns list of EmployeeVO objects


Employee.java
-------------
backing bean with vars matching EmployeeVO for form use
has method:
   public String retrieveEmployeeAction() {
        log.debug("in retrieveEmployeeAction()");
        //..
        return "success";
   }

employees.jsp
-------------
<f:view>
    <h:form>
    <h:dataTable var="emp" value="#{employees.employees}" >
     ...
     </h:dataTable>
<h:commandButton value="test" action="#{employee.retrieveEmployeeAction}"/>
    </h:form>
</f:view>

employeeForm.jsp
------------
 never reached:(
  <f:view>
        <h:form>

        </h:form>
</f:view>


PROBLEM:
--------
When I click on the link for retrieveEmployeeAction from employees.jsp, I see the log message fire in the appropriate method but I never reach employeeForm.jsp. I also see right after the log message in retrieveEmployeeAction, the log message in my prerrender of Employees.java - that prerrender *shouldn't* fire becuase I don't see why that file would be bound since I shouldn't be returning to employees.jsp. The only thing I can think of is that "success" isn't being picked up correctly by the navigation rules so it's trying to return back to employees.jsp - in which case I could see why the prerender would fire since it should. The error I keep getting after clicking on the retrieveEmployeeAction link is:


2005-08-25 14:56:07 StandardWrapperValve[Faces Servlet]: Servlet.service() for servlet Faces Servlet threw exception javax.faces.FacesException: javax.servlet.ServletException: javax.servlet.jsp.JspException: Unrecognized Content Type. at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:327) at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130) at org.apache.shale.faces.ShaleViewHandler.renderView(ShaleViewHandler.java:142) at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
    <snip>
Caused by: javax.servlet.ServletException: javax.servlet.jsp.JspException: Unrecognized Content Type. at org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:821) at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758) at org.apache.jsp.employeeForm_jsp._jspService(employeeForm_jsp.java:66)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
    <snip>

If it matters here is my web.xml
--------------------------------

<filter>
    <filter-name>shale</filter-name>
    <filter-class>
      org.apache.shale.faces.ShaleApplicationFilter
    </filter-class>
  </filter>

  <!-- Shale Application Controller Filter Mapping -->
  <filter-mapping>
    <filter-name>shale</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>

   <servlet>
      <servlet-name>Faces Servlet</servlet-name>
      <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
      <load-on-startup>1</load-on-startup>
   </servlet>

   <servlet-mapping>
      <servlet-name>Faces Servlet</servlet-name>
      <url-pattern>*.faces</url-pattern>
   </servlet-mapping>

   <welcome-file-list>
      <welcome-file>index.jsp</welcome-file>
   </welcome-file-list>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



--
Rick


--
Rick

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to