AngularJS , Angular 2/4/5 , JavaScript , Jquery , MongoDB , ASP.NET MVC 4/5, Entity Framework 4.1/5/6 , WPF , Silverlight , SQL Server


Hosting Silverlight in JSP:

(If Images are not visible, double click it for bigger view)

Silverlght content can be hosted in HTML/ASPX/JSP etc. Those who has Visual Studio IDE installed must have seen the hosting project for the silverlight application.hosting projects has .ASPX and HTML page for hosting the silverlight application.

both HTML and ASPX page has <body> tag. which includes the <object> tag for hosting the Silverlight content.

Following are the sample tags:

 <body>

    <form id=”form1″ runat=”server”>

   <div id=”silverlightControlHost”>

        <object data=”data:application/x-silverlight-2,” type=”application/x-silverlight-2″ width=”100%” height=”100%”>

<param name=”source” value=”ClientBin/Fir.Nomura.Shell.xap”/>

<param name=”onError” value=”onSilverlightError” />

<param name=”background” value=”white” />

<param name=”windowless” value=”true” />

<param name=”minRuntimeVersion” value=”3.0.40624.0″ />

<param name=”autoUpgrade” value=”true” />

<a href=”http://go.microsoft.com/fwlink/?LinkID=149156&v=3.0.40624.0&#8243; style=”text-decoration:none”>

<img src=”http://go.microsoft.com/fwlink/?LinkId=108181&#8243; alt=”Get Microsoft Silverlight” style=”border-style:none”/>

</a>

</object><iframe id=”_sl_historyFrame” style=”visibility:hidden;height:0px;width:0px;border:0px”></iframe></div>

 </form>

</body>

Steps:

  1. Above mentioned <Object> tag can be added in the JSP page.
  2. Add Folder name – “ClientBin” in the Java project.
  3. Add your project XAP files in ClientBin folder.
  4. Build the java project and host the java project inside hosting server say JBOSS for instance.

  

 or follow below detailed steps

Hosting Silverlight Content in JSP Page.

 Tools : Visual Studio 2008,NetBeans IDE/Eclipse

Framework:  Silverlight 3.0, Java 1.6

Server:  JBoss Server 5.0.

Steps to follow:

  1. Create sample Silverlight Application using Visual Studio 2008 IDE.

For more information on how to create the silverlight project ,please visit link : http://silverlight.net/ this is a official Microsoft site for silverlight.

Once new project is created silverlight adds two projects in the solution as shown in the screenshot:

 

Figure 1. Silverlight project Structure

 

2.Create sample Java Web site using NetBeans (or Eclipse).

3.Need to copy the “ClientBin” folder along with the required “.xap” file and paste it in the Java Web Site. Also we need to copy and paste the “Silverlight.jsp” file as shown below:

Figure 2. Add Client Bin and Silverlight.js

4.Now we need to reuse the HTML page content. We will reuse <Head> and <Body> of the HTML page as shown below:

 

5.Now we need to set the MIME types in the we.xml file as shown below:

 

  1. Build the Java site and deploy the application on JBoss Server.
  2. If you want to deploy site manually:

When you build the Java project in the NetBeans It will create the <Project_Name>.war file.

To deploy this java web site on Jboss we need to  copy this file at following location in JBoss:

“<Installed_Location>\\jboss-5.0.1.GA\jboss-5.0.1.GA\server\default\deploy\<Project_Name>.war”.

Comments on: "Hosting Silverlight content in JSP Page" (2)

  1. That was a great article you may also try http://www.hioxindia.com/jsp-hosting.php for your JSP hosting

  2. hai ,
    i have used windowless property which was set to TRUE
    then my browser showing that, your graphics has not able to load the page.
    i’m using chrome 20 version.
    i’m using windows 7.

    plz help me.
    thanks in advance.

Leave a comment