While the server is running, I am able to be
redirected to the welcome page after I click on any of
the LOGOUT buttons in my application.  And while I am
at the welcome page, I can see
http://localhost:8080/NameOfMyApplication/do/Main in
the address bar.  But, if I shut down the server and
restart it, the browser shows a page with all the
images that I defined in the tile (I use tile to show
web pages) and a LOGOUT button.  In the address bar, I
see
http://localhost:8080/NameOfMyApplication/do/Main;jsessionid=49I943J0FJQIQ205058
I must click on that LOGOUT button in order to go to
my welcome page. That is to say, I do not directly get
the welcome page each time the server restarts. 

I must have messed something up and would appreciate
if anybody could help identifying the problem.  

In my web.xml, I have:

  <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>

and this index.jsp (shown below) is in my application
root:

<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<logic:redirect forward="welcome"/>

The mapping in the struts-config.xml is:

     <forward
        name="welcome"
        path="/do/Main"/>

I think the logout part would be more informative. 
The LOGOUT button is in a piece of tile:

<%@ taglib uri="/tags/struts-html" prefix="html" %>
</TABLE>
</TD>
</TR>
<TR><TD><BR></TD></TR>
<TR>
<TD ALIGN=CENTER>
<html:img page="/article/common/images/goldbrush.gif"
border="0" alt="[goldbrush]"/>
</TD>
</TR>
<TR><TD><BR></TD></TR>
<TR>
<TD class="navbar">
<html:link forward="exit">LOGOUT</html:link> 
</TD>
</TR>
</TABLE>

The mapping in the struts-config.xml is:

     <forward
        name="exit"
        path="/do/Logoff"/>

and 

    <action 
        path="/Logoff"
       
type="org.apache.artimus.signoff.LogoffAction">
        <forward
            name="success"
            redirect="true"
            path="/index.jsp"/>
    </action>

The code in the LogoffAction.java is shown below:

// package and import statements are omitted
public final class LogoffAction extends Action {
    public ActionForward execute(ActionMapping
mapping,
         ActionForm form,
         HttpServletRequest request,
         HttpServletResponse response)
            throws IOException, ServletException {

      response.setContentType( "text/html" );
      PrintWriter out = response.getWriter();

      // Extract attributes we will need
      HttpSession session = request.getSession( false
);

      if (session != null) 
      {
         session.invalidate();
      }
      return (mapping.findForward( "success" ));
    }
} // end LogoffAction



__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to