jQuery in Action, 2nd edition*
The moose likes Struts and the fly likes Basic Struts question 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 "Basic Struts question" Watch "Basic Struts question" New topic

Basic Struts question

Rajesh Khan
Ranch Hand

Joined: Oct 16, 2011
Posts: 230
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
Joe Ess

Joined: Oct 29, 2001
Posts: 8839

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.

"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
I agree. Here's the link: http://aspose.com/file-tools
subject: Basic Struts question
Similar Threads
Struts2 Model Driven question for a complex model
Handling multiple form data in struts2
struts2 problem
Struts2 CannotRenderException
Interceptor messes up action class in Struts2