I\'ve searched around a bit for similar questions, but other than running one command or perhaps a few command with items such as:
ssh user@host -t sudo su -
You can run a local script as shown by che and Yang, and/or you can use a Here document:
ssh root@server /bin/sh <<\EOF wget http://server/warfile # Could use NFS here cp app.war /location command 1 command 2 /etc/init.d/httpd restart EOF