2 Replies Latest reply on Jun 26, 2006 6:28 AM by gurnard

    newbie struts error

    gurnard

      Hello.

      I am having a frustrating problem with an action. All it is is a simple foward after a query in a bean, but I keep getting forward success not found from the server log. I am sure I am just missing out on something simple here but I just can't see what, below is the situation:

      I have an index doing a redirect:

      <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
      <c:redirect url="activeProfiles.do?dispatch=getActiveProfiles"/>
      


      This is the struts-config bit
      <action
       path="/activeProfiles"
       type="coreservlets.action.ProfileAction"
       parameter="dispatch">
       <forward page="success" path="/display/activeProfiles.jsp"/>
      </action>
      


      I do have the file in the correct directory that struts-config is calling to.

      This is the class bit doing the return
       public ActionForward getActiveProfiles(ActionMapping mapping,ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception{
       logger.debug("getActiveProfiles");
       populateActiveProfiles(request);
       return mapping.findForward("success");
       }
      
       private void populateActiveProfiles(HttpServletRequest request){
       ArrayList activeProfiles;
       try {
       activeProfiles = proService.getActiveProfiles();
       request.setAttribute(Constants.ACTIVEPROFILES,activeProfiles);
       } catch (SQLException e) {
       // TODO Auto-generated catch block
       e.printStackTrace();
       }
      
       }
      



      This is the server error that I get when I hit index.jsp:
      2006-06-26 11:57:37,811 INFO [STDOUT] 11:57:37,811 WARN [ActionMapping] Unable to find 'success' forward.
      


      Any help, hints or pointers would be greatly appreciated.

      Thanks for reading.

      cheers
      Martin


        • 1. Re: newbie struts error
          jaikiran

          I am not a expert at Struts, but i think:

          <forward page="success" path="/display/activeProfiles.jsp"/>


          should be:

          <forward name="success" path="/display/activeProfiles.jsp"/>




          • 2. Re: newbie struts error
            gurnard

            Jaikiaran, excellent thanks. You maybe no expert but you have an eye for syntax, nice one, should have spotted it myself but that is the way heh looking at the thing too closely.

            It works with the change. Thank you very much for your help.

            cheers
            Martin