Using Play 2.0 to create a web service - scala

I found an old question "How to use the Play framework to develop a web service"
I'm trying to use Play 2.0 and Scala to do the same. Will everything still be the same on Play 2.0 with the exception of moving from Groovy templates to Scala templates?
A new example will be greatly appreciated.

There are lots and lots of changes in Play 2.0. The internal core API is in Scala, with the Java code being a wrapper.
There are three examples in the Play Framework code:
https://github.com/playframework/Play20/tree/master/samples
This may help you see what has changed between versions.

Related

Can F# be used with Unity (game engine)?

I'm getting into Unity, and wondering if I can use F# instead of C#, simply because I prefer the syntax. I'm guessing not, since the environment it runs on is very different, but maybe there's something that will cross-compile code or something else I'm not thinking of.
I can't help but get the impression that the other answers were written by people who do not really know what they are talking about.
This is what you need to do to use F# in a Unity project:
Create an F# project that compiles into a dll. Have it build into the assets folder of a Unity project.
Add references to UnityEngine.dll and/or UnityEditor.dll. Change the reference properties so the dlls aren't copied to the build folder.
Of course you can't create new F# classes from within the Unity editor this way, but you can assign the ones you wrote in F#.
Currently you need to enable the (experimental) support for .NET-version 4.5. Alternatively you can download an older version of the FSharp.Core.dll that supports .NET 3.5. (see here).
I can't guarantee that you won't run into trouble because of compatibility issues with the FSharp.Core.dll, but that's just a guess since I haven't tested it myself.
I had success doing this sometime back by following this Github project: https://github.com/eriksvedang/FSharp-Unity, which I believe is roughly the same as Lars Kokemohr's answer above. I haven't tested it in more recent versions of Unity/Mono however.
Yes you can use F# as first class language as C# in unity.
Here is an article about it link
an excellent blog for One who want to use F# in unity
if you want to use F# as second class which I recommend.
let me show how to do it.
Usually what I do is to create Game Domain in F# in .net standard
2.0 library project build it.
Make unity API Compatibility level .net standard 2.0 then
Import library project dll in asset/plugins in Unity
Here is an explanation on how to do it automatically after each build : link
You will get this error, here is the solution
Having said that I recommend not to do any serious work in unity with F# because you won't be able to cross compile to other platforms.
Unity uses IL2cpp and it don't work with F#.
In simple words unity don't support F# and if you are having issues like bugs in Il2cpp unity will not fix it because they don't support F#
There is no easy way to do this but if you REALLY want to make it happen I believe you could use something like fs2cs:
https://github.com/hsharpsoftware/fs2cs
In theory you could write a script that calls fs2cs on all of your Unity C# files. Integrating this with Unity itself would be the more challenging part, but in theory you can trigger fs2cs transpilation on save of your file and Unity can use the transpiled C# file.
Only Boo, C#, and UnityScript are officially supported!

writing view part for Play-java applications [duplicate]

I have just started using the Java Play framework, and I have a few questions...
I've developed a web application, which was managed using Maven 3.0, hosted on Tomcat 7.0, and containing a whole bunch of JSP files.
Our team recently decided to run everything using the Play framework, and I'm just wonder if there is a fast way to import my original project into Play? also, how does play recognise JSP files? where to put them?
Thank you
Unfortunately, play framework view template uses groovy (1.x) or scala (2.x) to render the data. Therefore, there is no way to use or replace the old jsp files in your new system. You have to convert the old bulk jsp files into the new views

Difficult to grasp the scala template in play 2.0

I have earlier worked with play 1.2.4 and found the groovy template quite easier as compared to scala template in play 2.0. I have gone through the documentation of play 2.0. It seems that I should have some initial knowledge in scala. Please help me out or suggest me some tutorial to grasp a good knowledge in scala templates so that i can play with play 2.0....
Start with a beginner tutorial like this one
The playframework website- template section is a good next section to explore. You wont find everything you need on there but its got the nittygritties to templating.
You might also want to look into the basics of Scala syntax, this is a good tutorial
From there on you should have foundations and if you run into further obstacles I'm sure you can figure them out via trial and error or through asking more specific questions
Good luck

Play framework with out scala UI template

I am coming from the Java EE world. New to scala and Play. Looking at some sample applications. I see scala code in html files. I am able to understand the framework but I could not get scala.html files. Do I need to learn scala to use Play framework. Any work around.
You can use Java version of Play! without any scala skills. If you don't want to use scala.html templates you can get some module providing Java templates for Play20. Modules list can be found here.
Some examples with samples:
Groovy Template Engine for Play Framework 2.0
A full feaured Java-based template engine for Play2

widget based web framework for scala

I am trying to move from java to scala . I am basically a web developer where i use zkoss, vaadin as my framework. Do scala has widget based framework.Fully ajax based? I haven't tried lift and play need some advice is that fully ajax based?
The Vaadin framework can be used with Scala. There is even a project called Scaladin to help you with that. Since you already know it, I suggest you try learning scala with that framework. After you have a good understand of scala you should have a better base for what framework to choose in case you want to leave Vaadin.
Here are some resources:
Scala and Vaadin HOWTO
Scaladin wiki
Develop Vaadin apps with Scala
Try Scala+GWT with one of web frameworks (Lift, Play and etc.)