Brad:

I looked at the API and noticed the RequestProcessor is a 1.1 feature.. Your
solution seems nice and clear!  I only have one question for you though: How
do you "connect" the subclass of RequestProcessor that you wrote with the
struts ActionServlet..?  Do you have to subclass the ACtionServlet too and
then join the dots there? How do you do that?   There is a " processor" method
in ActionServlet which returns the processor..but I don't see a setProcessor
method..?

thanks for posting your solution: I learnt something new today..:)
Geeta

Brad Balmer wrote:

> Well, I searched through the archives with no luck on
> 'ParameterActionForward' or similar.  I ended up trying to ovveride the
> ActionForward class but couldn't get it to work well.  Then I noticed in
> the RequestProcessor there is a doForward() that can be ovveridden.  I
> wrote the following and it seems to work.
>
> Is there a better way/place to do this than the RequestProcessor?  This
> seems like a prettly locical/central place to do this.
>
>     protected void doForward(
>         String path,
>         HttpServletRequest request,
>         HttpServletResponse response)
>         throws IOException, ServletException {
>         super.doForward(addUniqueParameterToURL(path), request, response);
>     }
>
>     private String addUniqueParameterToURL(String url) {
>         if(url == null) {
>             return url;
>         }
>         String newURL =  url
>             + ((url.indexOf("?") == -1) ? "?" : "&")
>             + "uid"
>             + "="
>             + Long.toString(System.currentTimeMillis());
>         return newURL;
>     }
>
> Curtis Taylor wrote:
>
> > Hi Brad,
> >
> > Someone on this list (sorry; can't remember who) subclassed
> > ActionForward to do exactly this. Search the archives for
> > ParameterActionForward.
> >
> > If you can't find it, email me off-list & I'll send you the Java file
> > (I have it stashed away somewhere.
> >
> > Curtis
> > --
> > c dot tee at verizon dot net
> >
> > Brad Balmer wrote:
> >
> >> I've been looking into this for a while and can't figure out how to
> >> do this easily.
> >>
> >> I would like to append a unique number to each request in an attempt
> >> to defeat caching (setting all the normal META tags as well as the
> >> 'nocache' in the controller doesn't seem to ALWAYS work).
> >>
> >> Therefore I wanted to append a Parameter to each request and add a
> >> unique number so that the server would not look in the cache. (Having
> >> the user change their browser caching mechanism isn't an option).
> >>
> >> I see where I can SEE the different request parameters, but where can
> >> I append a new parameter?  I would like to do this in a central
> >> location.
> >>
> >> Any ideas?  Has anybody else come up with a good way of doing this?
> >>
> >> Thanks.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


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

Reply via email to