Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem in displaying correct url

 
Kumar Gaurav
Ranch Hand
Posts: 108
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17625
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
Pie
Posts: 17625
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks
 
Rahul Juneja
Ranch Hand
Posts: 425
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Rahul,

Thanks for your reply. I implemented my own phaseListener still problem is persisting
 
Mahendra Pratap
Ranch Hand
Posts: 42
Eclipse IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks mahendra
 
Rahul Juneja
Ranch Hand
Posts: 425
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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 agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic