Reputation: 1
I am having a problem with my struts application, where user is asked to update his details with form action as userUpdateAction and form bean is UserUpdateForm.I have servlet filter to check whether the user is already logged in or not. If he didnt login i will forward to login action.if he logged i will show him update form where after all successful validation's it is forwarded to blank page.
struts-config.xml
action path="/userUpdateAction" type="com.vaannila.action.userUpdateAction" name="UserUpdateForm" input="/update.jsp" validate="true" scope="request">
<forward name="success" path="/updateSuccess.jsp" />
<forward name="error" path="/update.jsp" />
action class
public class userUpdateAction extends Action{
@Override
public ActionForward execute(ActionMapping mapping, ActionForm form,
ServletRequest req, ServletResponse res) throws Exception {
UserUpdateForm userform = (UserUpdateForm)form;
System.out.println("form values :"+userform.getEmail());
return mapping.findForward("success");
}
}
Forwarding names are proper(success is correct in both class and struts-config.xml). execute method is also correctly overriding Action execute method.
In tomcat console i can see as
user already logged in start chain execution
2 Feb, 2012 9:12:10 AM org.apache.struts.chain.commands.servlet.CreateAction createAction
INFO: Initialize action of type: com.vaannila.action.userUpdateAction
errors : {}
userUpdateAction is intialized but it does not execute execute
method and going to a blank page.
Upvotes: 0
Views: 2581
Reputation: 11
I see in the comments section the issue as posted was resolved for the specific user. I was having the identical behavior as described (submit the http request but only a blank page was coming back). Wanted to share my resolution for others, especially since the initial answer here helped lead me to my resolution.
My team and I are upgrading from Struts 1.1 to 1.3 (a big jump). Most all of our action classes were using the perform() method. Turns out that for v1.1, perform() was deprecated and execute() was added. In v1.2, perform() was removed. That information never got located in our initial research before we began the upgrade effort. I don't know why our original app writers didn't use execute() all those years ago.
We changed our action classes to use the execute() method and everything started working again.
Hope this might save someone else time and effort in the future.
Upvotes: 1