Re: wicket resources with nginx as frontend proxy

2014-05-23 Thread Marco Springer
Hi Martin,

Thank you for the suggestions.

I did manage to get the applications working together.
But... I'm not very sure if, what I am doing, is the correct way.

Therefor I created the minimal quickstart that does what I want it to do.
The quickstart is downloadable from:
http://www.glitchbox.nl/nginx_proxy.zip

It has a deployable war, the nginx.conf, the sources and a README that 
describes what kind of requests the application should intercept.

Let me know if you need more information.

Cheers,
Marco


On Tuesday 20 May 2014 10:18:38 Martin Grigorov wrote:
> Hi,
> 
> On Mon, May 19, 2014 at 11:03 PM, Marco Springer  wrote:
> > Hi all,
> > 
> > I'm trying to get something working that should be fairly easy, I think.
> > 
> > I have Nginx sitting in-front of Jetty.
> > An incoming URL could be: http://rage.glitchbox.nl/param1
> > The proxy should proxy this to: http://localhost:8080/app/param1
> > The webapplication is deployed as root application and is the only
> > application
> 
> You say it is deployed as root app and below we see that WicketFilter
> listens on /*.
> So what is /app in this case ?!
> 
> > in that Jetty instance (or Tomcat if that would've been used)
> > The wicket mount:
> > mountPage("/app/${param}", AppPage.class); (the "param1" is a dynamic
> > value)
> > 
> > The actual generated HTML is fine.
> > No images are loaded, no JS, nor any wicket resource.
> > I've traced this back as to probably being a resource mapping or nginx
> > config
> > problem, but I'd love some confirmation on this.
> > The generated HTML points to the resources as:
> > "../../wicket/resource/etc"
> > Due to the proxy setting, nginx sets this to:
> > "/app/wicket/resource/etc..".
> > Do I need to adjust the nginx configuration to filter on "/wicket/" and
> > sent
> > those requests through directly? Or do I need to do something about how
> > wicket
> > generates the paths for it's requests? No sure how to continue here.
> 
> Requests to /wicket/** should be no different to the other requests.
> But if you want to change the values of these special segments then see
> Application#newMapperContext. This won't help you much IMO.
> 
> > Also, some pages need authentication before they can be accessed, I'm
> > using
> > the wicket auth-roles package for this. But when that's being used,
> > something
> > weird is going on..
> > If I request a page that needs authentication it does redirect me to the
> > proper login page, that's fine (doesn't load the resources, images/css,
> > though).
> > Upon succesful login the browser is redirected to
> > "localhost:8080/app/privilegedpage", instead of
> > "http://rage.glitchbox.nl/privilegedpage";. Which I find very strange, is
> > this
> > also something in nginx that's wrong or wicket behavior?
> 
> it looks to me like not finished *reverse* proxy config.
> Wicket generates only relative urls and will not generate
> http://someHost/unless you explicitly ask for a full url.
> 
> > This login requirement is enforced through this code, which is in a
> > AuthenticatedWebPage implementation:
> > @Override
> > protected void onConfigure() {
> > 
> >   AuthenticatedWebApplication app = (AuthenticatedWebApplication)
> > 
> > Application.get();
> > 
> >   if(!AuthenticatedWebSession.get().isSignedIn()) {
> >   
> > app.restartResponseAtSignInPage();
> >   
> >   }
> > 
> > }
> > 
> > The SignInPage is the default SignInPage in the authroles package.
> > 
> > I've googled around quite a bit for fellow nginx/wicket users. But to no
> > real
> > avail of a solution.
> > Examples:
> > 
> > http://www.mysticcoders.com/blog/how-to-setup-a-wicket-application-with-ng
> > inx-and-jetty/(where I've taken my first attempt from and still seems to
> > give the best result)
> > I've also taken a look at:
> > 
> > https://cwiki.apache.org/confluence/display/WICKET/Wicket+and+localized+UR
> > Ls &
> > http://blog.jteam.nl/2010/02/24/wicket-root-mounts/
> > This for making "http://localhost:8080/app/param1"; into
> > "http://localhost:8080/param1";, for the dynamic root mounts but seemed
> > like a
> > lot of hassle for something relatively easy, an http proxy in-front of
> > jetty.
> > 
> > If anyone can point me into the right direction, that would be great.
> > 
> > The Nginx reverse proxy mapping:
> > location / {
> > 
> >   proxy_pass  http://localhost:8080/app/;
> >   proxy_pass_header   Set-Cookie;
> >   proxy_pass_header   X-Forwarded-For;
> >   proxy_set_headerX-Real-IP $remote_addr;
> >   proxy_pass_header   Host;
> > 
> > }
> > 
> > Wicket web.xml:
> > (only thing noteworthy, as Im not sure this correct?)
> > 
> > 
> >   applicationname
> >   /*
> 
> I think this should be /app/*
> 
> > 
> > 
> > I'm using the WicketFilter, not the WicketServlet approach.
> > 
> > If required, I'll whip up some quickstart tomorrow, not enough time for
> > that
> > now.
> 
> If you don't manage to setup it then please create a quickstart together
> with ngin

Re: Jetty 9 Websocket

2014-05-23 Thread Martin Grigorov
Hi Jan,

The problem is that Jetty 9.1 (and any JSR356 impl) is built with Java 7 so
it cannot be part of Wicket 6.
But maybe it is not such a big problem - Jetty 9.0 is also built with Java
7.
Feel free to file a ticket if you want -javax module to be downported to
Wicket 6.x. It seems it works ...

Martin Grigorov
Wicket Training and Consulting


On Fri, May 23, 2014 at 9:06 PM, Jan Moxter  wrote:

> Hi Martin,
>
> thanks for the input. Using the wicket-native-websocket-javax 7.0.0-M1 in
> conjunction with the 6.15.0 modules and configuring my embeded jetty
> correctly ( :-) ) I got it to work.
>
> jan
>
> - Original Message -
>
> > From: "Martin Grigorov" 
> > To: users@wicket.apache.org
> > Sent: Thursday, May 22, 2014 11:53:13 PM
> > Subject: Re: Jetty 9 Websocket
>
> > Hi,
>
> > Jetty 9.1 implements JSR356 and the recommended way is to use
> > wicket-native-websocket-javax module.
>
> > On May 23, 2014 4:38 AM, "Jan Moxter"  wrote:
> > >
> > > Hallo,
> > >
> > >
> > > right now if you download a jetty server in the version 9 you get
> > > the
> > stable version 9.1.5.v20140505. The API for the websocket
> > implementation
> > did change between 9.0 and 9.1. so that the
> > wicket-native-websocket-jetty9
> > module does not work any more.
> > >
> > >
> > > - are you planning to update the module to work with jetty 9.1 or
> > > do you
> > propose a new module wicket-native-websocket-jetty9.1?
> > > - do you have this on your roadmap?
> > >
> > >
> > > For my own application I already generated my own "
> > wicket-native-websocket-jetty9.1" I could provide the code if wanted
> > >
> > >
> > >
> > >
> > > Thanks
> > >
> > >
> > > Jan
> > >
> > >
>


Re: Jetty 9 Websocket

2014-05-23 Thread Jan Moxter
Hi Martin, 

thanks for the input. Using the wicket-native-websocket-javax 7.0.0-M1 in 
conjunction with the 6.15.0 modules and configuring my embeded jetty correctly 
( :-) ) I got it to work. 

jan 

- Original Message -

> From: "Martin Grigorov" 
> To: users@wicket.apache.org
> Sent: Thursday, May 22, 2014 11:53:13 PM
> Subject: Re: Jetty 9 Websocket

> Hi,

> Jetty 9.1 implements JSR356 and the recommended way is to use
> wicket-native-websocket-javax module.

> On May 23, 2014 4:38 AM, "Jan Moxter"  wrote:
> >
> > Hallo,
> >
> >
> > right now if you download a jetty server in the version 9 you get
> > the
> stable version 9.1.5.v20140505. The API for the websocket
> implementation
> did change between 9.0 and 9.1. so that the
> wicket-native-websocket-jetty9
> module does not work any more.
> >
> >
> > - are you planning to update the module to work with jetty 9.1 or
> > do you
> propose a new module wicket-native-websocket-jetty9.1?
> > - do you have this on your roadmap?
> >
> >
> > For my own application I already generated my own "
> wicket-native-websocket-jetty9.1" I could provide the code if wanted
> >
> >
> >
> >
> > Thanks
> >
> >
> > Jan
> >
> >


Re: How can I display modal dialog only if validation is sucessful?

2014-05-23 Thread Bruce Lombardi
Thanks Francois, 

I've been busy on another task. I'll look at the code soon.

Bruce

Sent from my iPad

> On May 22, 2014, at 5:48 AM, Francois Meillet  
> wrote:
> 
> Hi Bruce,
> 
> This is just one solution :
> Have a look at http://pastebin.com/03DF5pcw
> 
> 
> François Meillet
> Formation Wicket - Développement Wicket
> 
> 
> 
> 
> 
>> Le 21 mai 2014 à 16:15, Bruce Lombardi  a écrit :
>> 
>> Hi,
>> 
>> 
>> 
>> I have a form with several question that a user must answer. If the answers
>> are correct, an email is sent to the user and the user is returned to the
>> login page. That's a bit abrupt for the user and I  would like to provide a
>> simple modal dialog that confirms that the email is sent before sending them
>> to the home page. However, if the answers to the questions are not correct,
>> then a feedback panel must be displayed.
>> 
>> 
>> 
>> I've looked at the approaches to providing a confirmation panel in this link
>> https://cwiki.apache.org/confluence/display/WICKET/Getting+user+confirmation
>> and other places, but I am having a problem with the approach. The
>> JavaScript seems to run as soon as the button is clicked - before onSubmit
>> or onValidate runs on the server. So I can't stop the pop-up from showing
>> if the questions were not answered correctly.
>> 
>> 
>> 
>> Does anyone know a way I can display the modal dialog only after validation
>> has run?
>> 
>> 
>> 
>> Thanks,
>> 
>> 
>> 
>> Bruce
> 

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org