Top Rounds
|

_callServer ·

This is a Browser Action API.

_callServer allows Sahi to execute any server side code.

Syntax:

_callServer(cmd, qs)
The parameters are:

  • cmd: String command of the form “className_methodName”
  • qs: QueryString to be made available in the invoked method

Example:

Below is an implementation of writing debug messages to the console.

Create this class:
package net.sf.sahi.ext; import net.sf.sahi.request.HttpRequest; public class Debug { public void toOut(HttpRequest request) { String msg = request.getParameter("msg"); System.out.println(msg); } }
Add it to Sahi’s classpath:
Look at Adding jars to Sahi’s classpath

Call this from your script:
_callServer("net.sf.sahi.ext.Debug_toOut", "msg=SomeMessage");

This will write “SomeMessage” on the console where sahi.bat/sahi.sh was started.




---


Top Rounds