Re: MVC with Freemarker

David McArdle <[email protected]>
Newsgroups gmane.comp.web.freemarker.user
Message-ID <[email protected]>
I've used Stripes with Freemarker for template's.  It was very simple and
worked well.  The latest Spring MVC is nice too. Good luck, -David.

On Thu, Nov 18, 2010 at 12:53 PM, Chris <[email protected]> wrote:

> I know this is a little beyond the scope for Freemarker, but...
>
> We're designing a new app, and I'd like to use Freemarker as the
> template engine. Freemarker really only handles the "V" in the MVC
> pattern, though. We're going to do the "M" on our own. What are other
> people using for the "C" part?
>
> In particular, are there any libraries out there that make it easy to
> load / save form data? Here's the sequence:
>
> 1. Customer requests a customer record.
>
> 2. We fetch it from the db, copy it into a TemplateModel-compatible data
> structure.
>
> 3. Render the template, putting the data into form fields like this:
>
> <input type="text" name="foo" value="${foo}"/>
>
> 4. User edits data, hits a "save" button. Form gets posted back to the
> server.
>
> 5. Form data get magically copied back into the data structure, which we
> can then use to update the db.
>
> (Actually, on #3 above it would be nice to omit the value="" part and
> have the system handle it automatically).
>
> For step #5 it wouldn't be too tough to write code that looped through
> the Request.getParameterMap() and filled up the data model. The trouble,
> though, is that when you render a list or table of values, like database
> records, and you let the user add or edit more than one record at a time
> on the client side, you've got to implement some kind of fancy naming
> convention for the form field names so you can keep them in sequence.
> The Request just brings back an unordered list of name/value pairs, so
> unless you've got a naming scheme, you can't know that the user edited
> record #3 on the page and added records #9 and #10. Same problem occurs
> if you let a user reorder rows in a table.
>
> I'd really rather have a framework do that work for me.
>
> What are other people using?
>
>
> *********
> We've fooled with Ruby on Rails, Grails, and a few others that manage
> the whole MVC stack from database to UI, but none of them really fit the
> bill.
>
>
>
>
> ------------------------------------------------------------------------------
> Beautiful is writing same markup. Internet Explorer 9 supports
> standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
> Spend less time writing and  rewriting code and more time creating great
> experiences on the web. Be a part of the beta today
> http://p.sf.net/sfu/msIE9-sfdev2dev
> _______________________________________________
> FreeMarker-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/freemarker-user
>

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev

_______________________________________________
FreeMarker-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freemarker-user
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.