When I logout, Turbine overwrites the user password.
(This is a problem since, in this particular app, the User Management is
done with an app external to Turbine)
Looking at the code executed in logout (DBUserManager):
public void store(User user)
throws UnknownEntityException, DataBackendException
{
if(!accountExists(user))
{
throw new UnknownEntityException("The account '" +
user.getUserName() + "' does not exist");
}
Criteria criteria = TurbineUserPeer.buildCriteria(user);
<===========================
try
{
TurbineUserPeer.doUpdate(criteria);
}
catch(Exception e)
{
throw new DataBackendException("Failed to save user object",
e);
}
}
It appears that Turbine will write over *all* fields, regardless of
whether they are dirty or not.
Is this the desired approach, or a bug?
Do Peers support automatic updating of only the columns that have been
modified.
If so, how do you construct a Criteria to update for only the dirty
columns?
Thanks,
David
> -----Original Message-----
> From: Peter Lynch [mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 22, 2002 10:03 AM
> To: Turbine Users List
> Subject: Re: How to avoid browser cache
>
>
> Christian,
>
> In Turbine 3.0 Code there is a method that is called
> setCacheHeaders in the Turbine.java file. Useful, however it
> has a bug where it adds milliseconds to seconds. So here is a
> fixed method that you could add somewhere and call depending
> on what you wanted to cache.
>
> /**
> * This method sets the required expiration headers in
> the response
> * for a given RunData object. This method attempts to set all
> * relevant headers, both for HTTP 1.0 and HTTP 1.1.
> *
> * @param data The RunData object we are setting cache
> information for.
> * @param expiry The number of seconds until the document
> should expire,
> * <code>0</code> indicating immediate expiration (i.e.
> no caching).
> */
> public static void setCacheHeaders(RunData data, int expiry)
> {
> if ( expiry == 0 )
> {
> data.getResponse().setHeader("Pragma", "no-cache");
> data.getResponse().setHeader("Cache-Control", "no-cache");
> data.getResponse().setHeader(
> "Expires", HttpUtils.formatHttpDate(new Date()));
> }
> else
> {
> /*
> * Convert to long to handle large milliseconds
> */
> long lExpiry = new Integer(expiry).longValue();
> lExpiry = lExpiry * 1000;
> Date expiryDate = new Date(
> System.currentTimeMillis() + lExpiry );
> data.getResponse()
> .setHeader("Expires",
> HttpUtils.formatHttpDate(expiryDate));
> data.getResponse().setHeader("Pragma", "max-age=" + expiry);
> data.getResponse().setHeader("Cache-Control",
> "max-age=" + expiry);
> }
> }
>
> Alternativly this can be written to accept a long in the
> first place for expiry I guess.
>
> -Peter
>
>
> ----- Original Message -----
> From: "Heiko Braun" <[EMAIL PROTECTED]>
> To: "Turbine Users List" <[EMAIL PROTECTED]>
> Sent: Friday, February 22, 2002 6:29 AM
> Subject: Re: How to avoid browser cache
>
>
> > take a look here:
> >
> >
> http://www.mail-archive.com/turbine-user%40jakarta.apache.org/
> msg02623.html
> >
> > /heiko
> >
> > Am Fre, 2002-02-22 um 13.13 schrieb Christian Asmussen:
> > > I've had a problem with some browsers like opera and IE for the
> > > example app created by turbine 2.1. I clicked on the
> "Home" link of
> > > the menu
> and
> > > was not logged in, so the Login screen apears. After login in, I
> > > tryied the same link again, but the browser had cached a copy of
> > > login, so I
> was
> > > redirected to the login screen again. Of course, by
> clicking on the
> > > reload button the problem was solved. The thing is a
> regular user
> > > won't do that. How can I avoid these caches? Should I set an
> > > expires now for every page?
> > >
> > > --
> > > "If we did all the things we are capable of,
> > > we would literally astound ourselves"
> > > - Thomas Edison
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> > > For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> > >
> > --
> > .-
> >
> > Heiko Braun <[EMAIL PROTECTED]>
> > Software Entwicklung
> >
> > Fon: 0172 / 871 95 20
> >
> >
> > --
> > To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> >
>
>
> --
> To unsubscribe, e-mail:
> <mailto:turbine-user-> [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]>