Techspace

IT happens only in IT

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.

Advertisement

March 18, 2007 - Posted by | Struts

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

Gravatar
WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.