You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Alessio <mo...@dit.unitn.it> on 2003/07/10 09:45:15 UTC
mapping.findForward error/bug?
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