Silverlight animation in Servlets

What if you are a servlet or jsp developer and want to run a silverlight animation on your page..
Here’s the solution..
The silverlight animation is in servlet…
Its very basic and easy..

You need:
Tomcat (i used 5.5) : To run servlets.
Microsoft Blend : To create silverlight animation. Its your choice to use any tool to create SL apps.

Here are the steps:
1) Create a folder to place your files in the directory that Tomcat uses for your class files.
I placed my files here: C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\SilverlightServlet
SilverlightServlet is the folder.. in webapps..

2) Add the folder containing files for your silverlight animation.
My location : C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\SilverlightServlet\SL
SL folder contains another folder named PeopleAnimation with xaml and javascript files necessary to
run the animation..

Follow this diagram to add the necessary files to run servlets with sl animation..
This is my folder structure diagram..

FolderStructure to place files

3) Write java code to host your silverlight files..
Here is the code..

SlinServlet.java code file

SlinServlet.java code file

4) Edit the web.xml file to do the mapping to let Tomcat locate your class file.
This is the web.xml file..

Web.xml file content

Web.xml file content

5) Finally run your application in localhost

Final animation in Servlet

Final animation in Servlet

Follow

Get every new post delivered to your Inbox.

Join 40 other followers