This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes Struts - got a blank page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts - got a blank page" Watch "Struts - got a blank page" New topic

Struts - got a blank page

Tuan Le

Joined: Nov 17, 2004
Posts: 4

I read several posted msgs in this forum with the same problem that I'm having. It's hard to troubleshoot my problem since there was no error msg in the Tomcat stdout.txt and console

Here's a partial of my struts-config.xml

<!-- ===================== -->
<!-- Form Bean Definitions -->
<!-- ===================== -->
<form-bean name="homeForm" type="com.pbh.orportal.forms.HomeForm">
<form-property name="dispatch" type="java.lang.String"/>

<!-- ============================ -->
<!-- Action Mapping Definitions -->
<!-- ============================ -->
<action-mappings type="com.pbh.orportal.actions.CustomActionMapping">
<!-- Default "home" action -->
<!-- Forwards to home.jsp -->
scope="request" >
<set-property property="loginRequired" value="true" />
<forward name="success" path="/pages/home.jsp" />

--- my Action class ----

public ActionForward perform(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
String target = "success";

CustomActionMapping actionMapping = (CustomActionMapping) mapping;
// Does this action require the user to login?
// Note: The loginRequired flag is set in the <action path> of the
// struts-config.xml file
if (actionMapping.isLoginRequired()) {
String dispatch = ((HomeForm) form).getDispatch();
DAOFactory factory = DAOFactory.getDAOFactory(SQLSERVER);
return mapping.findForward(target);

--- my action form class --

public final class HomeForm extends ActionForm {
private String dispatch = null;

public HomeForm() {

public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
ActionErrors errors = new ActionErrors();
return errors;

public String getDispatch() {
return this.dispatch;
public void setDispatch(String dispatch) {
this.dispatch = dispatch;
} // HomeForm

Do you the reason that I'm getting a blank page? The JSP template is fine since I can view it without any compiler problem.

Marc Peabody
pie sneak

Joined: Feb 05, 2003
Posts: 4727

Over 90% of the time a blank page means that struts could not find a forward in your ActionMapping to match the one the Action is returning.

I noticed you used the perform method. That's deprecated. Use execute instead. The fact that you are using some "CustomActionMapping" is setting off a red flag to me as well.

A good workman is known by his tools.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Struts - got a blank page
Similar Threads
Cannot find bean coursesList in any scope
simple login n home(w/ iterate tag)
How to get the field details from one jsp page in struts dispatchaction action class
HTTP Status 500 -
application.resources don't show me the messages