Struts showing blank page

      No Comments on Struts showing blank page

Problem: When you submit a JSP page in struts sometimes you get a blank page.

Solution: One of the solution I found is to check whether the action class class execute method is properly overridden or not. If it is not properly overridden, some other execute method of base Action class’ will be called.

There are two execute method in org.apache.struts.action.Action class

ActionForward execute(ActionMapping mapping, ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)

ActionForward execute(ActionMapping mapping, ActionForm form, javax.servlet.ServletRequest request, javax.servlet.ServletResponse response)

For HTTP request struts calls the first execute method. If the signature of your execute method inadvertently says ServletRequest and ServletResponse as parameters then you will get a blank page because parent’s execute method with HttpServletRequest and HttpServletResponse is called and it returns null.

Leave a Reply

Your email address will not be published. Required fields are marked *