| Author |
Use welcome-file-list to run struts action?
|
A Harry
Ranch Hand
Joined: Jan 23, 2002
Posts: 124
|
|
Can I the welcome-file-list element in web.xml to run the startup struts action of my application? Currently to start my app up the url is http://localhost:8080/PRD/PRD.do but would prefer something like http://localhost:8080/PRD or http://localhost:8080/PRD/main.jsp If I have to use a jsp file to redirect/forward to it what would this file look like? many thans
|
 |
Junilu Lacar
Bartender
Joined: Feb 26, 2001
Posts: 4118
|
|
You can define PRD.do as a welcome file and that should allow you to enter http://localhost:8080/PRD to bring up your application
|
Junilu - [How to Ask Questions] [How to Answer Questions] [MiH]
|
 |
A Harry
Ranch Hand
Joined: Jan 23, 2002
Posts: 124
|
|
Thanks for replying - in my web.xm file I've put - <welcome-file-list> <welcome-file>PRD.do</welcome-file> </welcome-file-list> when i type in this url http://localhost:8080/PRD/ now I get a directory listing for the PRD directory What am I doing wrong? thanks
|
 |
Mark Jones
Greenhorn
Joined: Apr 30, 2004
Posts: 4
|
|
Here is what I would do: 1) Create a 'welcome.jsp' which simply does a redirect to your struts alias. For example: <html> <body> <%response.sendRedirect("home.do");%> </body> </html> 2) Add the 'welcome.jsp' to your welcome-list. For example: <welcome-file-list> <welcome-file>welcome.jsp</welcome-file> </welcome-file-list> This setup works for me! -Chughead
|
 |
A Harry
Ranch Hand
Joined: Jan 23, 2002
Posts: 124
|
|
|
cheers CH, that's exactly what I wanted it to do!
|
 |
A Harry
Ranch Hand
Joined: Jan 23, 2002
Posts: 124
|
|
ah here we go & theres alway a gotcha - works fine on Tomcat 5 but not on Weblogic 8.1 Does anything ever get any easier in this god damm environment? - why does everything have to be such a battle!
|
 |
A Harry
Ranch Hand
Joined: Jan 23, 2002
Posts: 124
|
|
funny though putting this line in the welcome.jsp file <meta HTTP-EQUIV="REFRESH" content="0; url=PRD.do"> & it works fine on both servers! the weblogic error was - <2004-08-13 14:25:20,640> ERROR - Invalid path /jsp/PRD was requested Why? who knows, who cares just as long as it works!
|
 |
 |
|
|
subject: Use welcome-file-list to run struts action?
|
|
|