the developer can override the content at run time. Thymeleaf templates
Post by Konstantin IgnatyevJason,
From outsiders perspective (mine) it looks like you are reimplementing
Wicket or Play
==
Martini treats HTML as source code. It also has partial support for
prototypical HTTP requests, treating them as source as well. So the source
GET /course/{dept}/{number}/{term}
===
How it is different from Wicket
mountPage("/motorcycle-rental/info/${ml-id}/#{tab}",
classOf[MotoLocationInfoPage])
${ml-id} is mandatory part of URL and
#{tab} is optional
==
You get the HTML from creative (UX, web designer, script monkey), add it
to your project, it works immediately in âecho backâ mode. Then you the dev
can progressively implement the backend at your leisure. For instance,
populate drop lists from a database vs using the default data and
selections found in the original HTML.
==
I think: it is _exactly_ how Wicket works
There might be reasons for you to work on Martini, but I fail to see
them. Care to explain in terms of comparison with more established
frameworks like Wicket or Play?
==
I do not yet know if Iâll jump on the JSON bandwagon. Iâm cool with AJAX,
dynamic content, progressive rendering. But Iâm leaning towards server
generated HTML snippets vs JSON -> HTML generation on the client.
==
I have been there, and all probably know that I am a big fan on Wicket
framework (and the likes) and statically typed languages. However, I took
the plunge and tried AngularJS for a small real project first, and now
there is no coming back. When applied judicially AngularJS made me 5x
more productive.
If there is interest I can give a talk describing how I replaced 85% of
my Wicket with Angular while making app faster and more maintainable -
Java/Scala guy perspective on using raw JavaScript sprinkled with magic
dust.
By the way AngularJS supports the workflow you mention: external HTML
made by designers added to project and then progressively enhanced.
Post by Jason OsgoodGreat replies, discussion. Especially JSON v HTML and security. Thank you.
I now realize I should have stated âPRG for HTTP POSTs for HTML formsâ.
the PRG was only applied if the form "submit" was successful âŠ
otherwise ALL the userâs
input has to be encoded in the "get" url ... so that it can
re-populate the form.
Hmmm. I mightâve accidentally got that part right.
Martini auto populates a Pageâs fields, forms, etc. from either a GETâs
query params or a POSTâs form data. Pages (code generated HTML -> Java )
work as-is out of the box. That enables an HTML-first workflow.
You get the HTML from creative (UX, web designer, script monkey), add it
to your project, it works immediately in âecho backâ mode. Then you the dev
can progressively implement the backend at your leisure. For instance,
populate drop lists from a database vs using the default data and
selections found in the original HTML.
About JSON and AJAX...
However, when more modern approach is used, i.e. JSON data post then
post can return new data.
Before you jump on me, please see how angularjs works
http://angularjs.org/
Thatâs an excellent point. Iâm not there yet. But this is how I
anticipate handling non-HTMLâŠ
Martini treats HTML as source code. It also has partial support for
prototypical HTTP requests, treating them as source as well. So the source
GET /course/{dept}/{number}/{term}
Right now, that parameterized query is fed into Page compiler, e.g.
Page.getURI() {âŠ} and when you register a Page (at startup), that URI is
added to the route (dispatch) table.
In the near future, HTTP GET headers will be supported. For instance,
cookies will be modeled and part of the code generation, matching content
type will be stated upfront and used by the router, etc.
After that, prototypical HTTP responses will be supported.
These HTTP requests and responses declare their content-type. Once
non-HTML content is supported, martini will have the information to route
requests directly. The router will have enough information to PRG for HTML
forms and âmarco poloâ for JSON.
I do not yet know if Iâll jump on the JSON bandwagon. Iâm cool with
AJAX, dynamic content, progressive rendering. But Iâm leaning towards
server generated HTML snippets vs JSON -> HTML generation on the client.
Weâll see.
Cheers, Jason
------------------------------------
Yahoo Groups Links
--
Konstantin Ignatyev
PS: If this is a typical day on planet Earth, humans will add fifteen
million tons of carbon to the atmosphere, destroy 115 square miles of
tropical rainforest, create seventy-two miles of desert, eliminate between
forty to one hundred species, erode seventy-one million tons of topsoil,
add 2,700 tons of CFCs to the stratosphere, and increase their population
by 263,000
Bowers, C.A. The Culture of Denial: Why the Environmental Movement Needs
a Strategy for Reforming Universities and Public Schools. New York: State
University of New York Press, 1997: (4) (5) (p.206)