I need to explain myself a little better. This is the situation, I have several locations that are on different subnets. They are all connected with a VPN. Each subnet has its own server running this wicket app. The app clients are running on mobile scanning PDAs. These PDAs get moved between each subnet. The PDAs need to know what server to access the app at. One of the subnets has a Headquarters server. How I see this working is that each PDA would access the HQ server and then be redirected to its subnet server. For instance the PDA client would have its browsers home page set to the HQs url:

http://HQserverIP/redirectPDA

The HQ server would then redirect to the PDAs local server based on the ip address the response came from:

http://LocalserverIP/login

I did not want to create a page on the HQ server just so that it could be redirected thinking there could be some issues doing that. I was going to do this redirecting in a separate servlet, but I wanted to keep it all in one app. I saw the RedirectToExternalException solution thinking that this could be used.

Jonathan Locke wrote:
try:

RequestCycle.get().setRequestTarget(new RedirectRequestTarget(url));


Warren Bell wrote:
I need to redirect to an external page. I saw this solution, but was not
sure how to use it. Where does this exception get thrown? I do not want
to instantiate some kind of dummy page.

public class RedirectToExternalException extends
AbstractRestartResponseException
{
private static final long serialVersionUID = 1L;

public RedirectToExternalException(String url)
{

RequestCycle rc = RequestCycle.get();
if (rc == null)
{
throw new IllegalStateException(
"This exception can only be
thrown from within request processing cycle");
}
else
{
Response r = rc.getResponse();
if (!(r instanceof WebResponse))
{
throw new IllegalStateException(
"This exception can
only be thrown when wicket is processing an
http request");
}

// abort any further response processing
rc.setRequestTarget(new
RedirectRequestTarget(url));
}
}
}

Thanks,

Warren

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]






--
Thanks,

Warren Bell
909-645-8864
[email protected]

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to