SJCP 1.5 with 93%.Preparing for WCD
[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Jeanne Boyarsky wrote:
If you want to change the pattern, it's easy to do - you just do it in the web.xml. I use a directory like "/a/*". (It's not really "a" - it's something with business meaning.)
SJCP 1.5 with 93%.Preparing for WCD
I see wind mills
Rodrigo Bossini wrote:As per my understanding, the .do extension is something created by the developer, therefore, you can use the extension you like . In the web.xml file you give both an internal name (which is obviously used internally only, not available for client requests) for each of your servlets and also a url pattern, which is what
the client will type to get the needed resource. The servlet itself obviously doesn't have a .do extension (it's a .class file), but the url pattern the client types does have a .do extension. Why? Because the developer mapped it this way in the web.xml. In short, the patterns mapped in the web.xml can have the extension YOU want them to have, or NO extension at all! I don't think the .do extension has particularly anything to do with struts.
SJCP 1.5 with 93%.Preparing for WCD
Note the extension .do in this URL. The extension causes your container (i.e. Tomcat) to call the ActionServlet, which sees the word "login" as the thing you want to do. The configuration is referenced, and your LoginAction is executed.
[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
Sagar Rohankar wrote:.do is struts default extension which maps with the ActionServlets,
Source:
http://struts.apache.org/1.3.10/faqs/works.html
Note the extension .do in this URL. The extension causes your container (i.e. Tomcat) to call the ActionServlet, which sees the word "login" as the thing you want to do. The configuration is referenced, and your LoginAction is executed.
now you can't remove this .do but using some tricks (eg url rewrite) you can move around with .do extension.
Here is the master link for that:
http://www.lunatech-research.com/archives/2005/07/29/struts-urls
[Note: This things are suggested for the Struts perfectionist, so if you're thinking it for practice no problem]
SJCP 1.5 with 93%.Preparing for WCD
Anuj Singh wrote:....its nowhere mentioned that .do is struts' default extension??
[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]