Insert applet in jsp using plugin

After adding an applet in a jsp,when trying to run the page it is showing the following error message
< errorInvalidEscapeChar>
As I don't know xml, I am using component palette for adding the Applet.
The jsp tag is given below.
<body><h:form binding="#{backing_untitled1.form1}" id="form1">
<jsp:plugin type="applet" code="Applet1"
codebase="C:\JDEV\SQC_APPLICATION\SQC_PROJECT\classes\sqc_project"
align="left" height="200" jreversion="1.2" width="200"/>
</h:form></body>

Hi,
the codebase reference causes the problem because in Java "\" is an escape indicator. Also, the code sample doesn't work unless you wrap the jsp:plugin tag in a <f:verbatim></f:verbatim> cosntruct
Frank

Similar Messages

  • Unable to load Applet in JSP using Tomcat 5.5.12

    Hi
    I am aunable to applet in jsp using Tomcat 5.5.12 and JRE 1.5. Below is the code that I am using
                                       <applet
                                       codebase = "."
                                       archive = "WebPOSApplet.jar"
                                       code = "webposprint.WPMainApplet.class"
                                       name = "Trans Applet"
                                       width = "450"
                                       height = "115"
                                       hspace = "0"
                                       vspace = "0"
                                       align = "middle"
                                       >
    <param name = "redirectInfo" value = "SearchProducts.do">
                                       </applet>
    <%/*%>
    <OBJECT
                                       classid = "clsid:CAFEEFAC-0014-0002-0000-ABCDEFFEDCBA"
                                       codebase = "http://java.sun.com/products/plugin/autodl/jinstall-1_4_2-windows-i586.cab#Version=1,4,2,0"
                                       WIDTH = 450 HEIGHT = 115 >
    <PARAM NAME = CODE VALUE = webposprint.WPMainApplet.class>
    <PARAM NAME = archive VALUE = WebPOSApplet.jar>
    <PARAM NAME = "type" VALUE = "application/x-java-applet;jpi-version=1.4.2">
    <param name = "redirectInfo" value = "SearchProducts.do">
    <PARAM NAME = "scriptable" VALUE = "false">
    <PARAM NAME = model VALUE=models/buckminsterfullerine.xyz>
    <embed width="450" height="115" code="webposprint.WPMainApplet.class" archive="WebPOSApplet.jar" type="application/x-java-applet;jpi-version=1.4.2" redirectinfo="SearchProducts.do" scriptable="false" model="models/buckminsterfullerine.xyz" src="webposprint.WPMainApplet.class">
    </embed> <COMMENT> <EMBED
                                       type = "application/x-java-applet;jpi-version=1.4.2" \
                                       CODE = webposprint.WPMainApplet.class\
                                                 archive = WebPOSApplet.jar\
                                       WIDTH = 373 \
                                       HEIGHT = 167 \
                                       model =models/buckminsterfullerine.xyz \
                                            scriptable = false \
                                            pluginspage = "http://java.sun.com/products/plugin/index.html#download"> <NOEMBED>
    alt="Your browser understands the <APPLET>
    tag but isn't running the applet, for some reason."
    Your browser is completely ignoring the <APPLET>
    tag! </NOEMBED> </EMBED> </COMMENT>
    </OBJECT>
    <%*/%>
    This code doesn't seems working with Tomcat 5.5.12. I works fine with Tomcat 4.1.31
    Please help
    Thanks

    Applets run client side - which means the relevant class files need to be downloaded to the client.
    Anything under the WEB-INF directory is not directly accessible by the client. Nothing under WEB-INF can be downloaded.
    ergo, specifying the WEB-INF directory as part of your applet codebase is a bad idea.
    I would suggest try copying the applet classes from under WEB-INF to some other place in your application.
    Also, you should probably specify the full class name of your Applet in the plugin tag.
    <%@ page import="com.util.MyApplet" %>
    <jsp:plugin type="applet" code="com.util.MyApplet" codebase="/classes" width="250" height="100" jreversion="1.6">
         <jsp:fallback>
              <B>Unable to start plugin!</B>
         </jsp:fallback>
    </jsp:plugin>cheers,
    evnafets

  • Displaying Applet in JSP Using jsp:plugin tag

    The following code is not working eventhough i downloaded to JRE plug-in .Please help me to work the
    following code in JSP.
    <jsp:plugin code="mani.Clock2.class"
    codebase="/classes/" width=300 height=300
    jreversion="1.3"
    nspluginurl="http://java.sun.com/products/plugin/1.1.3/plugin-install.html"
    iepluginurl="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0">
    <jsp:fallback>
    <font color=#FF0000 size=10>Sorry Error While Loading Applet </font>
    </jsp:fallback>
    </jsp:plugin>

    why don't ypu just use the <applet> tag?

  • INSERT statement in JSP using variables

    People,
    I am having problems inserting data from JSP into a MySQL database.
    For example the following works perfectly fine:
    String query = "INSERT INTO `test2` (`name`, `topic`, `message`) VALUES ('Jane Doe', 'Hi there', 'Example message')";
    But, however the problems take place if I try to use variable values as parameters instead of pre-defined strings.
    E.g. the following (among a 100 other ways I have tried by now) does not work):
    String query = "INSERT INTO `test2` (`name`) VALUES (`" + userName +"`)";
    stmt.executeUpdate(query);
    This did not work either:
    PreparedStatement PStmt = myConn.prepareStatement("insert into (`name`) values (?)");
    PStmt.setString(1, new String("`" + userName + "`"));
    PStmt.executeUpdate();
    I have tried without parenthesis etc. but what I pretty much get every time is:
    500 Servlet Exception
    java.sql.SQLException: Column not found: Unknown column 'Jane' in 'field
    list'
         at org.gjt.mm.mysql.MysqlIO.sendCommand(MysqlIO.java:508)
         at org.gjt.mm.mysql.MysqlIO.sqlQueryDirect(MysqlIO.java:561)
         at org.gjt.mm.mysql.MysqlIO.sqlQuery(MysqlIO.java:646)
         at org.gjt.mm.mysql.Connection.execSQL(Connection.java:973)
         at org.gjt.mm.mysql.Connection.execSQL(Connection.java:897)
         at org.gjt.mm.mysql.Statement.executeUpdate(Statement.java:230)
         at org.gjt.mm.mysql.jdbc2.Statement.executeUpdate(Statement.java:99)
         at sql3_jsp._jspService(/sql3.jsp:49)
         at com.caucho.jsp.JavaPage.service(JavaPage.java:87)
         at com.caucho.jsp.JavaPage.subservice(JavaPage.java:81)
         at com.caucho.jsp.Page.service(Page.java:474)
         at com.caucho.server.http.FilterChainPage.doFilter(FilterChainPage.java:166)
         at com.caucho.server.http.Invocation.service(Invocation.java:277)
         at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:129)
         at com.caucho.server.http.RunnerRequest.handleRequest(RunnerRequest.java:334)
         at com.caucho.server.http.RunnerRequest.handleConnection(RunnerRequest.java:266)
         at com.caucho.server.TcpConnection.run(TcpConnection.java:140)
         at java.lang.Thread.run(Thread.java:484)
    I do not know much about SQL or JDBC but the material I have seen makes me believe
    that I am pretty much doing the right thing.
    What is the right way of doing this?
    I would greatly appreciate any feedback.

    Hi,
    I think i know the problem.
    Take a look on your String code :
    "INSERT INTO `test2` (`name`, `topic`, `message`) VALUES ('Jane Doe', 'Hi there', 'Example message')";
    it is not necessary to put QUOTE for the tablename and the fields.
    my code work with :
    String query = "INSERT INTO test2 VALUES( ' " + 123 + " ' ) ";
    ( if you inserting into all fields in your table ) OR
    String query = "INSERT INTO test2 ( abc ) VALUES( ' " + 123+ " ' ) ";
    ( if you need to select certain fields ).
    or you can try to refer to :
    http://www.w3schools.com/sql/sql_insert.asp
    hope this help.

  • INSERT statement with JSP

              Does anyone know how to create an INSERT statement with JSP using
              variables??
              I can do the insert if I code the values of the variables in the statement,
              but when I try to use variables to do the insert it tries to insert the
              variable name and not the value of the variable into the table.
              Thanks,
              Doug
              

    "Doug Schaible" <[email protected]> wrote in message news:<bicO7.1279268$[email protected]>...
              > I can do the insert if I code the values of the variables in the statement,
              > but when I try to use variables to do the insert it tries to insert the
              > variable name and not the value of the variable into the table.
              Doug,
              I think you missed the <%= blahblah %> syntax.
              Regards
              drit
              

  • Deploying an applet with jsp

    Hi,
    I am trying to make an applet accessible within a JSP, but it won't load, I have the following error in my browser's Java console:
    java.lang.ClassFormatError: Incompatible magic value 1013461310 in class file MyApplet
    The applet is in the same directory of the JSP that calls it wich is the root of the project. Here's the code in the JSP:
    <jsp:plugin type="applet" codebase="." code="MyApplet.class" width="408" height="410" >
    <jsp:fallback>
    Plugin tag OBJECT or EMBED not supported by browser.
    </jsp:fallback>
    </jsp:plugin>
    There are no preblems when I call the applet from a usual html file with the applet tag.
    What am I doing wrong?

    in order to pass information from your applet to the JSP page, you could call your JSP page from applet.
    you may for example open a new browser window whitch is redirected to your JSP page, and user responses are sent as parameter concatanated to the URL
    or you could use post instead of get, anyhow, the idea is that you try to connect to your JSP's url and send these user responses as well...
    but if you would like the page, on which the applet is, to change according to user response, then you cannot do that (if you are not changing content of forms -- that can be done with LiveConnect <- calling javascript from java applet)
    i hope you get some ideas.
    L.

  • 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
    Arthi

    Hi 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.

  • Calling applet in jsp file

    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,
    Rajkumar

    Review
    URL.openConnection()
    and HttpURLConnection

  • Applets in JSP --- I'm going crazy!

    I am using an applet I have written on a JSP page which I have also written.
    Using: Win2K, IE6, J2SDK 1.4, Tomcat 4.0.3
    I have several problems. Even if you can answer only one of them, it will be a great help!
    Here is how I'm adding the applet.
    <jsp:plugin type="applet" code="RawData.class" name="rawData" jreversion="1.4" width="700" height="55" >
    <jsp:fallback>
    Plugin tag OBJECT or EMBED not supported by browser.
    </jsp:fallback>
    </jsp:plugin>
    </TD>
    Problem 1) I can only get the applet loaded if the applet class file is in the same folder as the JSP file. Anything else, and I get a ClassNotFoundException.
    Can't get the CODEBASE to do anything for me at all.
    I set my codebase="/RawData/classes", but makes no difference.
    I then tried Jarring my applet and placing RawData.jar in the same folder with the JSP. But also no go. I then set codebase="RawData.jar", but guess what... Nothing.
    So my questions are: How do I get the applet to load from the applet.class files using codebase if the applet files are in a sub folder? And how do I get my applet to load from a Jar?
    Problem 2) Once this applet is loaded, I have the biggest nightmare imaginable to get the browser to load a new version after I have updated it. And trust me, there is not and old version of the applet.class in my ClassPath. In fact there is not another copy of the applet.class file anywhere on my PC. I made sure. I have also disabled the Java Plugin Cache option, and deleted my temporary internet files with Explorer. But the thing persists in loading the old version from somewhere. What the heck do I do? I fear this is driving me insane.. :)
    Problem 3) I need the HTML components to interact with the applet.
    When I do a call to an applet function passing no parameters it works fine, and I get the value back, like this:
    <SCRIPT LANGUAGE="VBScript">
    <!--
    Sub btnGetID1_OnClick
    document.all("id1Pattern").innerText = document.rawData.getSelection()
    End Sub
    -->
    </SCRIPT>
    But when I do a function call, passing parameters, the scrip just stops working altogether, like this.
    <SCRIPT LANGUAGE="VBScript">
    <!--
    Sub id1Pos_onfocus
    document.rawData.setSelection(5, 10)
    End Sub
    -->
    </SCRIPT>
    Why is this. What am I doing wrong.
    And better yet... Is there a way of manipulating the HTML components from within JSP scriplet <% ... %>?
    Please if anyone can help... It will be greatly appreciated. I am at a loss!
    Thanx. Quigrim

    Quigrim wrote:
    Problem 1) I can only get the applet loaded if the applet class file
    is in the same folder as the JSP file. Anything else, and I get a
    ClassNotFoundException. Can't get the CODEBASE to do anything for me
    at all.Set CODEBASE to point to the relative directory where your code is. If it is in the same directory as the JSP then CODEBASE="."; if it is in a sub-directory 'classes' then CODEBASE="classes".
    Problem 2) Once this applet is loaded, I have the biggest nightmare
    imaginable to get the browser to load a new version after I have
    updated it. Close ALL browser windows - you have to force the plugin JVM to re-initialise - I've not found any other way to do it.
    Hope these help you.
    Phil.

  • Process Monitor Diagram Applet in JSP

    Has anyone experienced to use Java Applet in JSP to display the process diagram, just as what you can see in the workflow console. I notice that WF_MONITOR has a getMonitorURL() API which returns a link that leads to Workflow Console, I feel this isn't user friendly. If I could bring what user exactly sees the process diagram in workflow console to Java JSP, it would be superb ...........
    any idea?
    Kun

    All I can think of is that you are using swing and
    including the necessary files via import statements in
    the code. This might cause the applet to run fine with
    the default Netscape JVM. On the other hand, when
    using the jsp:plugin tag the browser is instructed to
    download the Java2 plugin regardless of whether the
    applet will run or not. What I'm saying is that you
    probably don't have the Java2 plugin installed on your
    browser rather you have the necessary jar files in
    your classpath to support Java2. Does that make any
    sense?>
    CliffI don't have a shell CLASSPATH variable, and I'm not sure how to tell what CLASSPATH variable Netscape is using.
    The applet doesn't use Swing as far as I can tell, the code for this applet is at
    http://tmap.pmel.noaa.gov/~callahan/JAVA/map_v3.0/LiveMap_30.java.
    It appears to use only awt for imaging, which I think is considered Java1.
    A bit off topic:
    I have the javaplugin.so which ships with jdk1.3.1_01. However when I look under Edit->Preferences->Navigator->Applications and try to set the plugin used for application/x-java-applet I see that the setting is one for "Unknown - prompt user". Also if I look under Edit->Preferences->Advanced I can see that "Enable Java" is checked and activated but "Enable Java Plugin" is not checked and unavailable (it is greyed-out).
    1) How can I get Netscape to "know about" the plugin I have available in my JRE ?
    2) How can I tell Netscape to use this plugin for all things Java ?
    3) How is it that the applet runs fine when included in a HTML page, even though it appears that my browser's application settings aren't set up to handle applets correctly ?
    4) The Netscape Edit->Preferences->Advanced shows that Java is enabled but the plugin is not. I guess I'm missing something here as I thought that the Java plugin was required for anything Java related to run (such as applets) but this is obviously not so since the applet will run fine if coming from the HTML page.
    A bit perplexed...
    -James

  • How do I insert applets in DW CS6 for Mac?

    I am a student and my textbook lesson is asking me to insert an applet using insert, media menu but I do not have that option on the Mac version. I have an applet file and I've tried inserting it in as a plugin but when viewing it in the browser it has "pluging missing" in stead of the applet. How do I insert an applet in DW CS6 for Mac?

    Thanks for the reply Nancy, your help is much appreciated.
    I did have a problem with Java on my iMac but not on my Macbook Pro. My IMac Java hasn't worked correctly since Apple quit updating Java and turned the updates over to Oracle and the console application was removed from system settings.  I installed the Java JDK on my iMac (it was already installed on my Macbook Pro). The consol application is now in my system settings and when I go to the Java site, the JRE is running properly on my iMac where it wasn't before.
    I opened the page on both computers and it still says the same thing, "Missing Plugin". When I click on the words "Missing Plugin" it says "This page contains content that can't be shown because it's type is unspecified."
    I checked to see if Java was enabled and it was.
    I also updated the Java plugin before and after trying the page several times with the same result.
    I'm thinking that it's an error in the code because the code doesn't look quite right in my novice opinion.
    Below is the code I have in my webpage for the applet (formatting ans spacing may not display correctly on the forum page):
    <embed src="Applets/Fader.class" width="500" id="textScroll" height="90"      name="textScroll" delay="20" stop="4000" fontsize="16" fontstyle="1"      fontname="Arial" text0="Click each panel to view our portfolio."      text1="Experience a phorography session centered around you." text2="Let us      capture cherished family moments." text3="Contact us today to schedule your      session.">
    </embed>
    I've done a little javascript and php but this looks to be a java application class file which was provided by the textbook via web resource files.
    Thanks again!

  • Re: Embedding Applet in JSP which gets dynamic input| Pls help

    Hi All,
    We are into a project in Oracle Portal Server where in we want to embed a result of a standalone application(Which is applet) in JSP.
    This standalone application 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
    Arthi

    Well instead of generating entire applet ,you can have a generic applet which takes parameters as ( <PARAM name="name" value="value"> ) inputs and process those inputs to generate output.
    In this case the output of the stand alone program would be a object. And in JSP page you need to access this object, then you can get the values which need to be passed to Applet.
    Else
    1.Identify the real path of the applet class file
    ServletContext context = session.getServletContext();
    String realContextPath = context.getRealPath(request.getContextPath());2.Copy the file to a standard location in your web application
    Regards,
    -John-

  • How to import and display an applet from JSP

    i m using netbeans 5.0
    i have class named myapplet.class
    and jsp named myjsp.jsp
    now i want to access(import) this myapplet.class from jsp
    also i want to display this applet from this jsp
    i am able to do either thing but not both
    so please help me it is so urgent and important for me bcoz
    i have to complete my project as early as possible
    Thanks in advance

    my jsp source file page path is D:\Reliance
    project\WebApplication3\web\
    and classes path is D:\Reliance
    project\WebApplication3\build\web\WEB-INF\classes\
    so problem is that if i want to use myapplet.class
    then i have to put my class in D:\Reliance
    project\WebApplication3\build\web\WEB-INF\classes\
    location
    but at that time i am not able to display this applet
    on my jsp
    if i put my myapplet.class in
    D:\Reliance project\WebApplication3\web\ then i m
    able to display
    applet but not able to access(import) this class
    hope you will got the problem!!!
    thanks for your reply !!!try to set the path of your applet on jsp something like this
    "WEB-INF/classes/myclass.class"

  • How can I pass a variable to an applet in JSP?

    I want to invoke an Applet in JSP and pass a variable( ie. port) to the Applet. I do as follows:
    <applet code="best.Applet1.class" width=400 height=300 >
    <param name=port1 value=port>
    </applet>
    in Applet1.java , I use getParameter("port1"),yet I got character string "port" ,not the value of port(i.e. 100).
    How can I get 100 not "port"? Thanks!!!

    Assuming that port is a variable defined and initailized in the jsp:
    <applet code="best.Applet1.class" width=400 height=300 >
    <param name=port1 value=<%= port %>>
    </applet>

  • Java Applets not working using IE 6 after uninstalling software

    I uninstalled some software on WinXP using Add/Remove, however the software still left remnants on my system. I tried to removing all the entries in the registry with RegEdit....I will confess I am a rookie with that tool, however now IE 6 will not launch Java Applets on the web sites I visit.
    I also have Mozilla Firefox 8 installed and Java Applets work fine using that browser. Do I have to reinstall WinXP to correct IE 6, or is there an easier alternative?
    Thanks for any suggestions
    Gerry

    Please check out in the IE Explorer Tools--> Internet Options --> in this Advanced tab this will display you with the set of options and chceck boxes...
    in that please check out that whether the Java(SUN) --- (USe Java....<applet> Requires reStart...
    is existing or not if existing please check it and restart the system.
    if it is not existing in your broser then you have to install the JRE in the system for your Applet to work..
    That can be downloaded form...
    http://www.java.com/en/download/manual.jsp
    Here go for windows....
    All The Best..

Maybe you are looking for

  • After an update, iTunes no longer works

    I'm sorry for such a long story.  Several weeks ago, iTunes informed me of an available update.  I clicked to update.  The next time I open iTunes, the iTunes store no longer worked.  Everything else worked fine.  I solved this problem by uninstallin

  • Use of procedure in function

    Hi, Can we use Procedure in Function? Please elaborate with answers. Thanks, Sid

  • I Tunes - Sync (Btw Comps)

    Hi there, in conjunction with the NY, my laptop absolutely died on me yesterday - won't even register the power feed. I had my i-tunes installed on it, the back-up I have is a few months old... Is there a simple way of getting the material I have pur

  • Facebook website data on iPhone

    Hi, my daughters iPhone is showing 40.1kb, 26.1kb and various other amounts of data in settings, advanced website data. It is also showing 1.8 mb of Mail.google.com. She swears to me that she has not been on Facebook or does not have an account and t

  • Nokia n97 top10 bugs for me

    After connecting via USB, in some modes the memory for frontpage gets switched from Mass to C. This causes email settings etc lost. The above bug can also happen when battery dries out. Sometimes calendar entries time cannot be set with qwerty keyboa