File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Struts URL mapping question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts URL mapping question" Watch "Struts URL mapping question" New topic
Author

Struts URL mapping question

liang sun
Ranch Hand

Joined: May 12, 2001
Posts: 51
I use struts to develop a web application.
Homepage's URL is http://www.aaaaa.com/web/aaa.do
But our client hope when they type www.aaaa.com, page that IE shows is same as page that is http://www.aaaaa.com/web/aaa.do
Please ask how to solve. Thank you reading and help!
Shed Hollaway
Greenhorn

Joined: Aug 11, 2003
Posts: 9
liang,
You should try two things to get the desired result. First, setup a welcome-file in your web.xml to remove the aaa.do. Then, configure jk2 (a webserver-to-webappserver connecter) to change http://www.aaaaa.com/web/ to http://www.aaaaa.com/.

I use struts to develop a web application.
Homepage's URL is http://www.aaaaa.com/web/aaa.do
But our client hope when they type www.aaaa.com, page that IE shows is same as page that is http://www.aaaaa.com/web/aaa.do


Hope this helps!
Shed.
Nicholas Cheung
Ranch Hand

Joined: Nov 07, 2003
Posts: 4982
You may also configure a Filter to add the required parameters, when the request URL does not contain any query strings.

Nick


SCJP 1.2, OCP 9i DBA, SCWCD 1.3, SCJP 1.4 (SAI), SCJD 1.4, SCWCD 1.4 (Beta), ICED (IBM 287, IBM 484, IBM 486), SCMAD 1.0 (Beta), SCBCD 1.3, ICSD (IBM 288), ICDBA (IBM 700, IBM 701), SCDJWS, ICSD (IBM 348), OCP 10g DBA (Beta), SCJP 5.0 (Beta), SCJA 1.0 (Beta), MCP(70-270), SCBCD 5.0 (Beta), SCJP 6.0, SCEA for JEE5 (in progress)
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Shed's tip about configuring jk2 only works if you have an Apache HTTP server in front of your web container. Also, adding a welcome file into your application's web.xml or configuring a servlet filter doesn't help unless your application is mapped to the "default context" of your container.

Could you describe what kind of server setup you're using?
[ May 21, 2004: Message edited by: Lasse Koskela ]

Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts URL mapping question