1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332
| <html>
<head>
<title>DWR Test</title>
<!-- These paths use .. so that they still work behind a path mapping proxy. The fully qualified version is more cut and paste friendly. -->
<script type='text/javascript' src='../interface/updater.js'></script>
<script type='text/javascript' src='../engine.js'></script>
<script type='text/javascript' src='../util.js'></script>
<script type='text/javascript'>
function objectEval(text)
{
// eval() breaks when we use it to get an object using the { a:42, b:'x' }
// syntax because it thinks that { and } surround a block and not an object
// So we wrap it in an array and extract the first element to get around
// this.
// This code is only needed for interpreting the parameter input fields,
// so you can ignore this for normal use.
// The regex = [start of line][whitespace]{[stuff]}[whitespace][end of line]
text = text.replace(/\n/g, ' ');
text = text.replace(/\r/g, ' ');
if (text.match(/^\s*\{.*\}\s*$/))
{
text = '[' + text + '][0]';
}
return eval(text);
}
</script>
<style>
input.itext { font-size: smaller; background: #E4E4E4; border: 0; }
input.ibutton { font-size: xx-small; border: 1px outset; margin: 0px; padding: 0px; }
span.reply { background: #ffffdd; white-space: pre; }
span.warning { font-size: smaller; color: red; }
</style>
</head>
<body onload='dwr.util.useLoadingMessage()'>
<h2>Methods For: updater (recherche.UpdateDwr)</h2>
<p>To use this class in your javascript you will need the following script includes:</p>
<pre>
<script type='text/javascript' src='<a href='/BFinterface/dwr/interface/updater.js'>/BFinterface/dwr/interface/updater.js</a>'></script>
<script type='text/javascript' src='<a href='/BFinterface/dwr/engine.js'>/BFinterface/dwr/engine.js</a>'></script>
</pre>
<p>In addition there is an optional utility script:</p>
<pre>
<script type='text/javascript' src='<a href='/BFinterface/dwr/util.js'>/BFinterface/dwr/util.js</a>'></script>
</pre>
<p>Replies from DWR are shown with a yellow background if they are simple or in an alert box otherwise.<br/>
The inputs are evaluated as Javascript so strings must be quoted before execution.</p>
<li>
setAttributes( <input class='itext' type='text' size='10' value='""' id='p00' title='Will be converted to: java.lang.String'/>,
AUTO );
<input class='ibutton' type='button' onclick='updater.setAttributes(objectEval($("p00").value), reply0);' value='Execute' title='Calls updater.setAttributes(). View source for details.'/>
<script type='text/javascript'>
var reply0 = function(data)
{
if (data != null && typeof data == 'object') alert(dwr.util.toDescriptiveString(data, 2));
else dwr.util.setValue('d0', dwr.util.toDescriptiveString(data, 1));
}
</script>
<span id='d0' class='reply'></span>
</li>
<li>
getIds(AUTO );
<input class='ibutton' type='button' onclick='updater.getIds(reply1);' value='Execute' title='Calls updater.getIds(). View source for details.'/>
<script type='text/javascript'>
var reply1 = function(data)
{
if (data != null && typeof data == 'object') alert(dwr.util.toDescriptiveString(data, 2));
else dwr.util.setValue('d1', dwr.util.toDescriptiveString(data, 1));
}
</script>
<span id='d1' class='reply'></span>
</li>
<li>
getNames(AUTO );
<input class='ibutton' type='button' onclick='updater.getNames(reply2);' value='Execute' title='Calls updater.getNames(). View source for details.'/>
<script type='text/javascript'>
var reply2 = function(data)
{
if (data != null && typeof data == 'object') alert(dwr.util.toDescriptiveString(data, 2));
else dwr.util.setValue('d2', dwr.util.toDescriptiveString(data, 1));
}
</script>
<span id='d2' class='reply'></span>
</li>
<li>
setIds( <input class='itext' type='text' size='10' value='[]' id='p30' title='Will be converted to: java.util.List'/>,
AUTO );
<input class='ibutton' type='button' onclick='updater.setIds(objectEval($("p30").value), reply3);' value='Execute' title='Calls updater.setIds(). View source for details.'/>
<script type='text/javascript'>
var reply3 = function(data)
{
if (data != null && typeof data == 'object') alert(dwr.util.toDescriptiveString(data, 2));
else dwr.util.setValue('d3', dwr.util.toDescriptiveString(data, 1));
}
</script>
<span id='d3' class='reply'></span>
</li>
<li>
setNames( <input class='itext' type='text' size='10' value='[]' id='p40' title='Will be converted to: java.util.List'/>,
AUTO );
<input class='ibutton' type='button' onclick='updater.setNames(objectEval($("p40").value), reply4);' value='Execute' title='Calls updater.setNames(). View source for details.'/>
<script type='text/javascript'>
var reply4 = function(data)
{
if (data != null && typeof data == 'object') alert(dwr.util.toDescriptiveString(data, 2));
else dwr.util.setValue('d4', dwr.util.toDescriptiveString(data, 1));
}
</script>
<span id='d4' class='reply'></span>
</li>
<li>
getCurrentBrandName(AUTO );
<input class='ibutton' type='button' onclick='updater.getCurrentBrandName(reply5);' value='Execute' title='Calls updater.getCurrentBrandName(). View source for details.'/>
<script type='text/javascript'>
var reply5 = function(data)
{
if (data != null && typeof data == 'object') alert(dwr.util.toDescriptiveString(data, 2));
else dwr.util.setValue('d5', dwr.util.toDescriptiveString(data, 1));
}
</script>
<span id='d5' class='reply'></span>
</li>
<li>
setCurrentBrandName( <input class='itext' type='text' size='10' value='""' id='p60' title='Will be converted to: java.lang.String'/>,
AUTO );
<input class='ibutton' type='button' onclick='updater.setCurrentBrandName(objectEval($("p60").value), reply6);' value='Execute' title='Calls updater.setCurrentBrandName(). View source for details.'/>
<script type='text/javascript'>
var reply6 = function(data)
{
if (data != null && typeof data == 'object') alert(dwr.util.toDescriptiveString(data, 2));
else dwr.util.setValue('d6', dwr.util.toDescriptiveString(data, 1));
}
</script>
<span id='d6' class='reply'></span>
</li>
<li>
hashCode( );
<input class='ibutton' type='button' onclick='updater.hashCode(reply7);' value='Execute' title='Calls updater.hashCode(). View source for details.'/>
<script type='text/javascript'>
var reply7 = function(data)
{
if (data != null && typeof data == 'object') alert(dwr.util.toDescriptiveString(data, 2));
else dwr.util.setValue('d7', dwr.util.toDescriptiveString(data, 1));
}
</script>
<span id='d7' class='reply'></span>
<br/><span class='warning'>(Warning: hashCode() is excluded: Methods defined in java.lang.Object are not accessible. See <a href='#excludedMethod'>below</a>)</span>
</li>
<li>
getClass( );
<input class='ibutton' type='button' onclick='updater.getClass(reply8);' value='Execute' title='Calls updater.getClass(). View source for details.'/>
<script type='text/javascript'>
var reply8 = function(data)
{
if (data != null && typeof data == 'object') alert(dwr.util.toDescriptiveString(data, 2));
else dwr.util.setValue('d8', dwr.util.toDescriptiveString(data, 1));
}
</script>
<span id='d8' class='reply'></span>
<br/><span class='warning'>(Warning: No Converter for java.lang.Class. See <a href='#missingConverter'>below</a>)</span>
<br/><span class='warning'>(Warning: getClass() is excluded: Methods defined in java.lang.Object are not accessible. See <a href='#excludedMethod'>below</a>)</span>
</li>
<li>
equals( <input class='itext' type='text' size='10' value='' id='p90' title='Will be converted to: java.lang.Object'/> );
<input class='ibutton' type='button' onclick='updater.equals(objectEval($("p90").value), reply9);' value='Execute' title='Calls updater.equals(). View source for details.'/>
<script type='text/javascript'>
var reply9 = function(data)
{
if (data != null && typeof data == 'object') alert(dwr.util.toDescriptiveString(data, 2));
else dwr.util.setValue('d9', dwr.util.toDescriptiveString(data, 1));
}
</script>
<span id='d9' class='reply'></span>
<br/><span class='warning'>(Warning: No Converter for java.lang.Object. See <a href='#missingConverter'>below</a>)</span>
<br/><span class='warning'>(Warning: equals() is excluded: Methods defined in java.lang.Object are not accessible. See <a href='#excludedMethod'>below</a>)</span>
</li>
<li>
toString( );
<input class='ibutton' type='button' onclick='updater.toString(reply10);' value='Execute' title='Calls updater.toString(). View source for details.'/>
<script type='text/javascript'>
var reply10 = function(data)
{
if (data != null && typeof data == 'object') alert(dwr.util.toDescriptiveString(data, 2));
else dwr.util.setValue('d10', dwr.util.toDescriptiveString(data, 1));
}
</script>
<span id='d10' class='reply'></span>
<br/><span class='warning'>(Warning: toString() is excluded: Methods defined in java.lang.Object are not accessible. See <a href='#excludedMethod'>below</a>)</span>
</li>
<li>
wait( <input class='itext' type='text' size='10' value='0' id='p110' title='Will be converted to: long'/>,
<input class='itext' type='text' size='10' value='0' id='p111' title='Will be converted to: int'/> );
<input class='ibutton' type='button' onclick='updater.wait(objectEval($("p110").value), objectEval($("p111").value), reply11);' value='Execute' title='Calls updater.wait(). View source for details.'/>
<script type='text/javascript'>
var reply11 = function(data)
{
if (data != null && typeof data == 'object') alert(dwr.util.toDescriptiveString(data, 2));
else dwr.util.setValue('d11', dwr.util.toDescriptiveString(data, 1));
}
</script>
<span id='d11' class='reply'></span>
<br/><span class='warning'>(Warning: overloaded methods are not recommended. See <a href='#overloadedMethod'>below</a>)</span>
<br/><span class='warning'>(Warning: wait() is excluded: Methods defined in java.lang.Object are not accessible. See <a href='#excludedMethod'>below</a>)</span>
</li>
<li>
wait( <input class='itext' type='text' size='10' value='0' id='p120' title='Will be converted to: long'/> );
<input class='ibutton' type='button' onclick='updater.wait(objectEval($("p120").value), reply12);' value='Execute' title='Calls updater.wait(). View source for details.'/>
<script type='text/javascript'>
var reply12 = function(data)
{
if (data != null && typeof data == 'object') alert(dwr.util.toDescriptiveString(data, 2));
else dwr.util.setValue('d12', dwr.util.toDescriptiveString(data, 1));
}
</script>
<span id='d12' class='reply'></span>
<br/><span class='warning'>(Warning: overloaded methods are not recommended. See <a href='#overloadedMethod'>below</a>)</span>
<br/><span class='warning'>(Warning: wait() is excluded: Methods defined in java.lang.Object are not accessible. See <a href='#excludedMethod'>below</a>)</span>
</li>
<li>
wait( );
<input class='ibutton' type='button' onclick='updater.wait(reply13);' value='Execute' title='Calls updater.wait(). View source for details.'/>
<script type='text/javascript'>
var reply13 = function(data)
{
if (data != null && typeof data == 'object') alert(dwr.util.toDescriptiveString(data, 2));
else dwr.util.setValue('d13', dwr.util.toDescriptiveString(data, 1));
}
</script>
<span id='d13' class='reply'></span>
<br/><span class='warning'>(Warning: overloaded methods are not recommended. See <a href='#overloadedMethod'>below</a>)</span>
<br/><span class='warning'>(Warning: wait() is excluded: Methods defined in java.lang.Object are not accessible. See <a href='#excludedMethod'>below</a>)</span>
</li>
<li>
notify( );
<input class='ibutton' type='button' onclick='updater.notify(reply14);' value='Execute' title='Calls updater.notify(). View source for details.'/>
<script type='text/javascript'>
var reply14 = function(data)
{
if (data != null && typeof data == 'object') alert(dwr.util.toDescriptiveString(data, 2));
else dwr.util.setValue('d14', dwr.util.toDescriptiveString(data, 1));
}
</script>
<span id='d14' class='reply'></span>
<br/><span class='warning'>(Warning: notify() is excluded: Methods defined in java.lang.Object are not accessible. See <a href='#excludedMethod'>below</a>)</span>
</li>
<li>
notifyAll( );
<input class='ibutton' type='button' onclick='updater.notifyAll(reply15);' value='Execute' title='Calls updater.notifyAll(). View source for details.'/>
<script type='text/javascript'>
var reply15 = function(data)
{
if (data != null && typeof data == 'object') alert(dwr.util.toDescriptiveString(data, 2));
else dwr.util.setValue('d15', dwr.util.toDescriptiveString(data, 1));
}
</script>
<span id='d15' class='reply'></span>
<br/><span class='warning'>(Warning: notifyAll() is excluded: Methods defined in java.lang.Object are not accessible. See <a href='#excludedMethod'>below</a>)</span>
</li>
</ul>
<h2>Other Links</h2>
<ul>
<li>Back to <a href='/BFinterface/dwr/'>class index</a>.</li>
</ul>
<div>
<h2>Fixing Issues</h2>
<h3><a name="missingConverter">Warning: No Converter for XXX.</a></h3>
<p>
dwr.xml does not have an allow entry that enables conversion of this type to
Javascript. The most common cause of this problem is that XXX is a java bean
and bean marshalling has not been enabled. Bean marshalling is disabled by
default for security reasons.
</p>
<p>
To enable marshalling for a given bean add the following line to the allow
section of your dwr.xml file:
</p>
<pre>
<convert converter="bean" match="XXX"/>
</pre>
<p>
It is also possible to enable marshalling for an entire package or hierachy
of packages using the following:
</p>
<pre>
<convert converter="bean" match="package.name.*"/>
</pre>
<h3><a name="overloadedMethod">Warning: overloaded methods are not recommended</a></h3>
<p>
Javascript does not support overloaded methods, so the javascript file
generated from this class will contain two methods the second of which will
replace the first. This is probably not what you wanted.
</p>
<p>
It is best to avoid overloaded methods when using DWR.
</p>
<h3><a name="excludedMethod">Warning: methodName() is excluded:</a></h3>
<p>
The methods may be excluded explicitly with an <exclude> element in
dwr.xml or excluded implicitly by not being mentioned in an <include>
element. Or the method may be defined in <code>java.lang.Object</code> -
methods defined here may not be exported.
</p>
<p>
If methods are excluded using <include> or <exclude> then no
JavaScript proxy will be generated. To allow testing of methods that should
not be accessible, add an init-param to WEB-INF/web.xml with the name/value
allowImpossibleTests=true.
</p>
</div>
</body></html> |
Partager