struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alessio" <mod...@dit.unitn.it>
Subject mapping.findForward error/bug?
Date Thu, 10 Jul 2003 07:45:15 GMT
Hello all,
i work with Struts(v. 1.1 final)/tiles and EJB
in an Action i call an EJB method to have information to display in page,
after this i find if the user is logged if no i forward to action of
login...
the code:
( note: baseAction contains some utility method as find in the session if
there is the user variable created at login...)
public class example extends baseAction
{
 public ActionForward execute(ActionMapping mapping,ActionForm form,
HttpServletRequest request, HttpServletResponse response)
    {
  try{
      ...
        InformationManagerLocal im = ...obtain local
        Collection col = im.getInfoCourses();
        Integer idUser;
       if(super.isLogged(session)){ // control if user is logged
          ....
       }else{
            request.setAttribute("col",col);
            // i must passing the collection because the login Action create
the layout the page ( with tiles definition )
            // and in the munu i display the info present in collection
            return mapping.findForward("login");
            // where login is an global forward mapping on /loginA.do ( the
login action )
       }

..
  other EJB method call
...
       return mapping.findForward("success");
  }catch(Exception ex){
   ...
    return mapping.findForward("error");
  }
 }
}

Now if i execute this Action i obtain no error but the browser display that
problem, the page not be displayed...
the ejb method work correctly ( i use this in other Action... )
The problem born when i try to call an EJB method and after this i execute
an forward to another Action...in fact if i comment the line Collection col
= im.getInfoCourses(); the Action work correctly and the page is display ok
( except the information present in collection :)
But if i use
     return new ActionForward(mapping.findForward("login").getPath(),true);
the Action work ok ( but the url in browser are different and i dislike
it...)
Is an problem of mapping.findForward (because if i create an ActionForward
it's work)? Is a bug of 1.1 version? Problem with use EJB if i forward to
another Action after call EJB method?
Any Ideas?
Thanks in advance, Alessio




---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message