• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

problem in displaying correct url

 
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

i am developing a web application using RichFaces and trinidad in JSF. I am facing a strange issue. After successful login when user moves to any of the page in address bar of browser , correct url is not getting displayed.
But if user refreshes the page then correct url appears..

Any pointer how to correct it.
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This isn't due to RichFaces, Trinidad, or even whatever security system you may have cobbled in. JSF URLs are more like web conversation "handles" than absolute resource locators. This is simply how JSF works.
 
Kumar Gaurav
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Thanks for your reply.. Do you mean to say this problem will remain as is??
Or any thning can be done in this regard to correct it??
 
Tim Holloway
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The architects of JSF don't really consider that a "problem". There are some things planned for JSF 2.0 to allow for bookmarkable URLs and stuff like that, but I doubt that they're going to completely eliminate the issue.

You can use PrettyFaces to make URLs bookmarkable.
 
Kumar Gaurav
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks
 
Ranch Hand
Posts: 425
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Or you can code your own phaselistener and convert post to get by copying all paramaters and redirecting it in turn.

Thanks,
Rahul
 
Kumar Gaurav
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Rahul,

Thanks for your reply. I implemented my own phaseListener still problem is persisting
 
Ranch Hand
Posts: 42
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Kumar,

I think if you usebefore the closing navigation-case tag in your faces-config.xml then the displayed url will be correct.
 
Kumar Gaurav
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks mahendra
 
Rahul Juneja
Ranch Hand
Posts: 425
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Kumar Gaurav wrote:Hi Rahul,

Thanks for your reply. I implemented my own phaseListener still problem is persisting



Gaurav,

Paste your code for phaselistener here and we might be able to assist you better.

Thanks,
Rahul
 
Kumar Gaurav
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Rahul,

Find below my Phaselisenter:

package com.infy.iRecon.core;

import javax.faces.context.FacesContext;
import javax.faces.event.PhaseEvent;
import javax.faces.event.PhaseId;
import javax.faces.event.PhaseListener;

public class IreconPhaseListener implements PhaseListener{

private static String cphase = null;
@Override
public void afterPhase(PhaseEvent phe) {

System.out.println("After---->"+ phe.getPhaseId());
}

@Override
public void beforePhase(PhaseEvent phe) {

System.out.println("Before---->"+ phe.getPhaseId());
}

@Override
public PhaseId getPhaseId() {

PhaseId phaseId = PhaseId.ANY_PHASE;
if (cphase == null) {

FacesContext context = FacesContext.getCurrentInstance();
if (context == null)

return phaseId;

cphase = (String)context.getExternalContext().getInitParameter("PHASE_PARAM");

if (cphase != null) {

if ("RESTORE_VIEW".equals(cphase)) {

phaseId = phaseId.RESTORE_VIEW;
} else if ("APPLY_REQUEST_VALUES".equals(cphase)) {

phaseId = phaseId.APPLY_REQUEST_VALUES;
} else if ("PROCESS_VALIDATIONS".equals(cphase)) {

phaseId = phaseId.PROCESS_VALIDATIONS;
} else if ("UPDATE_MODEL_VALUES".equals(cphase)) {

phaseId = phaseId.UPDATE_MODEL_VALUES;
} else if ("INVOKE_APPLICATION".equals(cphase)) {

phaseId = phaseId.INVOKE_APPLICATION;
} else if ("RENDER_RESPONSE".equals(cphase)) {

phaseId = phaseId.RENDER_RESPONSE;
} else {

phaseId = phaseId.ANY_PHASE;
}
}
}
return phaseId;
}

}
 
"I know this defies the law of gravity... but I never studied law." -B. Bunny Defiant tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic