aspose file tools*
The moose likes JSP and the fly likes Calling an Applet from JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Calling an Applet from JSP" Watch "Calling an Applet from JSP" New topic
Author

Calling an Applet from JSP

Madhu Bompaly
Greenhorn

Joined: Oct 11, 2007
Posts: 17
Hi,
Iam calling an Applet from JSP.
but Iam getting following Exception.
[10/17/07 10:37:07:209 EDT] 000001ad WebContainer E SRVE0232E: Internal Server Error. <br> Exception Message: [java.lang.NullPointerException
at com.ibm.ws.webcontainer.srt.SRTServletResponse.setDefaultResponseEncoding(SRTServletResponse.java(Compiled Code))
at com.ibm.ws.webcontainer.srt.SRTServletResponse.start(SRTServletResponse.java(Inlined Compiled Code))
at com.ibm.ws.webcontainer.srt.SRTConnectionContext.start(SRTConnectionContext.java(Inlined Compiled Code))
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java(Compiled Code))
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java(Compiled Code))
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java(Compiled Code))
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java(Compiled Code))
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java(Compiled Code))
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java(Compiled Code))
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java(Compiled Code))
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java(Compiled Code))
at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java(Compiled Code))
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))
]


below is my code:

<logic:equal name="elements" property="chartType" value="bar" >

<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
width="80" height="100" name="OutputOptionsObject"
codebase="https://webs1636.intra.daimlerchrysler.com/unprotected/edis/j2re-1_4_2_07-windows-i586-p.exe">
<!--
<param name=java_code value="com.sas.edis.viewers.EDISCaptureSnapShotApplet.class">
-->
<param name=java_code value="com.sas.edis.viewers.EDISCaptureSnapShotApplet">
<!--
<param name=java_codebase value="/DCXEDIS/assets/graph">
-->
<param name=java_codebase value="/EDIS/assets/graph">
<param name=java_archive value="EDISGraphApplet.jar">
<param name=java_type value="application/x-java-applet;version=1.4.2_01">
<param name=scriptable value="false">
<param name=useplugin value="yes">

<param name=fileName value="<%=elements.getImageName()%>">
<param name=fullImageLocation value="<%=elements.getFullImageLocation()%>">
<param name=SASImageLocation value="<%=elements.getSASImageLocation()%>">
<param name=applicationURL value="<%=elements.getApplicationURL()%>">
<COMMENT>
<EMBED type="application/x-java-applet;version=1.4.2_01"
java_code="com.sas.edis.viewers.EDISCaptureSnapShotApplet.class"

<!--
java_codebase="/DCXEDIS/assets/graph"
-->
java_codebase="/EDIS/assets/graph"

java_archive="EDISGraphApplet.jar"
width="100" height="100"
scriptable="false"
useplugin="yes"
pluginspage="http://webs1636.intra.daimlerchrysler.com/unprotected/edis/j2re-1_4_2_07-windows-i586-p.exe">
<NOEMBED>
</COMMENT>
No Java 2 SDK, Standard Edition v 1.4 support for applet!
Please install Java plug-in so that this applet works correctly.
If you are not prompted to download Java plug-in,
download it manually from <a href="https://webs1636.intra.daimlerchrysler.com/unprotected/edis/j2re-1_4_2_07-windows-i586-p.exe">here</a>
</NOEMBED>
</EMBED>
</OBJECT>
</logic:equal>

can some body please tell me what is wrong with my code.
Thanks,
Madhu
Gayathri Chowduru
Ranch Hand

Joined: Oct 17, 2007
Posts: 42
Hi,

Why don't you use <jsp:plugin> ??
This tag will execute the specified part of the program whether it is a bean or an applet.
So, please try like this.
<jsp:plugin type="applet" code="theClassFileYouWantToExecute" codebase="theClassFile'sDirectoryName" >
<jsp:param name="yourParameterName" value="<%=yourValue%>" />
<jsp:fallback>
<!--- Give your message if you are not able to find or execute your applet. -->
</jsp:fallback>
</jsp:plugin>

I am giving you an example here. Please go thru that.

<jsp:plugin type="applet" code="Snowr.class" codebase="/html">
<jsp:param name="networkType" value="<%=nsrForm.getNetworkType()%>" />
<jsp:fallback>
<p> Unable to load the plugin. Please download the plugin to continue. </p>
</jsp:fallback>
</jsp:plugin>
Madhu Bompaly
Greenhorn

Joined: Oct 11, 2007
Posts: 17
Hi Gayathri,
Thanks for your reply.
Iam using following code, but Iam getting a message that says failed to load the Applet.
please tell me is there any thing wrong with my code.

Thanks,
Madhu.
<% { %>
<jsp:plugin
type="applet"
code="EDISCaptureSnapShotApplet.class"
codebase="/EDIS/assets/graph/"
jreversion="1.4"
width="80"
height="100"
name = "OutputOptionsObject"
iepluginurl ="https://edistest.intra.daimlerchrysler.com:8000/unprotected/edis/j2re-1_4_2_07-windows-i586-p.exe">

<jsp:params>
<jsp:param name="java_archive" value="EDISGraphApplet.jar"/>
<jsp:param name="java_type" value="application/x-java-applet;version=1.4"/>
<jsp:param name= "fileName" value ="<%=elements.getImageName() %>" />
<jsp:param name="fullImageLocation" value="<%=elements.getFullImageLocation()%>"/>
<jsp:param name="SASImageLocation" value="<%=elements.getSASImageLocation()%>"/>
<jsp:param name="applicationURL" value="<%=elements.getApplicationURL()%>"/>

</jsp:params>

<jsp:fallback>
Plugin tag not supported.
</jsp:fallback>
</jsp:plugin>
<% } %>

Originally posted by Madhu Bompaly:
Hi,
Iam calling an Applet from JSP.
but Iam getting following Exception.
[10/17/07 10:37:07:209 EDT] 000001ad WebContainer E SRVE0232E: Internal Server Error. <br> Exception Message: [java.lang.NullPointerException
at com.ibm.ws.webcontainer.srt.SRTServletResponse.setDefaultResponseEncoding(SRTServletResponse.java(Compiled Code))
at com.ibm.ws.webcontainer.srt.SRTServletResponse.start(SRTServletResponse.java(Inlined Compiled Code))
at com.ibm.ws.webcontainer.srt.SRTConnectionContext.start(SRTConnectionContext.java(Inlined Compiled Code))
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java(Compiled Code))
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java(Compiled Code))
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java(Compiled Code))
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java(Compiled Code))
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java(Compiled Code))
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java(Compiled Code))
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java(Compiled Code))
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java(Compiled Code))
at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java(Compiled Code))
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))
]


below is my code:

<logic:equal name="elements" property="chartType" value="bar" >

<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
width="80" height="100" name="OutputOptionsObject"
codebase="https://webs1636.intra.daimlerchrysler.com/unprotected/edis/j2re-1_4_2_07-windows-i586-p.exe">
<!--
<param name=java_code value="com.sas.edis.viewers.EDISCaptureSnapShotApplet.class">
-->
<param name=java_code value="com.sas.edis.viewers.EDISCaptureSnapShotApplet">
<!--
<param name=java_codebase value="/DCXEDIS/assets/graph">
-->
<param name=java_codebase value="/EDIS/assets/graph">
<param name=java_archive value="EDISGraphApplet.jar">
<param name=java_type value="application/x-java-applet;version=1.4.2_01">
<param name=scriptable value="false">
<param name=useplugin value="yes">

<param name=fileName value="<%=elements.getImageName()%>">
<param name=fullImageLocation value="<%=elements.getFullImageLocation()%>">
<param name=SASImageLocation value="<%=elements.getSASImageLocation()%>">
<param name=applicationURL value="<%=elements.getApplicationURL()%>">
<COMMENT>
<EMBED type="application/x-java-applet;version=1.4.2_01"
java_code="com.sas.edis.viewers.EDISCaptureSnapShotApplet.class"

<!--
java_codebase="/DCXEDIS/assets/graph"
-->
java_codebase="/EDIS/assets/graph"

java_archive="EDISGraphApplet.jar"
width="100" height="100"
scriptable="false"
useplugin="yes"
pluginspage="http://webs1636.intra.daimlerchrysler.com/unprotected/edis/j2re-1_4_2_07-windows-i586-p.exe">
<NOEMBED>
</COMMENT>
No Java 2 SDK, Standard Edition v 1.4 support for applet!
Please install Java plug-in so that this applet works correctly.
If you are not prompted to download Java plug-in,
download it manually from <a href="https://webs1636.intra.daimlerchrysler.com/unprotected/edis/j2re-1_4_2_07-windows-i586-p.exe">here</a>
</NOEMBED>
</EMBED>
</OBJECT>
</logic:equal>

can some body please tell me what is wrong with my code.
Thanks,
Madhu
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39537
    
  27
Bharath Sekariyer,
Your post was moved to a new topic.


Ping & DNS - updated with new look and Ping home screen widget
 
 
subject: Calling an Applet from JSP
 
Similar Threads
Swing back to AWT
Installing IE7 broke my applet
Can remove listeners added to applet componenets from jsp?
Calling an Applet from JSP in WAS 5 environment.
Calling an Applet from JSP in WAS 5 environment.