In fact, the value in the session is ok, but it seems that the proxy is
caching a lot, because the url inn the browser is the Action servlet name
instead of JSP page, so the url /Online/TenancySchedule.do is always the
same and the Actionforward to the jsp is transparent. How can I force the
proxy to regenerate the jsp page, here is my code

public class SelectSiteAction extends org.apache.struts.action.Action {

    /** Creates new LogonAction */
    public SelectSiteAction() {
    }

    public org.apache.struts.action.ActionForward
perform(org.apache.struts.action.ActionMapping mapping,
org.apache.struts.action.ActionForm form,
javax.servlet.http.HttpServletRequest request ,
javax.servlet.http.HttpServletResponse response) throws java.io.IOException,
javax.servlet.ServletException {
        // Extract attributes we will need
        Locale locale = getLocale(request);
        MessageResources messages = getResources();

        // Validate the request parameters specified by the user
        HttpSession session = request.getSession();
        ActionErrors errors = new ActionErrors();
        System.out.println("SelectSiteAction [Start]");

        String strCellIDParam = request.getParameter("CellID");
        System.out.println("CellID received in URL " + strCellIDParam);

        // Report any errors we have discovered back to the original form

        // Is there a currently logged on user?
        reqReoUser reoUser = (reqReoUser) session.getAttribute("User");
        if (reoUser  == null) {
            if (servlet.getDebug() >= 1)
                servlet.log(" User is not logged on in session "
                            + session.getId());
            return (servlet.findForward("logon"));
        }
        // Get Datasource configured from struts-config.xml

        DataSource dataSource = (DataSource)
servlet.getServletContext().getAttribute(Action.DATA_SOURCE_KEY);
        java.sql.Connection conn = null;
        try
        {
            // Get a connection to database from the Generic Pool
            conn = dataSource.getConnection();
            // Put a session value specifying the Site ID on which every
report will work
             if (session.getAttribute("Site") != null)
                session.removeAttribute("Site");
            session.setAttribute("Site", strCellIDParam);
            System.out.println("Site session value");
            System.out.println(session.getAttribute("Site"));
            // Put a request attribute with record of the Site
            if (session.getAttribute("SiteCard") != null)
                session.removeAttribute("SiteCard");

            session.setAttribute("SiteCard", reqSiteCard.findByCellID(conn,
Integer.parseInt(strCellIDParam)));

            DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT,
locale);
            session.setAttribute("Today", df.format(new Date()));

        }
        catch (SQLException sqle)
        {
//            servlet.log(sqle);
            sqle.printStackTrace();
            session.setAttribute("SQLError", sqle);
            return (mapping.findForward("failure"));
        }
        finally
        {
            try
            {
                conn.close();
            }
            catch (SQLException sqle)
            {
                System.out.println(sqle);
            }
            conn = null;

        }

        System.out.println("SelectSiteAction [End]");
        return (mapping.findForward("ShowCard"));
        // Forward control to the specified success URI
    }

}

-----Original Message-----
From: Max Cooper [mailto:[EMAIL PROTECTED]]
Sent: mardi 12 f�vrier 2002 11:19
To: Struts Users Mailing List
Subject: Re: page do not refresh


Fr�d�ric,

If the query string is different between the two requests, it is not likely
to be a page caching problem. The query string is part of the URL, so things
that cache pages by URL will see the two requests as two different URLs.

Try using the request scope, rather than the session scope, for passing the
object from your Action to the JSP page. This is preferable unless you need
to keep the value in the session for some other reason. However, if it does
need to be in the session, it doesn't seem like the action is replacing the
value in the session and needs further review (perhaps you could post the
code that puts/gets the value in the session).

-Max

----- Original Message -----
From: "Fr�d�ric Houbie - ABSIS-GROUP" <[EMAIL PROTECTED]>
To: "Struts-User" <[EMAIL PROTECTED]>
Sent: Tuesday, February 12, 2002 1:34 AM
Subject: page do not refresh


> Hi,
>
> I have a problem in my struts application, I have a page that call an
action
> servlet which store a value received in url  in session, than forward to a
> jsp page. If I this action servlet is called with another value in url,
the
> jsp page do not change, it seems to come from the proxy. I put expire meta
> tag in jsp, but no changes, the url in the adress bar is always the .do
> action. Does it means that I must make the action servlet expire ?
>
> I don't understand the process,
>
> thanks for help
>
> Fr�d�ric houbie
>
>
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>
>


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



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

Reply via email to