Frage

So far I have tried two approaches:
-1. Add to web.xml:

<session-config>
    <tracking-mode>COOKIE</tracking-mode>
</session-config>

-2. Using pretty faces, add to pretty-config.xml:

<rewrite match="(?i)^(.*)#\.\w+(.*)" substitute="$1$2" redirect="301"/>

-3. Jetty specific. Add to web.xml:

<context-param>
    <param-name>org.eclipse.jetty.servlet.SessionIdPathParameterName</param-name>
    <param-value>none</param-value>
</context-param>

Nothing helps. Also I cannot understand, what the difference between "#.{jsessionid}" and "jsessionid={jsessionid}" formats (where {jsessionid} is some hash-looking string )?

edit1:
It looks like fragment-id. What is he doing on all my URLs?

War es hilfreich?

Lösung

This hash is not jsessionid. It is appended by addthis tracking. To disable it use:

<script type="text/javascript">
var addthis_config = {
"data_track_addressbar" : false
};
</script>

I don't know, may be it is better to delete the question, as it's kind of stupid.

Andere Tipps

In addition to what alehro said, //Rewrite [ http://ocpsoft.org/rewrite/ ] is probably a better fit for what you are trying to do by removing the session id from the URL and other such custom tasks. The configuration is much more declarative and powerful, but also a bit more verbose.

Here is how you would do the same thing using //Rewrite.

@Override
public Configuration getConfiguration(final ServletContext context)
{
   return ConfigurationBuilder.begin()
      .addRule()
        .when(Direction.isInbound()
           .and(URL.matches("{p}{sessionID}{s}")
              .where("sessionID").matches("#\\.\\w+"))))
        .perform(Redirect.temporary("{p}{s}"));
}      

URL parameters default to matching .* so additional configuration is not needed for the prefix and suffix (p) and (s).

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top