• 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

3 hopefully easy struts questions

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I just have a few hopefully easy questions on struts.
1. In a struts application is every page passed to the actionServlet? For example if i have a jsp page which does nothing but provide a link to another jsp page (which does nothing) is it necessary to pass control to the digester servlet which will then use a mapping and an action object which simply contains a forward to the intended page. This seems like an unneccsary overhead.
2. Are actionForm objects always needed? What if the page does not submit a form?
3. Can you have multiple actions per action-mapping element in the config file? If so are these all eecuted in sequence? If not how do you determine which to use?

Thanks
Kola
 
Ranch Hand
Posts: 2676
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

1. In a struts application is every page passed to the actionServlet? For example if i have a jsp page which does nothing but provide a link to another jsp page (which does nothing) is it necessary to pass control to the digester servlet which will then use a mapping and an action object which simply contains a forward to the intended page. This seems like an unneccsary overhead.


In my opinion the overhead incurred in made up by the fact that if you later decide you want the jsp to do something else it will be easier to maintain. I believe that you can have a jsp bypass the controller based on the way you map your servlet in web.xml.

2. Are actionForm objects always needed?


No.

3. Can you have multiple actions per action-mapping element in the config file? If so are these all eecuted in sequence? If not how do you determine which to use?


I don't believe that you can have multiple actions in an action mapping, but you can use the forwarding mechanism to transfer control from one action to another.
 
KOla Oyedeji
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply
I believe that any url which does not end in *.do is not passed to the actionServlet. But as you pointed out ensuring that my pages are still pased to the servlet will make it easier to maintain in future - thanks
Kola
 
I once met a man from Nantucket. He had a tiny ad
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic