« Return to Thread: Grails - J2ee integration
This example would work only if the jsp and the gsp are in the
same domain ,but if they are not then how would this work??
i.e if the jsp is a different server and the grails app is on
some other one this won’t work rt???
From: Julius Huang [mailto:juliushuang@...]
Sent: 06 July 2009 11:50
To: user@...
Subject: Re: [grails-user] Grails - J2ee integration
Hi,
JSP
<tr>
<td>
<select onchange="jQuery.ajax({
url: '/ajax/optfoo',
data: 'optid=' + this.value,
cache: false,
success: function(html) {
jQuery('#models').html(html);
}});" >
<option></option>
<option
value="1">OPT_A</option>
<option
value="2">OPT_B</option>
<option
value="3">OPT_C</option>
</select>
</td>
</tr>
<tr>
<td>
<label for="model">
Model </label>* :
</td>
<td>
<div id="models">
</div>
</td>
</tr>
Grails
def optfoo = {
def model = optid.findByoptId(params.optid)
render model ..... // Check Grails Doc for
Render as HTML/XML/JSON .....
}
Cheers,
Julius
On 06 Jul , 2009, at 12:18 , Ruchi Singhal wrote:
Hi All,
I wish to do very simple thing -
In one of the divs in a JSP of my existing J2ee application I wish to render
a grails app(ajax based).I could achieve this by simply using an
iFrame,but
I dodnot wish to use it for performance reasons.Is there any other way out
« Return to Thread: Grails - J2ee integration
| Free embeddable forum powered by Nabble | Forum Help |