myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Georg Füchsle <giofy...@googlemail.com>
Subject Re: getting information about caller-url
Date Mon, 13 Jul 2009 12:07:57 GMT
Hallo Rene!

Thanks for your fast answer.

This does not seem to fit to my problem:

I tried to start my app from a static html-file. in this static
html-file I put a static link to my application like:

<a href="http://localhost/myapp/start.jsf">start</a>

Then I examine the external context in a PhaseListener before the
RestoreView-Phase:

	public void beforePhase(PhaseEvent event)
	{
		
		if(event.getPhaseId() == PhaseId.RESTORE_VIEW)
		{	
			ExternalContext extCtx = event.getFacesContext().getExternalContext();
			String callerUrl = extCtx.getRequestPathInfo(); //== null
			callerUrl = extCtx.getRequestServletPath(); // ==url of the
actually called ressource ( inside my application)
			callerUrl = extCtx.getRequestContextPath(); // == context Root of
my application

		}

What I hoped to read is the URL of the static html-pagse from where I
clicked the link to my application.

Have You an idea how to get this information?



Thanks Georg


2009/7/13 Rene van Wijk <rwijk@transfer-solutions.com>:
>
>  All the request information is contained in the ExternalContext which can
> be accessed as: FacesContext.getCurrentInstance().getExternalContext();
>
>
>
> It contains methods such as getRequestContextPath.
>
> -----Original message-----
> From: Georg Füchsle <giofyxle@googlemail.com>
> Sent: Mon 13-07-2009 11:36
> To: MyFaces Discussion <users@myfaces.apache.org>;
> Subject: getting information about caller-url
>
> hallo,
>
> when starting my application I have to distinguish between the
> different sites from where the user can call the application.
>
> Theese urls are outside application.
>
> Can somebody give me a hint how i can read the url from where the
> user is calling?
>
> Thanks Georg
>
>

Mime
View raw message