• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

html view resolver

 
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello:

I am attempting to write a web app without JSPs, just HTML and ajax. I am trying to use Spring 3 MVC. I am having trouble resolving HTML views . . .
I need something like :



But this doesn't work. Wondering how to resolve static content. Thanks. Eric.
 
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How does it not work? What error or exception are you getting? What does your Controller code return?

Thanks

Mark
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Alas, 1 year later I'm trying to do the same thing.

I'm on this contract where the UI designer does not and will not fire up a web app in eclipse to make changes. So I'm trying to architect a solution whereby the static code loads from the file system, a kinda pure HTML.

I'm willing to for go MVC, and java templating engines, however I cannot find any precedence. I've read up on a templating engine called Thymeleaf which probably would give me much needed mileage.

For now, we're trying static html using jQuery to populate selects and forms after the page load. Essentially forgoing any traditional servlet based controllers, except for the RestEasy service points to serve JSON

Wish me luck.
 
Mark Spritzler
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I really like ICanHaz.js for templating, it is built on top of mustache.js Makes it very simple to render the template on the client side in javascript with just one line of code

ich['templateName](dataInJSonFormat);

returns the html of the rendered template.

so

var contents = ich['templateName](dataInJSonFormat);
$("#someDivId).html(contents);

Mark
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic