Re: IP Authentication
On Wed, Apr 11, 2018 at 7:53 PM, Lon Varscsak wrote: > Perfect, this is what I was looking for. So if I wanted to hijack the > whole response (for other purposes), I would do the same thing, but with a > custom request handler? > Yes! > > On Tue, Apr 10, 2018 at 11:24 PM, Martin Grigorov > wrote: > > > Hi, > > > > On Tue, Apr 10, 2018 at 11:49 PM, Lon Varscsak > > wrote: > > > > > I have a need to build some apps (or mount points) to check if the > source > > > is coming from an internal IP and if not, present the user with an > > > "unauthorized" request. I know how to check client IP and what not, > but > > > I'm not sure how to generate programmatically a simple WebResponse that > > is > > > just some text with a status code. > > > > > > 1) I'm currently using IRequestCycleListener to listen and then hijack > > the > > > response. Not sure if this is the appropriate place. > > > > > > > This is the Wicket way. > > You can also use plain Servlet Filter to do it even before Wicket has a > > chance to see the request. > > > > > > > 2) How do you programmatically generate a response without implementing > > all > > > the methods of WebResponse. At the point that the > IRequestCycleListener > > > the response that is in the cycle already has content. Basically I > want > > to > > > throw that away and return "Unauthorized"/401. > > > > > > > requestCycle.replaceAllRequestHandlers(new ErrorCodeRequestHandler(401, > > "Unauthorized")) > > > > > > > > > > Any thoughts or suggestions? > > > > > > Thanks! > > > > > > Lon > > > > > >
Re: IP Authentication
Perfect, this is what I was looking for. So if I wanted to hijack the whole response (for other purposes), I would do the same thing, but with a custom request handler? On Tue, Apr 10, 2018 at 11:24 PM, Martin Grigorov wrote: > Hi, > > On Tue, Apr 10, 2018 at 11:49 PM, Lon Varscsak > wrote: > > > I have a need to build some apps (or mount points) to check if the source > > is coming from an internal IP and if not, present the user with an > > "unauthorized" request. I know how to check client IP and what not, but > > I'm not sure how to generate programmatically a simple WebResponse that > is > > just some text with a status code. > > > > 1) I'm currently using IRequestCycleListener to listen and then hijack > the > > response. Not sure if this is the appropriate place. > > > > This is the Wicket way. > You can also use plain Servlet Filter to do it even before Wicket has a > chance to see the request. > > > > 2) How do you programmatically generate a response without implementing > all > > the methods of WebResponse. At the point that the IRequestCycleListener > > the response that is in the cycle already has content. Basically I want > to > > throw that away and return "Unauthorized"/401. > > > > requestCycle.replaceAllRequestHandlers(new ErrorCodeRequestHandler(401, > "Unauthorized")) > > > > > > Any thoughts or suggestions? > > > > Thanks! > > > > Lon > > >
Yes :-) [ Re: Any usable IntelliJ plugin ?]
Hey Lukas, Hi Tobias, WicketForge 5.0.2 works for me with IntelliJ 2018.1. Make sure that you configure your wicket resources in „Project Structure > Facets“. This was the step I missed! Thanks a lot, Tobias Regards Lukas On Wed, Apr 11, 2018 at 3:07 PM Tobias Gierke < tobias.gie...@code-sourcery.de> wrote: Hi, I'm in the process of migrating from Eclipse to IntelliJ and just found out that the IntelliJ WicketForge plugin is not working for the current release of IntelliJ (Ultimate 2018.1). I really miss the QWickie plugin I was using in Eclipse. Does anyone know of a good way to get at least HTML -> Java code navigation using the wicket:id attributes working ? Or do I really have to use full-text search again? Thanks, Tobias - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Any usable IntelliJ plugin ?
I'm using an IntelliJ plugin. Not sure what it's called but check the one with the most downloads :) It connects the html with the code just fine. For the properties files, if you're using non-English characters, you need to enable transparent translation in Settings. On Wed, Apr 11, 2018, 15:07 Tobias Gierke wrote: > Hi, > > I'm in the process of migrating from Eclipse to IntelliJ and just found > out that the IntelliJ WicketForge plugin is not working for the current > release of IntelliJ (Ultimate 2018.1). I really miss the QWickie plugin > I was using in Eclipse. Does anyone know of a good way to get at least > HTML -> Java code navigation using the wicket:id attributes working ? Or > do I really have to use full-text search again? > > Thanks, > Tobias > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
Re: Any usable IntelliJ plugin ?
Hi Tobias, WicketForge 5.0.2 works for me with IntelliJ 2018.1. Make sure that you configure your wicket resources in „Project Structure > Facets“. Regards Lukas On Wed, Apr 11, 2018 at 3:07 PM Tobias Gierke < tobias.gie...@code-sourcery.de> wrote: > Hi, > > I'm in the process of migrating from Eclipse to IntelliJ and just found > out that the IntelliJ WicketForge plugin is not working for the current > release of IntelliJ (Ultimate 2018.1). I really miss the QWickie plugin > I was using in Eclipse. Does anyone know of a good way to get at least > HTML -> Java code navigation using the wicket:id attributes working ? Or > do I really have to use full-text search again? > > Thanks, > Tobias > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
Any usable IntelliJ plugin ?
Hi, I'm in the process of migrating from Eclipse to IntelliJ and just found out that the IntelliJ WicketForge plugin is not working for the current release of IntelliJ (Ultimate 2018.1). I really miss the QWickie plugin I was using in Eclipse. Does anyone know of a good way to get at least HTML -> Java code navigation using the wicket:id attributes working ? Or do I really have to use full-text search again? Thanks, Tobias - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: @SpringBean inside WebSession
Guys, thanks a lot for replies. @Kamil: "For us, without this code, @SpringBean didn't work in session. Maybe it's a bug" It's not a bug, @SpringBean annotation works only in components. When not running inside component, like in WebSession, you have to Inject manually via Injector. This is normal behaviour. We do have newSession overriden in WebApplication, similary like you do, including Injector call. To me this looks like a more problem in the Weblogic env. Perhaps different classloader is used for serialization test...I just wanted to check Wicket forum if anybody else has been facing something like that. -- Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: manual resolving of path
Hi, This is actually relatively simple! Steps: - Create a mapper for this which extends AbstractMapper - Return a compatibility score which is higher than other mappers if you want to override them (e.g. return Integer.MAX_VALUE) - Implement mapRequest() to resolve the url to a RenderPageRequestHandler - Implement mapHandler() to resolve a handler for your target page class to a url (e.g. check for IPageClassRequestHandler and use provided page parameters to build url) - Mount your custom mapper in your application’s init() method Done! Met vriendelijke groet, Kind regards, Bas Gooren Op 11 april 2018 bij 09:47:16, Korbinian Bachl ( korbinian.ba...@whiskyworld.de) schreef: Hi, where would I need to look at if I wanted to resolve the path from the root of the webapplication inside a wicket application root? e.g.: domain.com <- has wicket app on ROOT deployed domain.com/foo <- path mapped to foo-webpage domain.com/foo/bar <- I now want to get the request not resolved by foo-webpage but by my own custom resolver-webpage but I cant map this as usual as the mapping comes from a DB and can change anytime domain.com/bar2 <- I also want to hijack this one temporary even we have a page mounted to /bar2 Any idea how I might "hijack" the request and resolve it to another page? Best, KB - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
manual resolving of path
Hi, where would I need to look at if I wanted to resolve the path from the root of the webapplication inside a wicket application root? e.g.: domain.com <- has wicket app on ROOT deployed domain.com/foo <- path mapped to foo-webpage domain.com/foo/bar <- I now want to get the request not resolved by foo-webpage but by my own custom resolver-webpage but I cant map this as usual as the mapping comes from a DB and can change anytime domain.com/bar2 <- I also want to hijack this one temporary even we have a page mounted to /bar2 Any idea how I might "hijack" the request and resolve it to another page? Best, KB - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: IP Authentication
Hi Lon! What about using the container features for this? If you are using Tomcat you could add a RemoteAdressValve (https://tomcat.apache.org/tomcat-8.5-doc/config/valve.html#Remote_Address_Valve). Example: The allow attribute needs a regular expression with the ip adresses from your whitelist. In the example only requests from localhost are accepted. Regards, Thomas -Ursprüngliche Nachricht- Von: Lon Varscsak [mailto:lon.varsc...@gmail.com] Gesendet: Dienstag, 10. April 2018 22:49 An: users@wicket.apache.org Betreff: IP Authentication I have a need to build some apps (or mount points) to check if the source is coming from an internal IP and if not, present the user with an "unauthorized" request. I know how to check client IP and what not, but I'm not sure how to generate programmatically a simple WebResponse that is just some text with a status code. 1) I'm currently using IRequestCycleListener to listen and then hijack the response. Not sure if this is the appropriate place. 2) How do you programmatically generate a response without implementing all the methods of WebResponse. At the point that the IRequestCycleListener the response that is in the cycle already has content. Basically I want to throw that away and return "Unauthorized"/401. Any thoughts or suggestions? Thanks! Lon - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org