• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts 2 newbie - returned String.

 
Swerrgy Smith
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have an action class like below:



Is there any problem with this code when the execute() function is invoked?
I wonder if doOther() function will be executed or not? After the doSomething() function return a String, whether the correspondent output will be displayed immediately or not?
 
Ankit Garg
Sheriff
Posts: 9521
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
doOther will be executed. After Struts calls your execute method, Struts will only take matters into its hands after you return a String from the execute method itself. Your call to doSomething doesn't matter to Struts. The last line of the execute method will return str to Struts and after that Struts will send the corresponding result to the client. The output will only be displayed after the execute method has completed i.e. not immediately after doSomething method completes...
 
Swerrgy Smith
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much, Ankit Garg
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic