• 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

Struts-Forward back to original page

 
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm starting to write struts application (very small, still). On my first page, I want to ask the user to enter "signup" information, then submit the data to a database, then forward back to the signup page, listing all data (pulled back from db) on the signup form. (So the user could enter several rows of info & see a cumulative list below.)

I have all the pieces of this working, except that when the form is submitted a second time, the action path doesn't seem to be recognized properly.

When I first hit my page (url: http:..myserver/Enroll/jsp/SignUp.jsp it works fine. I hit Submit, the action form is invoked, and user is forwarded back to the original page (url: http:..myserver/Enroll/signup.do). But when I hit Submit this time, I get "Page Cannot Be Found" with URL: http:..myserver/signup.do (it's missing the webapp name this time...)

from struts-config.xml:



from Action class (SignUpAction):



from JSP:





I'm somewhat new to struts... in case you couldn't guess!!


Where did I go wrong here?
[ January 23, 2006: Message edited by: Elaine Micheals ]
 
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi! I would personally try to study struts HTML tags. They will make your life easier. As for your problem, please try putting this lines

at the very top of your JSP, put this...



replace yout form tag with this



and inside the <html:form> tag, replace your submit button with this



now go and try that now ;)
 
Gail Schlentz
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you... you are a god!

...or I am an idiot... or maybe a little of both!!

It's working now, after your suggestion & a little tweeking my formbean.

Many Thanks!!!
 
Timothy Sam
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Glad to be of service!
 
Uh oh, we're definitely being carded. Here, show him this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic