aspose file tools*
The moose likes Struts and the fly likes By default index.jsp is getting called instead of my login page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "By default index.jsp is getting called instead of my login page " Watch "By default index.jsp is getting called instead of my login page " New topic
Author

By default index.jsp is getting called instead of my login page

Shiva Gajjala
Ranch Hand

Joined: May 02, 2014
Posts: 52

Hi,I have extracted struts-blank.war and working on struts.I have created a login.jsp page and placed inside pages folder . Here it is,


</xml>
I want my login page to be executed by default as welcome page when I use the URL http://localhost:8080/Tracker ,where Tracker is my project name.
My web.xml file is as below.

And my struts configuration file (struts-config.xml) is below.


and index.jsp is,


I haven't mentioned <welcome-file-list> anywhere . I dont understand how index.jsp is called by default when I use the above URL. In the <global forwards> ,I changed the path to "/pages/login.do" ,but still index.jsp is called . First of all, index.jsp is not written anywhere (web.xml & Struts configuration file) .This question might be silly, but I just wanted to know what is happening internally. What exactly service() method of ActionServlet is doing.
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8971
    
    9

According to the Servlet Specification, the behavior is server-dependent if you do not declare a welcome file. For example, the Glassfish docs say:
If no welcome file is specified, the GlassFish Server will use a file named index.html as the default welcome file. If there is no welcome file and no file named index.html, the GlassFish Server returns a directory listing.

JEE Tutorial

Since a servlet container knows nothing about Struts, you cannot rely on a Struts configuration to determine what file is displayed by default.

[How To Ask Questions On JavaRanch]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: By default index.jsp is getting called instead of my login page