This week's giveaway is in the Spring forum.
We're giving away four copies of Learn Spring Security (video course) and have Eugen Paraschiv on-line!
See this thread for details.
Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Newbie to struts....help with ActionForward error

 
s logeson
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am new to struts and I just can't figure out why I'm getting this error message: org.apache.jasper.JasperException: Cannot find global ActionForward for name welcome
Here is my struts-config.xml:
<struts-config>
<form-beans/>
<global-forwards>
<forward name="welcome" path="/test.jsp" redirect="true" />
</global-forwards>

<action-mappings>
<action path="/home"
type="ematrix.framework.EmatrixBaseAction"
scope="request"
validate="false"
input="welcome.jsp">
<forward name="Success" path="/test.jsp"/>
</action>
</action-mappings>
<controller processorClass="org.apache.struts.action.RequestProcessor"
contentType="text/html;charset=UTF-8"/>
<message-resources parameter="EmatrixMessageResources"/>
</struts-config>
Here is my welcome.jsp:
<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>

<html>
<body>
<logic:forward name="welcome"/>
</body>
</html>

I'm just trying to forward to a test.jsp. Any help would be appreciated.
 
Rick Hightower
Author
Ranch Hand
Posts: 350
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If my memory servers me correctly.... the logic:forward does a request distpacther forward. Just for kicks try removing the redirect attribute from your welcome forward in you struts config file.
It could also be that the JSP page you specify in the forward is spelled wrong. Try forwarding directly to the jsp with <jsp:forward instead.
BTW logic:forward breaks the model 2/MVC framework as it allows the view to select the next view. Only the controller should select the next view.
 
Rick Hightower
Author
Ranch Hand
Posts: 350
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did that help?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic