Struts Two,

Two steps forward, three steps back.  Switching from index.jsp to
index.html required some JavaScript to replace <%=
request.getContextPath %>, and it behaved differently on WebSphere than
Tomcat so I had to check whether the page name was returned.  Below is
the JavaScript I came up with.

Can you explain why index.html would work and index.jsp would not? I got
<welcome-file>index.html</welcome-file> to work briefly yesterday, but
as I added security and other struts includes it quit working.  I've
stripped the configuration files back to where I thought they were when
they worked, but the welcome-file and all namespace actions are broken
again.  Perhaps if I knew the logic behind the switch from index.jsp to
index.html I would gain some insight.

The only change since I had it working that I am aware of is that
com.ibm.ws.webcontainer.assumefiltersuccessonsecurityerror is set to
true, but since I've temporarily yanked security from my web.xml I
wouldn't think that would matter.

var contextpath = window.location.pathname;
var fileIndex = contextpath.indexOf( "index.html" );
if ( fileIndex > 0 ) 
{
    contextpath = contextpath.substring( 0 , fileIndex );
}
window.location = contextpath + "myAction.action";

-----Original Message-----
From: Struts Two [mailto:struts...@yahoo.ca] 
Sent: Tuesday, June 02, 2009 3:35 PM
To: Struts Users Mailing List
Subject: Re: Adding Struts 2.1.6 on WAS 6.1 breaks welcome-file in
web.xml



> Typing http://servername/context/ results in "Error 404: There
> is no Action mapped for namespace / and action name ." 

To fix this issue, modify your welcome part of web.xml,

<welcome-file-list>
 <welcome-file>index.html</welconpme-file>       
</welcome-file-list>

create an index.html with the following content:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
    <META HTTP-EQUIV="Refresh" CONTENT="0;URL=index.action">
</head>

<body>
<p>Loading ...</p>
</body>
</html>

Then typing http://servername/context/ should work.



      __________________________________________________________________
Be smarter than spam. See how smart SpamGuard is at giving junk email
the boot with the All-new Yahoo! Mail.  Click on Options in Mail and
switch to New Mail today or register for free at http://mail.yahoo.ca

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org


------------------------------------------------------------------------------
NOTICE:  This electronic mail message and any attached files are confidential.  
The information is exclusively for the use of the individual or entity intended 
as the recipient.  If you are not the intended recipient, any use, copying, 
printing, reviewing, retention, disclosure, distribution or forwarding of the 
message or any attached file is not authorized and is strictly prohibited.  If 
you have received this electronic mail message in error, please advise the 
sender by reply electronic mail immediately and permanently delete the original 
transmission, any attachments and any copies of this message from your computer 
system. Thank you.

==============================================================================


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to