• 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

Basic Struts question

 
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I ran my first struts2 example from http://www.vaannila.com/struts-2/struts-2-example/object-backed-java-beans-example-1.html which just displayed a form and echoed the contents back and I had a pretty basic question , I dont see the program attaching anything to the request object at the same time I read that using httpRequest object in struts2 is not a good practice.What I want to know is how is the object being attached and to what is it being attached to since its being accessed by the result page?


The struts.xml is


The form submitted calls the UserAction which is



and the echo form is
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
An extremely simplified explanation of Struts is that first it populates your action class with the form parameters. Next it runs the execute method, and uses the struts.xml to determine where to forward the data. Finally it processes the JSP, referencing the data set in the action class.
A more detailed explanation can be found in this article.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic