Posts filed under 'Struts'

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

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

2)
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.

Add comment March 18th, 2007


Add to Technorati Favorites

Blogroll

Categories

Archives

 

March 2010
M T W T F S S
« Dec    
1234567
891011121314
15161718192021
22232425262728
293031