You could do it Jon's route.  Here are a couple other options:

1 - use Apache rules to do the redirect
2 - create a servlet to do it (not sure why you have the aversion to a page
for it, but this is an alternative since it's a single action app

FWIW, I'd probably go with number one.
-- 
Jeremy Thomerson
http://www.wickettraining.com


On Thu, Jan 1, 2009 at 6:50 PM, Jonathan Locke <[email protected]>wrote:

>
>
> isn't this outside the scope of wicket? it sounds like it might be solvable
> with some kind of load balancer, router or DNS resolver...
>
>
> Warren Bell wrote:
> >
> > 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 <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 <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]
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Redirecting-to-external-URL-tp21245727p21246694.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to