wood burning stoves 2.0
The moose likes Struts and the fly likes Setting an Action as welcome page(/action) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Setting an Action as welcome page(/action)" Watch "Setting an Action as welcome page(/action)" New topic

Setting an Action as welcome page(/action)

Babu Subbu

Joined: Sep 24, 2003
Posts: 9

I want a welcome action to be performed when the user accesses my web application. The welcome action would do some database look-up and render the welcome page (with data retrieved from DB).

This is how I achieve this now. I have designated an index.html in my web.xml as the welcome page as follows:

I then created webapps/<app-name>/index.html. This html auto-posts the action (that I want executed on welcome) upon load (using javascript) as follows

So index.html gets loaded first on the browser. Upon load, index.html does an auto-post for the logon action.
But this creates an element in the browser�s history. So I tried referencing the action directly in web.xml as follows

But even now, index.html gets loaded. I guess tomcat first looks out for file named webapps/<app-name>/logon. It obviously is not there and hence proceeds to the next welcome page.

How can I successfully reference an action in my web.xml?

I use Tomcat 4.1 (if it makes any difference).

I agree. Here's the link: http://aspose.com/file-tools
subject: Setting an Action as welcome page(/action)
It's not a secret anymore!