Calling applet in jsp page
i have made a line graph in applet and i want to call that applet in my jsp project's page....
<jsp:plugin type= "applet" codebase="." code= "ibill.lineGraph.class" width="400" height="400">
</jsp:plugin>
but it dosnt show the applet and give error of Loading java applet is failed....
can anyone help me please
with regards
In one of my project i tried to load applet using the <jsp:plugin> tag but failed. Since i had less time so i have not done the R&D instead i called the applet as
<applet id="MyApplet" code="MyApplet.class\" archive=\"MyApplet.jar\" width=5 height=3/>and it worked fine for me. You can try this method.
NOTE: My applet jar file was in the same directory of my JSP page
Message was edited by:
diptaPB
Similar Messages
-
Hi.
I have a class called clsDbGrid under the ./classes/pkgDB and a JSP page under de ./web directory. I need to call the class from my JSP. I wrote the follow code:
<applet class="clsDbGrid.class" width="640" height="480">
The browse doesn't support JAVA
</applet>But this code doesn't work. What's wrong? I put the entire path for package and doesn't work again.
Please, I'm beginner in Java and need a help.
Thanks.
Marco.
P.S - Sorry for my terrible english. I'm from Brazil.See if this helps:
http://java.sun.com/docs/books/tutorial/deployment/applet/html.html -
Hi All,
When I tried to call an applet in my JSP page ,it says like " java plugin not installed properly"...I don't know what is wrong with my installation.I'm using jswdk server.
Could anyone help me please....
Would Appreciate if I get help.
Subha.Hi
A plugin is used as a substitute to the browser VM as somtimes the client browsers may not have the right version of the VM to run some components like Swing etc.
The way you handle this in JSPs is that you use the <jsp:plugin> option . Any good tutorial on JSps will give you information on this.
One place to start would be:
The <jsp:plugin> directive takes care of generating all the HTML code necessary to embed and activate a Java applet. Consider the following example:
<html>
<head>
</head>
<body>
<jsp:plugin type="applet" code="NewsTicker.class" name="newsticker"
height="100" width="100">
<jsp:params>
<jsp:param name="x" value="10"/>
<jsp:param name="y" value="25"/>
<jsp:param name="cx" value="90"/>
<jsp:param name="cy" value="114"/>
<jsp:param name="bgcolor" value="102,102,153"/>
<jsp:param name="textcolor" value="0,0,0"/>
<jsp:param name="hilitecolor" value="255,0,0"/>
</jsp:params>
<jsp:fallback>Oops! Something bad happened and I can't display this
applet</jsp:fallback>
</jsp:plugin>
</body>
</html>
The code above sets up the applet contained in "NewsTicker.class", and passes it a bunch of name-value pairs of parameters. The <jsp:param> tag is used to pass these
parameters to the applet, while the <jsp:fallback> directive contains error text, in the event that the applet cannot be found or displayed.
When JSP compiles and renders the page, the code above is automatically converted to its HTML equivalent.
<html>
<head>
</head>
<body>
<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" width="100"
height="100"
codebase="http://java.sun.com/products/plugin/1.2.2/jinstall-1_2_2-win.cab#V
ersion=1,2,2,0">
<PARAM name="java_code" value="NewsTicker.class">
<PARAM name="type" value="application/x-java-applet;">
<PARAM name="cy" value="114">
<PARAM name="cx" value="90">
<PARAM name="bgcolor" value="102,102,153">
<PARAM name="hilitecolor" value="255,0,0">
<PARAM name="y" value="25">
<PARAM name="x" value="10">
<PARAM name="textcolor" value="0,0,0">
<COMMENT>
<EMBED type="application/x-java-applet;" width="100" height="100"
pluginspage="http://java.sun.com/products/plugin/"
java_code="NewsTicker.class"
cy=114
cx=90
bgcolor=102,102,153
hilitecolor=255,0,0
y=25
x=10
textcolor=0,0,0
>
<NOEMBED>
</COMMENT>
Oops! Something bad happened and I can't display this applet
</NOEMBED></EMBED>
</OBJECT>
</body>
</html>
The above sample was taken from the two links shown below.
- http://home.netscape.com/assist/net_sites/embed_tag.html
- http://www.devshed.com/Server_Side/Jserv/JSP8/print.html
For further reading the documentation that comes along with your application server should provide ample guide to using jsp:plugin with your applets.
Good Luck!
Eshwar Rao
Developer Technical Support
Sun microsystems inc
http://www.sun.com/developers/support -
Hi all
can someone please tell what am I doing wrong here? I'm trying to call Function on a JSP page
CallableStatement cs = connection.prepareCall("{? = call pa_dump_xml.fn_user_diary(?)}");
ResultSet rs = cs.executeQuery();
while (rs.next()) {
%>
<input type="text" name="app1" id="textfields1" size="" value="<% out.println(rs.getInt(11));%>" readonly="readonly"/>
<%
rs.close();
%>... And I keep getting this error
root cause
javax.servlet.ServletException: java.sql.SQLException: Missing IN or OUT parameter at index:: 1ThanksThanks for your reply, this is my code ;
CallableStatement cs = connection.prepareCall("{? = call pa_dump_xml.fn_user_diary(?)}");
proc.registerOutParameter(1, Types.INTEGER);
ResultSet rs = cs.executeQuery();
while (rs.next()) {
%>
<input type="text" name="app1" id="textfields1" size="" value="<% out.println(rs.getInt(1));%>" readonly="readonly"/>
......And the error I'm getting is
java.lang.NullPointerException It's a JSP page as an index page where I need to show Data in some textfields on load of page. I'm sure there is a better way of doing this but I can not think how to go about it.
Thanks
Zed -
Hello! I wrote an applet and try to put in jsp page in JDeveloper:
<jsp:plugin type="applet" code="CompositeTest.class"
width="400" height="400">
<jsp:fallback>
<p>Unable to load applet</p>
</jsp:fallback>
</jsp:plugin>
and I copy the class file to folder where the JSP page is located. When I start Jsp page I have a message: "Applet not found"
What I do wrong??? PLZ Help!
BEST REGARDSHi,
I am not sure the JSP file, which resides in the public_html directory, is part of the class path of the running application. If you open the project properties, you can see where JDeveloper looks for Java classes. Try and extend this setting to include the public_hml directory (you can also try and just add the source as a library path (see library section))
Frank -
Pass Object Between Applet and JSP Page
Hi all,
How can I pass an Object(such as Vector, File), rather than just string to the Applet from a JSP page?
Thank you.I used Base64Encoder and Base64Decoder from servlets.com utilities.
* convert any serializable object to a String
public synchronized static String objectToString(Serializable obj) throws Exception {
ByteArrayOutputStream bos = new ByteArrayOutputStream(100);
ObjectOutputStream oos = new ObjectOutputStream(bos);
oos.writeObject(obj);
byte[]bytes = bos.toByteArray();
bos = new ByteArrayOutputStream(); //to save the encoded String
Base64Encoder enc = new Base64Encoder(bos);
enc.write(bytes);
String encodedString = bos.toString();
//close all
enc.close();
oos.close();
bos.close();
return encodedString;
* Recreates the object from the encoded String
public synchronized static Object stringToObject(String str) throws Exception {
ByteArrayInputStream bis = new ByteArrayInputStream(str.getBytes());
Base64Decoder dec = new Base64Decoder(bis);
ObjectInputStream ois = new ObjectInputStream(dec);
Object obj = (Object)ois.readObject();
ois.close();
dec.close();
bis.close();
return obj;
} -
i have already made an applet code for my program....now i want to make it flexible by using JSP...
Should i write the code from scratch (for JSP)....or is there some way i can call the applet from JSP ...
Please suggest.see if this thread helps you
http://forum.java.sun.com/thread.jsp?forum=45&thread=166514
Cheers
Khalid -
Calling Classes From JSP pages
I am importing an application specific class in a JSP page and calling it
(Win NT). It compiles the servlet successfully but cannot appear to find the
class during execution.
I have tried placing the class file / jar file containing the class in
CLASSPATH environment / weblogic JAVAPATH variable / weblogic ServletClasses
directory .. so far without any luck.
I would appreciate any suggestions.
Regards,
Pradeep
Put it in WEBLOGICCLASSPATH variable. And make sure it is only in
WEBLOGICCLASSPATH , nowhere else.
Cheers - Wei
John Brown <[email protected]> wrote in message
news:39693f9e$[email protected]..
> I am importing an application specific class in a JSP page and calling it
> (Win NT). It compiles the servlet successfully but cannot appear to find
the
> class during execution.
> I have tried placing the class file / jar file containing the class in
> CLASSPATH environment / weblogic JAVAPATH variable / weblogic
ServletClasses
> directory .. so far without any luck.
> I would appreciate any suggestions.
>
> Regards,
>
> Pradeep
>
>
>
-
hi,
I tried to my best to call java beans from JSP page but it generate error that "unable to load class....", please help me that in which directory jsp file and bean *.class file reside, currently my setting are as follows.
Note: I am using tomcat server and my jsp and servlet files are running seccessfuly, there is any special change in classpath for java beans? if any please tell
My jsp file is in tomcat-->webapps-->jsp--><my file>
My bean (*.class) file-->webapps-->Root-->web-inf-->classes--><my file>
Pleae help me for the above problem.
Mubashar ([email protected])According to J2EE standards:
The web appl directory structure should be:
WebAppRootDirectory
|
|---html, jsp, images etc
|
|---WEB-INF---
|---classes--
|---lib
|
|
1) Make sure WEB-INF is in capital letters
2) Place all ur beans in classes dir or sub-directory in
classes
3) In Tomcat place WebAppRootDirectory in webapps
directory
[email protected] -
Can EJB's be called from within JSP pages?
Hi,
(This is a general question, not necessarily related to OAS in any way...)
I have read/heard conflicting reports pertaining to calling EJBs from within JSP pages.
Can anyone tell me if it's possible to reference an EJB session bean from a JSP page? Can anyone point me to some documentation on the topic?
Any help would be appreciated. Thanks!
David Christopher
[email protected]Hi,
Check the following code: http://www.jguru.com/jguru/faq/view.jsp?EID=5314 for ejb example.
-Ruchi
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Davidc:
Hi,
(This is a general question, not necessarily related to OAS in any way...)
I have read/heard conflicting reports pertaining to calling EJBs from within JSP pages.
Can anyone tell me if it's possible to reference an EJB session bean from a JSP page? Can anyone point me to some documentation on the topic?
Any help would be appreciated. Thanks!
David Christopher
[email protected]<HR></BLOCKQUOTE>
null -
How to call Servlet from jsp page and how to run this app using tomcat..?
Hi ,
I wanted to call servlet from jsp action i.e. on submit button of JSP call LoginServlet.Java file.
Please tell me how to do this into jsp page..?
Also i wanted to execute this application using tomcat.
Please tell me how to do this...? what setting are required for this...? what will be url ..??
Thanks.well....my problem is as follows:
whenever i type...... http://localhost:8080/appName/
i am getting 404 error.....it is not calling to login.jsp (default jsp)
but when i type......http://localhost:8080/appName/login.do........it executes servlet properly.
Basically this 'login.do' is form action (form action='/login.do').....and i wanted to execute this from login jsp only.(from submit button)
In short can anyone please tell me how to diaplay jsp page using tomcat 5.5
plz help me. -
Hi al,
When we try to invoke an applet from jsp, applet class is not able to initialize (not able to load the class)
Exception got in java console as follows :
Load: class SignedAppletDemo.class not found.
java.lang.ClassNotFoundException: SignedAppletDemo.class
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadCode(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed.
at sun.applet.AppletClassLoader.getBytes(Unknown Source)
at sun.applet.AppletClassLoader.access$100(Unknown Source)
at sun.applet.AppletClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 10 more
We are using <jsp:plugin> tag for access applet from jsp in Oracle Appserver.(OC4J).
If anyone have any idea on the above,please let us know. Please pass on steps to follow for access applet from jsp file.
Thanks,
RajkumarReview
URL.openConnection()
and HttpURLConnection -
Error while accessing remote server using applet in jsp page
hii..
We are accessing a data repository MDSPlus. Its used for storing data such as signals in tree like structure. We r coding for client side in JSP .
For this we are invoking applet which uses jar files of jScope(java tool for displaying waveforms). We r getting the following error when we try to access a remote server in network. But it works fine with local server.
So kindly help .
ERROR IS:
java.security.AccessControlException:access denied(java.net.SocketPermission 202.41.112.140:8000 connect,resolve)
url mds:://202.41.112.140/SST_DAQ/11/\SST_DAQ::TOP.BOLOMETER:BOLO_1
Use ploicytool.exe in JDK or JRE installation directory to add socket access permission.
The IP address mentioned above in error is the computer with which v have to connect. SST_DAQ is the expt name,11 is the shot no. , BOLOMETER and BOLO_1 are the tree node s..
plzz reply fast........Hi Frank,
Are you using standalone OC4J or 9iAS ? If you are using standalone OC4J then you need to add a proper data source entry in %OC4J_HOME%j2ee\home\config\data-sources.xml file.
If you are using 9iAS the you can log in to the Enterprise Manager console and add the data source entry by using wizard provided by 9iAS.
Ensure the case of the JNDI lookup string, since, it is case sensitive.
Hope this helps.
Abhijeet -
How to include a jsp page in another jsp jsp page
hi,
i m trying to include a jsp page name "header.jsp" into one jsp page name"selectattribute.jsp" i m using these commands in "selectattribute.jsp"
<%@include file "header.jsp"%> bcz both these jsp page are C:\program files\tomcat 4.0\webapps\examples\jsp\Poject\
but the problem is that , i m invoking this jsp page "selectattribute.jsp" from a servlet reportcontroller.java using REQUEST DISPATCHER.
the servlet is in
C:\Program files\tomcat 4.0\webapps\examples\WEB-INF\classes\Project\
i want to know how to include some other jsp page in a jsp page and how to invoke applet from jsp page when that particular jsp page is being invoked by servlet.
plz help
manishuse this for including in your selectattribute.jsp
<jsp:include page="header.jsp" flush="true"/>
I never tried calling an applet. I think you can write the code for calling the applet in a javabean method and call the method in the jsp -
Re: Including Applet in JSP with Dynamic input| Help needed
Hi All,
We are into a project in Oracle Portal Server where in we want to embed a result of a standalone application in Portal page.
We can do that once we can embed the result of the standalone application which generates applet based on the input it gets from the current application's database.
If it was static we could have used jsp:plugin but, it fails in our case!
We are clueless as to how to embed an applet which will pick up the data dynamically.
Can anyone of you help me in this regard?
Thanks & Regards
ArthiHi Arthi,
I think this might help you to get an idea why jsp:plugin tag does not allow for dynamically called applets.
<jsp:plugin type=applet height="100%" width="100%"
archive="myjarfile.jar,myotherjar.jar"
codebase="/applets"
code="com.foo.MyApplet" >
<jsp:params>
<jsp:param name="enableDebug" value="true" />
</jsp:params>
<jsp:fallback>
Your browser does not support applets.
</jsp:fallback>
</jsp:plugin>
The plugin example illustrates a <html> uniform way of embedding applets in a web page. Before the advent of the <OBJECT> tag, there was no common way of embedding applets. This tag is poorly designed and hopefully future specs will allow for dynamic attributes (height="${param.height}", code="${chart}", etc) and dynamic parameters. Currently, the jsp:plugin tag does not allow for dynamically called applets. For example, if you have a charting applet that requires the data points to be passed in as parameters, you can't use jsp:params unless the number of data points are constant. You can't, for example, loop through a ResultSet to create the jsp:param tags. You have to hand code each jsp:param tag. Each of those jsp:param tags however can have a dynamic name and a dynamic value.
I think you can get better information if you look in to the below link
http://pdf.coreservlets.com/CSAJSP-Chapter12.pdf
Many Thanks,
Ramesh.
Maybe you are looking for
-
Everytime I write a text in the inspector FCp X freezes. I have to force quit and start again. But I could never edit the text once it opens again. I just bought FCP X and I am really liking it except it slows down my computor alot and fcp freezes r
-
Questions about Digital Wireless Headphones CB2
Hi everyone, I have a question about the [url="http://nl.europe.creative.com/products/product.asp?category=437&subcategory=438&product=6 44" target=_self>Digital Wireless Headphones CB2530[/url] I've never seen it in a shop here in Holland, so I thou
-
Add counter in Receiver File name
Hello Everyone, I have a Idoc to file scenaraio . The file comes regularly and whenevr the file comes, it should get suffix with datestamp and then the counter. The name is should be Partner_YYYYMMDDHHMMSSL.xml. Where L is counter and should be inc
-
Is there a "how to operate" video out there for TD with the MBA?
I need to SEE how to operate this thing ... are there any opps videos out there to help me plz?
-
CAnnot get HP Officejet 7210 All-in-One to install
Have attempted to install numerous ways the HP Officejet All-in-One 7210, using both HP sent disc for WIN7, Download from HP and Download from Microsoft. Have even done a regedit of all 'HP' and fresh restart. This printer worked fine under WIN XP