Hey, I have been searching all over for a solution to injecting into action filters. I have found a few solutions but they were implemented with an older version of ninject/mvc. Has anyone found a simple solution to this problem? I have been blocked for a day trying to get a clean implementation.
I have looked at this solution but a lot of the functions he uses are deprecated in Ninject.
Ninjet.Web.Mvc has support for this and the source code comes with a sample application that has filter injection. See https://github.com/ninject/ninject.web.mvc. The only thing that you have to do is adding a porperty with the Inject attribute to your action filter.
MVC3 has even better support see http://www.planetgeek.ch/2010/11/13/official-ninject-mvc-extension-gets-support-for-mvc3/#more-2004
Related
Since I basically can get the same info with both approaches, I'm wondering which is the preferred one and what are the advantages using one over the other?
$cordovaGeolocation is angular wrapper over plain javascript plugin, developed by ionic. Now question is why ngCordova was introduced,in simple words to deal it as plugin service as module and inject plugin wrapper as dependency to only particular controller or service.
On Pratical level, cordova developers were having issues with plugins on angular project. One simple issue was that $scope does not get updated sometimes in simple plugins callback.
Quoting from ionic blog post :
The services support promises to make it easier to deal with their
asynchronous nature and ensure scope data is properly updated.
So my conclusion is, you should go with $cordovaGeolocation.
As far as I remember, on Android that plugin does not do anything at all, and on iOS it prevents the OS asking for access to location over and over.
Overall the plugin totally conforms the html5 specs, so you shouldn't change anything in your calling code (in js) if you use the plugin.
And the plugin has a good documentation here: https://github.com/apache/cordova-plugin-geolocation/blob/master/doc/index.md
It is worth noting that according to the current and oficial documentation (see cordova geolocation doc), there is no need to use $cordovaGeolocation, but rather the global object navigator.geolocation.
We are starting to use Symfony 2 in our system, not as a whole but by pulling the components we need and kinda build our framework upon it. We have learned that from these articles
http://fabien.potencier.org/article/50/create-your-own-framework-on-top-of-the-symfony2-components-part-1
And from learning how Silex works as well.
I'm trying to find out how Symfony framework/standard package defines all the kernel.* services but I cannot seem to find that anywhere even after searching all files. Please give me a point if you know.
Symfony2 framework loads bundles from app/AppKernel.php and defines global services in vendor/symfony/src/Bundle/FrameworkBundle/Resources/config/*.xml
EDIT
contacted the author of play-js-validation. Bleeding edge stuff; Play has to be compiled against scala virtualized on to-be-released 2.10, and nested case classes are not yet supported. Really impressive project, I hope it comes to fruition as the prototype does almost exactly what I was hoping for...
Found this:
https://github.com/namin/play-js-validation
Anyone know if there are plans for built-in client-side validation in Play 2.0?
I am currently generating controller, model (with form validation), and dao scala files based on an existing DB schema; would love to include client-side validation as part of that process!
Thanks for clues, insider knowledge, etc.
p.s. Play user group is, to say the least, busy; most posts seem to be completely ignored (of course, many Stackoverflow Play-related questions go unanswered as well, so this thread may be DOA...)
There's no such plans I'm afraid, at least didn't hear about (note: I'm not a dev team member, just Player)
Check tickets on Play's Lighthouse
On the other hand I doubt if this fits Play's assumptions at all. Client-side validation is done with some external JS solution which should not be determined by framework, nobody said that it should use ie. jQuery by default.
Finally, the only thing to use client-side validation is just to include the JS libs and add proper attributes to your form fields, ie it will create tag that you can validate with jQuery Validation plugin:
#inputText(entrantForm("identitynumber"),
'_label->"Identity number",
'class -> "required",
'minlength -> "11",
'maxlength -> "11")
I'm looking to setup the GWT-Validation Framework (client side for now) in our application, but I'm not clear from the docs what pieces I need and what goes where?
We are using GWT 2.1 and MVP. I have the inherits entry for Validation in the gwt.xml, but what goes actually goes into the View, Activity, etc... I'm not aware of any tutorials available.
Any help would be appreciated!
Aftermath:
At the time when I was trying to use it, GWT 2.1 wasn't compatible with the GWT-Validation framework. After doing more reading I found this out. I don't know if that is still the case.
I assume you are referring to the validation framework in GWT and not the gwt-validation library? If that's the case, here is a page that describes how you can do bean validation: http://code.google.com/p/google-web-toolkit/wiki/BeanValidation. If you are actually referring to the gwt-validation library, here is a page that describes how to use it:
http://code.google.com/p/gwt-validation/wiki/ConceptOfOperations
Here is a link that gives some information about the GWT Validation Framework, GWT-Validator and the authors solution, the GWT-Validation library. It is a good synopsis of the issues and why he wrote the new library with some code snippets.
The GWT Validation Library.
I want to start a project using the Scala language. While searching for web frameworks I've found Lift. However, it is not what I was looking for: a web framework that has complete separation of HTML and code. Lift does have some nice features (and a learning curve) but we need to have complete separation of HTML and code. I was hoping to find something like Wicket, Tapestry or Barracuda for the Scala language.
Although it is nice to be able to reuse html templates, it is more important to us to have the HTML templates work as a "static application" mockup. In Tapestry we can just put links in the static templates and use that to have static navigation and a sort of prototype of the application.
So, do you know of any other web framework that is easy to work with the Scala language?
Thanks,
Luis
Here it is I can understand why you might want it pure Scala, but you haven't stated that's necessary, and with the techniques defined within the blog post, and there is another blog which also helps, you should be able to get it close enough to what you desire.
Tapestry 5 has many similarities with Wicket and works very well with Scala. I haven't tried it myself, but Francois Armand has being doing it for some time and he's writing about in in his blog.
Try Context. It is a component based framework written in Java but I have used it with Scala without much difficulties.
Context uses XSL as templating language which forces a sharp separation between logical presentation (DOM-tree) and actual presentation (HTML/CSS/JS).
You can even, with little effort, create prototypes and mocked views by faking the DOM-tree and trying invidual components in different combinations.