Re: Wicket in other application
Hello Alis, the Wicket programming model is based on the typical web application request scenario - one thread typically processes one HTTP request using the org.apache.wicket.protocol.http.WicketFilter. This filter sets the application context using a thread-local, many wicket internals and also analogous many wicket applications use this thread-local over a static method by Application.get(). For the case that code for different application instances or even outside of the WicketFilter contexts request must be executed, you can use the following template. It works similar to the WicketFilter. public ApplicationContextTemplate(Application application) { final ThreadContext previousThreadContext = ThreadContext.detach(); try { ThreadContext.setApplication(application); execute(); } finally { ThreadContext.restore(previousThreadContext); } } protected abstract void execute(); Best regards, Jan On 05/16/2013 04:04 PM, Richard W. Adams wrote: What do you mean by unify? Do you want to merge them into a single application with only one code base? Or do you mean something else? If you intend to keep them as two separate applications, there are number of techniques for inter-process communication. From: Alis ajcalve...@yahoo.es To: users@wicket.apache.org Date: 05/16/2013 08:55 AM Subject:Wicket in other application Hello! Currently, I have two applications: one wicket and one in struts jsp. Both need to interact. I keep the same HttpServletRequest and HttpSession in both apliacaiones. The solution I thought is to unify the wicket application in another application. How do I? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-in-other-application-tp4658859.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. ** - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Scheme-less URLs vs. UrlRenderer
Hello, I would like to introduce a similar pattern as fifty-five's SimpleCDN ( http://blog.55minutes.com/2012/01/simplecdn-and-the-newly-released-fiftyfive-wicket-32/). Thereby I stumbled across the same obstacle as mbrictson: Wicket does not understand scheme-less URLs that start with //. Fixing this would require enhancements to Wicket'sUrl, UrlRenderer, and perhaps other classes. You can find a closer description here: https://github.com/55minutes/fiftyfive-wicket/issues/35 Is there any advice in how to handle such relatives URLs using wicket-1.5.x? Regards, Jan
AW: Serving wicket JS from CDN?
Hello Chris, I'm not sure, if i've got the point - you want to extract your own JS/CSS to a cdn? I've already used a similar implementation to this: http://techblog.molindo.at/2011/03/serving-wicket-resources-from-cdn.html Regards, Jan Von: Chris Colman [chr...@stepaheadsoftware.com] Gesendet: Dienstag, 2. April 2013 19:27 An: users@wicket.apache.org Betreff: Serving wicket JS from CDN? Is anyone thinking about serving JS required by wicket (eg., jquery etc) from a CDN? If we started serving commonly used JS used by wicket from a central CDN then more and more browsers visiting Wicket based sites would be starting to cache JS used commonly across the ‘Wicketsphere’ so further visits to other websites in the wicketsphere would require no download. Caching of these common, static resources would reduce the bandwidth usage/traffic on the webservers hosting wicket sites. Yours sincerely, Chris Colman Pagebloom Team Leader, Step Ahead Software [cid:image001.gif@01CE3023.7F5E5400] pagebloom - your business your website growing together Sydney: (+61 2) 9656 1278 Canberra: (+61 2) 6100 2120 Email: chr...@stepahead.com.aumailto://chr...@stepahead.com.au Website: http://www.pagebloom.comblocked::http://www.pagebloom.com/ http://develop.stepaheadsoftware.comblocked::http://develop.stepaheadsoftware.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: The best way for designers and Wicket developers to collaborate
Hej Eugene, In practice the wicket frontend development is interrupted by frequent small changes to the HTML, Javascript or CSS. Changes to these markups are very expensive because they effort a new software release followed by a software rollout. This depends on the fact, that the markup is delivered with the web application. We separate the markup and the corresponding java code physically during development, and unites both parts during runtime. Thus it is possible to release and deploy markup out of the software life cycle. The markup-dev environment consists of a unix/windows system (which is not the developers local system!!!) with a running wicket application and a mounted WebDav. The WebDav mirrors the subversion/git and is used as template base path for the wicket application. Within the markup-dev environment, every modification to the markup is visible after a page reload. Deployments to the dev system are triggered via a jenkins job. However, developing markup directly on a customer-frontend and not with static dummies reduces the time-to-failure to a minimum and requires no further handover to the software development. In the past, there was a similar question, perhaps this could help you: http://apache-wicket.1842946.n4.nabble.com/Syncing-files-with-designers-td4654450.html best regards, Jan On 02/20/2013 11:14 AM, manuelbarzi wrote: It's a lot of effort to restart the server to test every tweak; also, they're not familiar with the intricacies of our IDE and server. It's a lot more productive for them to have a direct set of files they can test in IE, which is how they've been working all along.
Re: Syncing files with designers
Hello Edgar, I think I'm missing something: since every WebPage in wicket has straight access to resources located in the web root (that is, every path reference in the page's markup is relative to the web root) Wicket is able to locate resources outside of the web application: This could be done by implementing an own IResourceFinder: public final class FileSystemResourceFinder implements IResourceFinder { private final Resource resource; public FileSystemResourceFinder(Resource resource) { this.resource = resource; } @Override public IResourceStream find(Class? clazz, String pathname) { try { final File file = new File(resource.getFile(), pathname); if (file.exists()) { return new FileResourceStream(file); } } catch (final IOException e) { // ignore, file couldn't be found } return null; } } At least you've to add the resource finder to the resource finders list with getResourceSettings().setResourceFinders(resourceFinderList) in your applications init method. Alternatively, implement a custom ResourceStreamLocator. At first the Locator should use the FileSystemResourceFinder - if there's no match the locator should fallback to wicket's default resource finder. So far, your application is able to locate resources from the local file system. I would like to avoid using folders to organise html files so the designers can put all the resources they need in their root folder. The mechanism you describe, seems to use folders, how are you managing this for the designers? We thought the same - but this not http://www.dict.cc/englisch-deutsch/manageable.htmlmanageable with more than 50 files in one folder. So we decide to use folders - as already mentioned. Perhaps I'll write a tutorial... Best regards, Jan On 12/05/2012 02:49 PM, Edgar Merino wrote: Hello Jan, that seems like a good approach. However, I think I'm missing something: since every WebPage in wicket has straight access to resources located in the web root (that is, every path reference in the page's markup is relative to the web root), I would like to avoid using folders to organize html files so the designers can put all the resources they need in their root folder. The mechanism you describe, seems to use folders, how are you managing this for the designers? Edgar Merino On 04/12/12 04:15, Jan Riehn wrote: Hello Edgar, Yes, this is how it works. For the best separation of the responsibilities, you may store the resources outside of the web application (Think about a complete physical separation). We've made a good experience to break-off with wicket's given package structure - wicket’s resource localization does not fit with a separation of the responsibilities: the web designer has no knowledge about the internal package structure and it's not resistant against refactoring. Therefore, we use a more technical mechanism based on style, variation locale and the filename. 1. prefix/style/variation/locale/filename.extension 2. prefix/style/variation/filename.extension 3. prefix/style/filename.extension 4. prefix/filename.extension 5. filename.extension Best regards, Jan On 12/04/2012 09:04 AM, Edgar Merino wrote: Hello, I would like our designers to work with a simple folder structure on our application pages markup, and we would like to avoid including java source code files with the files we share with them. What is the best way to do this? I though about implementing a custom ResourceStreamLocator, so I can for instance name our html files using the fqcn e.g. my.company.HomePage.html and placing these files in the default package (under src/main/html for example). Is this the way to go? Thanks in advance, Edgar Merino - To unsubscribe, e-mail:users-unsubscr...@wicket.apache.org For additional commands, e-mail:users-h...@wicket.apache.org
Faked ajax requests
Hello, currently we've got a problem with faked ajax requests.these ajax requests misses some parameters, but the wicket-ajax header flag is set. So ServletWebRequest throws an exception: java.lang.IllegalStateException: Current ajax request is missing the base url header or parameter at org.apache.wicket.util.lang.Checks.notNull(Checks.java:38) at org.apache.wicket.protocol.http.servlet.ServletWebRequest.getClientUrl(ServletWebRequest.java:171) at org.apache.wicket.request.UrlRenderer.init(UrlRenderer.java:59) These faked requests are so massive, that our application is no longer monitorable. Our workaround rejects these requests via apache config. Because this is a common problem, we hope that this issue will be managed by wicket. Best regards, Jan
AW: Adding Cookie in 1.5.5
Hey, there is an open issue: https://issues.apache.org/jira/browse/WICKET-4358 the hint ((HttpServletResponse)bufferedWebResponse.getContainerResponse()).addCookie( cookie ); works. Best regards, Jan Von: wicket user [samd...@live.com] Gesendet: Mittwoch, 27. Juni 2012 19:49 An: users@wicket.apache.org Betreff: Adding Cookie in 1.5.5 Hi, I was trying to add a cookie getWebRequestCycle().getWebResponse().addCookie() but couldnt find getWebRequestCycle() in 1.5.5. i found getRequestCycle() but did not find addCookie in getResponse(). Please suggest how to add/get cookie in 1.5.5 Thanks -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Adding-Cookie-in-1-5-5-tp4650265.html Sent from the Users forum mailing list archive at Nabble.com. - 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
How to manage redirects using rewrite maps
Hello, we use a tomcat behind a apache. we also use mod_rewrite proxy rules to manage requests from the apache to the tomcat. Our wicket application modifies the location header: curl -I http://wicket-application/application-context/login HTTP/1.1 302 Moved Temporarily Date: Wed, 30 May 2012 13:45:15 GMT Server: Apache-Coyote/1.1 Expires: Thu, 01 Jan 1970 00:00:00 GMT Pragma: no-cache Cache-Control: no-cache, no-store Location: http://localhost:8080/application-context/login Set-Cookie: JSESSIONID=5F08FEDBAAABD7F3E83C7EF785C6A688; Path=/application-context Vary: User-Agent Content-Type: text/plain So we get a redirect to localhost. the hint: https://cwiki.apache.org/WICKET/wicket-application-behind-modproxyhttp-and-https.html does not work, because we are using rewrite maps for our mod_rewrite proxy rules. So we have no chance to use ReverseProxy. How can I solve this issue? Best regards, Jan
How to manage redirects using rewrite maps
Hello, we use a tomcat behind a apache. we also use mod_rewrite proxy rules to manage requests from the apache to the tomcat. Our wicket application modifies the location header: curl -I http://wicket-application/application-context/login HTTP/1.1 302 Moved Temporarily Date: Wed, 30 May 2012 13:45:15 GMT Server: Apache-Coyote/1.1 Expires: Thu, 01 Jan 1970 00:00:00 GMT Pragma: no-cache Cache-Control: no-cache, no-store Location: http://localhost:8080/application-context/login Set-Cookie: JSESSIONID=5F08FEDBAAABD7F3E83C7EF785C6A688; Path=/application-context Vary: User-Agent Content-Type: text/plain So we get a redirect to localhost. the hint: https://cwiki.apache.org/WICKET/wicket-application-behind-modproxyhttp-and-https.html does not work, because we are using rewrite maps for our mod_rewrite proxy rules. So we have no chance to use ReverseProxy. How can I solve this issue? Best regards, Jan