• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

.do vs .page question

 
Tina Long
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to learn struts...and I have some confusion that I'm hoping someone can shed some light on...

We have a web applicatoin and in the struts config file - there are different forwards depending on if the operation was sucessful or not. There are two different types of paths that we have in the file...

<forward name="success" path="/folder/success.do" /><forward name="view" path="/folder/view.page" />

When there is a path = *.page then it appears that the application then looks in the tiles-def file and finds what JSP page to view. But with there is a *.do then I'm not sure what happens. How does the application know where it is supposed to look for the next operation?

Does my question make sense and does anyone know?
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If it's *.do it is a Struts request. You will find another ActionMapping in the struts-config for each of those.
 
alan do
Ranch Hand
Posts: 354
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But with there is a *.do then I'm not sure what happens. How does the application know where it is supposed to look for the next operation?

web.xml ... servlet-mapping maps the the url-pattern to a servlet-name which in turn maps to the 'ActionServlet'... a .do request then go through ActionServlet which looks at your struts-config.xml to figure out where to go...either that or voodoo.
 
Tina Long
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
so if it goes to the struts-config file - should there be an entry for the success.do?
 
alan do
Ranch Hand
Posts: 354
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it depends...if your forward is defined to point to 'success.do' then absolutely! then again, why would you? just forward it to a tile, unless you want to forward it to something that does more (set values from backend call) after forwarding.
 
Tina Long
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you - I think I get it now
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic