0

So I have let's say an application named MyApplication. I deploy it with a virtual server on glassfish and all is well since I set the default welcome page. Let's say the virtual server is to listen on mydomain.com

I goto mydomain.com and i see my index file of my application just fine. Then i go to do a j_security_check login.

And i am then redirected to: http://mydomain.com/MyApplication/page.xhtml

How can I get this to wehre it is: http://mydomain.com/page.xhtml ?

Now if I do take MyApplication out of the URL and try to manually goto that page it is blank, as I believe it is not being processed by JSF.

What I have tried. * Setting the default glassfish application to my application and setting the context path of my application to / (glassfish complains and i cannot deploy my application) * Doing the same as above without setting my context path to / and leaving it as is. Will deploy but same issue.

My main reason for wanting this, is it seems if someone does get redirected to a path without the application name, the session state appears to be different. And causes some sporadic issues with session collision and values not being passed properly. So I either want to force the URLS to use the ApplicationName all the time, OR force them to not use it for the sake of consistancy.

There should be a way to accomplish this since I dont believe we should always have to have the ApplicationName in the URL.

Please help if you can, what I have found by searching seems to take care of it for the initial request but not when doing redirects using the FacesContext extenralContext redirect.

Unless I am not redirecting properly. I am at a loss here.

Thank you for the help.

drankupon
  • 83
  • 6

1 Answers1

0

IMHO you should consider using asap PrettyFaces

Your application URLs will always be elegantly displayed to your users.

Yamada
  • 723
  • 6
  • 23
  • Prettyfaces rewrites request paths, not the context-root. – kolossus Apr 01 '14 at 19:31
  • Exactly. And this is what he wants ... to make the request different than the context root. Using prettyfaces the context is completely hidden for the user. – Yamada Apr 01 '14 at 19:54
  • not 100% I want to strip out the context root, not simply rewrite it. Would i be able to change domain.com/MyApplication/members/test.xhtml into domain.com/members/test.xhtml using prettypfaces? – drankupon Apr 12 '14 at 13:56