Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

When is the class that extends ActionForm executed

 
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a login.jsp that when you submit the action is /login

it has a LoginAction.java that has a code...



in struts-config.xml


... so when it forwards to "/Search.jsp" my question is...
will it execute the SearchForm.java indicated also in struts-config.xml (below)?



What I only know is, it will only execute if submit a form and the action in the form is action="/search". Or it will still execute even only you forward it to "/Search.jsp"?

Please enlighten me, thanks
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The answer to the question

When is the class that extends ActionForm executed?

is that it never executes. A class doesn't execute at all, ever. Only a method executes.

A better question would be "when do the methods of this class execute?". The answer is that each of the methods are called at different times in the Struts request life cycle.

I'd suggest you study the UML diagrams in the following URL to learn more about the Struts request life cycle and what gets called when.

http://rollerjm.free.fr/pro/Struts11.html

Disclaimer: The above URL applies to Struts 1.1, and is not entirely accurate for later releases. However, I'd still suggest getting an understanding of this version's life cycle and then learning the changes for the particular version that you're using.
 
Nelson Nadal
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much for prompt reply, will read more on this. Till next time.
 
If you send is by car it's a shipment, but if by ship it's cargo. This tiny ad told me:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic