• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ?
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
steve francisco
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic