Skip to main content

JSF, navigation case, redirect, url rewriting

10 replies [Last post]
jiai
Offline
Joined: 2006-09-18
Points: 0

I want to use a navigation case such as

/Page1.jsp

toPage2
/Page2.jsp

If cookies are enabled, everything works fine. The session is preserved. If cookies are disabled in the browser, the session get lost (no jsessionid appended). State preservation for JSF is on default settings.
What can I do to enable url rewriting for such a redirect? Shouldn't this be done by the faces servlet. Perhaps it is a bug?
I need this redirect for authorization purposes within Acegi.
Can anybody give a clarification?

Greetings,
jiai

JavaServer Faces implementation (1.2_02-b03-FCS)
Sun Java System Application Server Platform Edition 9.0_01 (build )

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Jan Luehe

Dominik Dorn wrote:
> > or configure the supported session tracking modes via your
> application's web.xml deployment descriptor.
> How does one do that? I just came up with the listener, as I haven't
> found a way to do it in web.xml

Pick one or a subset of the following tracking-mode elements:


COOKIE URL SSL

Jan

>
>
>
>
> --
> [url=http://www.dominikdorn.com]Dominik Dorn[/url]
>
> Tausche Deine [url=http://www.studyguru.eu] Lernunterlagen auf
> http://www.studyguru.eu[/url]!
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

Jan Luehe

Dominik Dorn wrote:
> Try this:
> http://dominikdorn.com/2010/03/disabling-jsessionid-url-appending-servle...

Thanks, Dominik!

The behaviour you are observing is a side effect of the fix for
https://glassfish.dev.java.net/issues/show_bug.cgi?id=4394 ("server log
message says enableURLRewriting is not supported"):

Earlier GlassFish releases treated cookies and URL rewriting as mutually
exclusive session tracking modes. In fact, all you could do is enable or
disable cookies, which would disable or enable URL rewriting, respectively.

As requested by the user community, and subsequently adopted by the
Servlet 3.0 specification, we added support for enabling or disabling
URL rewriting "in its own right", that is, independently of cookies.

By default, both cookies and URL rewriting are enabled. To disable one
or the other, use a ServletContextListener, as in Dominik's example, or
configure the supported session tracking modes via your application's
web.xml deployment descriptor.

Jan

>
> [Message sent by forum member 'hotngui']
>
> http://forums.java.net/jive/thread.jspa?messageID=392025
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
>
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>
>
>
>
>
> --
> [url=http://www.dominikdorn.com]Dominik Dorn[/url]
>
> Tausche Deine [url=http://www.studyguru.eu] Lernunterlagen auf
> http://www.studyguru.eu[/url]!
>

[att1.html]

Dominik Dorn

> or configure the supported session tracking modes via your application's
web.xml deployment descriptor.
How does one do that? I just came up with the listener, as I haven't found a
way to do it in web.xml

--
[url=http://www.dominikdorn.com]Dominik Dorn[/url]

Tausche Deine [url=http://www.studyguru.eu] Lernunterlagen auf
http://www.studyguru.eu[/url]!
[att1.html]

healeyb
Offline
Joined: 2010-01-26
Points: 0

Note that in JSF 2.0 you can say:

to include view parameters.

hotngui
Offline
Joined: 2006-03-14
Points: 0

I'll check it out to see if it does the trick. Thanks!

hotngui
Offline
Joined: 2006-03-14
Points: 0

I am seeing this problem with GlassFish v3.

If i remove my "" entries I get the jsessionid appended to my URLs as expected when using a browser with cookies turned off, so I know the issue is related to the use of "" in my navigation. I do really need to use "" so I need to figure out why its not working in v3.

Anyboday got any clues?
joey

Dominik Dorn

Try this:
http://dominikdorn.com/2010/03/disabling-jsessionid-url-appending-servle...

On Mon, Mar 15, 2010 at 10:47 PM, wrote:

> I am seeing this problem with GlassFish v3.
>
> If i remove my "" entries I get the jsessionid appended to my
> URLs as expected when using a browser with cookies turned off, so I know the
> issue is related to the use of "" in my navigation. I do really
> need to use "" so I need to figure out why its not working in v3.
>
> Anyboday got any clues?
> joey
> [Message sent by forum member 'hotngui' (joey@hotngui.com)]
>
> http://forums.java.net/jive/thread.jspa?messageID=392025
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>
>

--
[url=http://www.dominikdorn.com]Dominik Dorn[/url]

Tausche Deine [url=http://www.studyguru.eu] Lernunterlagen auf
http://www.studyguru.eu[/url]!
[att1.html]

hotngui
Offline
Joined: 2006-03-14
Points: 0

My problem is looking like it is related to JSF 2.0 as when I force v3 to use JSF 1.2 which i bundle with my application I do not see the problem.

Any known problems with JSF 2.0 as it pertains to the element in the faces-config.xml file?

Joey

Ryan Lubke

glassfish@javadesktop.org wrote:
> I want to use a navigation case such as
>
>
> /Page1.jsp
>
> toPage2
> /Page2.jsp
> [b][/b]
>

>

>
> If cookies are enabled, everything works fine. The session is preserved. If cookies are disabled in the browser, the session get lost (no jsessionid appended). State preservation for JSF is on default settings.
> What can I do to enable url rewriting for such a redirect? Shouldn't this be done by the faces servlet. Perhaps it is a bug?
> I need this redirect for authorization purposes within Acegi.
> Can anybody give a clarification?
>
This looks like:
https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=413,
which was fixed in 1.2_03. You can download an updater [1] that will
upgrade
JSF within your existing GlassFish installation if you wish to leverage
the new version.

[1]
https://javaserverfaces.dev.java.net/servlets/ProjectDocumentList?folder...
> Greetings,
> jiai
>
> JavaServer Faces implementation (1.2_02-b03-FCS)
> Sun Java System Application Server Platform Edition 9.0_01 (build )
> [Message sent by forum member 'jiai' (jiai)]
>
> http://forums.java.net/jive/thread.jspa?messageID=203845
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

jiai
Offline
Joined: 2006-09-18
Points: 0

Thanks for your help! That was the issue.

Unfortunately, I can't upgrade to JSF 1.2_03 due to Netbeans VisualWeb 5.5 extension - which has a bug with in its webuijsf-tagblib (as decribed in http://forums.java.net/jive/thread.jspa?threadID=21395&tstart=0 ).

The workaround for me is to enable cookies during development the next weeks and to upgrade VisualWeb when an update is available

Greetings,
jiai

Added thread URL

Message was edited by: jiai

Message was edited by: jiai