Paul Franky | : | Hi, |
we've built a portlet that uses the serveResource() method (see JSR 286) for creating a response to an AJAX request. This works fine so far. | ||
What we wanna do is to render a velocity template within this method directly to an object. This object we would like to return as a string (or bytes) in response to the AJAX request. | ||
How could we do this? Will ThemeUtil.includeVM() be our friend? | ||
Mazhar Anwar | : | If you use jsp rather than velocity, it will be more simple. |
you can have some html tag (<div>, <span>, etc with some ids and if require you can make it hidden initially) and after executaion of your serveResource method you can set those html tags dynamically using java script(AJAX) based on your response. | ||
This is something intresting and innovative, please reply if success | ||
Hope This Help. | ||
Regards, Mazhar | ||
Paul Franky | : | Very sorry, not to use Velocity is not an option. We use the spring MVC Framework and Velocity to clearly separate code and design. That's also the reason for not creating a document "by-hand" inside serveResource(). |
Prepared hidden content is also not an option because we need to update large data tables (and we wanna update only those). | ||
Nevertheless thanks for thinking about it. |
Laliwala IT services offers 35+ enterprise open source online Training and Website Development Services. We offer various Training from popular open source stack like JBoss SOA Training, Alfresco Training, JBoss JBPM Training, Mule ESB Training, Activiti BPM Training, Apache Solr Training, Spring Training Course, Cloud Computing AWS Training, Apache Camel Training, Jboss ESB Training and many more.....(Call Now +91 9904245322)
Wednesday, February 23, 2011
How to use Velocity in AJAX response, jsr 286, ajax liferay, liferay template, method directly, jsp rather, dynamically, using java, jsp
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment