David Thielen wrote:
Asking again - thanks - dave
-----Original Message-----
Hi;
1) I want my default page to be index.do so I set the following in web.xml:
<welcome-file-list>
<welcome-file>index.do</welcome-file>
</welcome-file-list>
But instead I get a directory of files in my root when I go to the servlet.
I can do this which works:
<welcome-file-list>
<welcome-file>index.txt</welcome-file>
</welcome-file-list>
It appears it wants a file. Not an issue (see item 2) but just wanted to
know what is going on.
You're right, you can only use physical files as welcome files. The
servlet spec doesn't support dynamic resources for this use. The
standard solution is to use an index.jsp that simply forwards or
redirects to a Struts action.
2) My main page is a frameset. I tried having that be a do/jsp but when I
pressed refresh on the browser, it went back to the start page. So I made it
a html file and the three frames are .do urls. This works fine, I'm just
asking if this is the best way to do this.
What do you mean 'went back to the start page'? Remember that refreshing
a page that uses framesets refreshes the *frameset*, not the frames
within it.
3) I need to have a method called when my servlet first loads. Is a
listener the best way to do this?
If it's your servlet, just implement its init() method. If you want to
call other code on load of an arbitrary servlet there are various
listener interfaces you can implement and register in web.xml.
ServletContextListener [1] is probably the one you want in this case.
L.
[1]
http://tomcat.apache.org/tomcat-5.0-doc/servletapi/javax/servlet/ServletContextListener.html
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]