For more information on this, you should get the IP Phone SDK, available from Cisco's Developer Support program. The SDK provides more information on developing applications for the IP Phones, and has multiple example applications in both ASP and JSP.
There is also a book from Cisco Press titled "Developing Cisco IP Phone Services: A Cisco AVVID Solution". This book is based on an older version of the IP Phone SDK, but still has good information on getting started. You can find that book on O'Reilly Network Safari, which has a free 2-week trial (you can read the book online!):