You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Updated Play tutorial for Play 2.1 and Scala IDE 3.0.0
I have only updated the text, not the images, as this is cumbersome and
I think having un up-to-date text is sufficient to understand the tutorial.
Fixes#53
Copy file name to clipboardExpand all lines: src/sphinx/tutorials/play/index.rst
+18-37Lines changed: 18 additions & 37 deletions
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
Setup and use Play framework 2.0 in Scala IDE 2.0
1
+
Setup and use Play framework 2.1 in Scala IDE 3.0
2
2
=================================================
3
3
4
4
What is in this guide?
@@ -9,7 +9,7 @@ This guide will show you how to configure a Play web application to import it in
9
9
Prerequisites
10
10
.............
11
11
12
-
* `Eclipse`_ 3.6.2 (Helios) with Scala IDE for Scala 2.9 installed (update site: http://download.scala-ide.org/releases-29/stable/site).
12
+
* `Eclipse`_ 3.7 (Indigo) with Scala IDE for `Scala 2.10 installed <http://scala-ide.org/download/current.html#for_scala_210x>`_.
13
13
14
14
Check the :doc:`getting started </current-user-doc/gettingstarted/index>` page for instructions on how to install Scala IDE.
15
15
@@ -19,22 +19,22 @@ Prerequisites
19
19
20
20
* No knowledge of the Play framework is required (in this guide).
21
21
22
-
Setting up Play 2.0
22
+
Setting up Play 2.1
23
23
-------------------
24
24
25
25
To be able to create a Play web application, the Play framework need to be installed. If you have not installed it already, follow this few steps, or use the `Play documentation`_.
26
26
27
-
* Download Play framework 2.0 from http://www.playframework.org/.
27
+
* Download Play framework 2.1 from http://www.playframework.org/.
28
28
29
-
* Unzip it in your preferred location. Let's say ``/path/to/play20`` for the purpose of this document.
29
+
* Unzip it in your preferred location. Let's say ``/path/to/play21`` for the purpose of this document.
30
30
31
31
* For convenience, add the Play folder to your system PATH:
32
32
33
33
.. code-block:: bash
34
34
35
-
export PATH=$PATH:/path/to/play20
35
+
export PATH=$PATH:/path/to/play21
36
36
37
-
Creating a Play 2.0 application
37
+
Creating a Play 2.1 application
38
38
-------------------------------
39
39
40
40
* In your development folder, ask Play to create a new web application, as a ``simple Scala application``.
@@ -72,12 +72,12 @@ Creating a Play 2.0 application
72
72
:width:100%
73
73
:target:../../_images/play20-scalaide20-05.png
74
74
75
-
Configuring the Play 2.0 web application for Scala IDE
75
+
Configuring the Play 2.1 web application for Scala IDE
Now that the Play application is running, it needs to be configured so it can be imported into Scala IDE.
79
79
80
-
Play 2.0-RC1 integrates `sbteclipse`_, which allow to create configuration files of a project for Eclipse.
80
+
Play 2.1 integrates `sbteclipse`_, which allow to create configuration files of a project for Eclipse.
81
81
82
82
* First, exit the 'run' mode in Play using ``ctrl-d``.
83
83
@@ -86,7 +86,7 @@ Play 2.0-RC1 integrates `sbteclipse`_, which allow to create configuration files
86
86
:width:100%
87
87
:target:../../_images/play20-scalaide20-06.png
88
88
89
-
* ``eclipsify`` is the command to invoke sbteclipse in Play. (In Play 2.1, the command is ``eclipse``)
89
+
* ``eclipse`` is the command to invoke sbteclipse in Play. (or ``eclipse with-source=true`` if you want to also download sources attachment of your dependencies)
90
90
91
91
.. image:: images/play20-scalaide20-09.png
92
92
:alt:eclipse
@@ -114,10 +114,10 @@ Setting a few preferences in Eclipse will make everything easier to use.
114
114
115
115
* Configure Eclipse so changes on the file system are automatically picked up.
116
116
117
-
.. image:: images/play20-scalaide20-13.png
117
+
.. image:: images/refresh-on-access.png
118
118
:alt:refresh automatically
119
119
:width:100%
120
-
:target:../../_images/play20-scalaide20-13.png
120
+
:target:../../_images/refresh-on-access.png
121
121
122
122
* If you don't have the Web Development Tools for Eclipse installed, Eclipse opens ``.html`` files in a web browser. Configure it to use the ``Text Editor`` instead.
123
123
@@ -131,29 +131,13 @@ Importing the Play web application into Scala IDE
131
131
132
132
Everything is setup, it is time to import the project in the IDE.
133
133
134
-
* Import the Play 2.0 application as an ``Existing Projects into Workspace``.
134
+
* Import the Play 2.1 application as an ``Existing Projects into Workspace``.
135
135
136
136
.. image:: images/play20-scalaide20-15.png
137
137
:alt:import project
138
138
:width:100%
139
139
:target:../../_images/play20-scalaide20-15.png
140
140
141
-
* The configuration generated by sbteclipse is working fine in Eclipse, but it is not optimal when using with Scala IDE.
142
-
143
-
Add the ``target/src_managed/scala`` folder as a source folder.
144
-
145
-
.. image:: images/play20-scalaide20-20.png
146
-
:alt:add the managed sources folder
147
-
:width:100%
148
-
:target:../../_images/play20-scalaide20-20.png
149
-
150
-
* And remove the ``classes_managed`` folder for the build path.
151
-
152
-
.. image:: images/play20-scalaide20-21.png
153
-
:alt:remove managed classes folder
154
-
:width:100%
155
-
:target:../../_images/play20-scalaide20-21.png
156
-
157
141
* Everything is good, everything compiles.
158
142
159
143
.. image:: images/play20-scalaide20-16.png
@@ -181,17 +165,15 @@ Let's change the main page to display a quote instead of the default page.
181
165
182
166
package models
183
167
184
-
case class Quote(val text: String, val author: String) {
185
-
186
-
}
168
+
case class Quote(text: String, author: String)
187
169
188
170
* Add an extra parameter to the ``index.scala.html`` view and update the layout.
189
171
190
172
.. code-block:: scala
191
173
192
174
@(message: String, quote: models.Quote)
193
175
194
-
@main("Welcome to Play 2.0") {
176
+
@main("Welcome to Play 2.1") {
195
177
196
178
<p>@quote.text<em> - @quote.author</em></p>
197
179
@@ -226,9 +208,9 @@ Let's change the main page to display a quote instead of the default page.
226
208
Going further
227
209
-------------
228
210
229
-
You now have all you need to create great web applications with Play 2.0 and Scala.
211
+
You now have all you need to create great web applications with Play 2.1 and Scala.
230
212
231
-
For more information about Play 2.0, check out the `embedded documentation`_.
213
+
For more information about Play 2.1, check out the `embedded documentation`_.
232
214
233
215
For more information about Scala, go to the `documentation website`_ or get the downloadable `eBook`_.
234
216
@@ -241,11 +223,10 @@ Please use github tickets and pull requests system for feedback.
0 commit comments