aspose file tools*
The moose likes Struts and the fly likes get blank page for Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "get blank page for "Struts IN Action" first example ?" Watch "get blank page for "Struts IN Action" first example ?" New topic
Author

get blank page for "Struts IN Action" first example ?

steve francisco
Ranch Hand

Joined: Jan 26, 2005
Posts: 46
I use Tomcat 5.5 to try two examples. One is the first example "/register" in book "Struts in action" and the other is http://javaboutique.internet.com/tutorials/Struts/ example.

In both examples, I got the .jsp page but after I clicked the "submit" I saw BLANK page. I checked the code I cut/paste nothing is wrong. The URL also looks fine (..../register/submit.do?username=..&password=..), just don't know why it doesn't forward to the desired page ? Anybody encountered the same problem ?
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

A blank page usually means that the forward returned by your Action class was not correctly defined as a forward in your struts-config.

Common causes for this are typos, forgetting to add a particular forward to an ActionMapping, or the Action class returning null.


A good workman is known by his tools.
steve francisco
Ranch Hand

Joined: Jan 26, 2005
Posts: 46
maybe you guys don't believe, I really can't find any problem with the code I "pasted". Here are a snippet --

In the Action class, I just simply " return (mapping.findForward("success"));" at the end

In the struts-config.xml, I have <forward name="success" path="/success.html"/>

and I do have a "success.html" placed at the same level as WEB-INF.

really confused, what's wrong ? I see the URL shows "../submit.do?name=...&password=..." but the page is just blank...
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

It is possible that the execute method is not defined properly.

One of the most common causes that I see of this here at the ranch is when someone is trying to use an old tutorial with a newer version of Struts. The primary method of Action used to be perform but now it is execute.

The default behavior of the execute method is to return null, which will give a blank page because an ActionForward of null will not be found!
steve francisco
Ranch Hand

Joined: Jan 26, 2005
Posts: 46
Originally posted by Marc Peabody:
It is possible that the execute method is not defined properly.

One of the most common causes that I see of this here at the ranch is when someone is trying to use an old tutorial with a newer version of Struts. The primary method of Action used to be perform but now it is execute.

The default behavior of the execute method is to return null, which will give a blank page because an ActionForward of null will not be found!


You're the man ! That's the reason ! Thanks a million
 
 
subject: get blank page for "Struts IN Action" first example ?