JSP & APPLET

Hi guys,
I am studying about Java Server Pages, I lear that the jsp:plugin tag of JSP techcnology have support for this. Then I create a simple swing applet and a JSP page like fellow:
<jsp:plugin type="applet" code="package.MyApplet" width="450" height="350">
    <jsp:params>
        <jsp:param name="param1" value="value1"/>
    </jsp:params>
</jsp:plugin>But when I try to load the jsp page the browser (Netscape run on linux) show the download plugin dialog!!! What I can do to the browser get the applet?!?! I install de j2sdk and I have the Java Plug in (do I need to create a environment variable for it, or configure in netscape?!?!)
Another question, I am using the Tomcat, Do I need to "describe" the applet in the web.xml descriptor file?!! If yes How I can do this!?!?
Thanks everyone.
Giscard

This question have been asked and answer before. Use the search button to locate issues.
What OS
In Windows, go to control panel by typing control in command line console, locate your java plugin and enable netscape and iexplorer. Does older browser do not support java plugin so you need the later version of browser. Mozilla is a good choice.
You cannot configure XML descriptor file to use plugin.

Similar Messages

  • JSP applet tag X Html applet tag (what is the difference?)

    what is the advantage in using the JSP applet tag instead of a simple Html applet tag ?
    second question:
    I have an applet in a Html frame, and a menu on the left side.... When the user select the applet option at first time, everything runs ok.. after the user select another option and then select the applet again, it fails in some features .. Why ?

    well, if by "the JSP applet tag", you mean the jsp:plugin tag.. that will just generate the same HTML tag you would write. The only advantage would be it should be less typing to use the taglib.
    second answer:
    without seeing any code, it'd be hard to figure out the problem. The obvious thing is you are setting some state of something that is preventing further action.

  • JSP Applet communication

    Hi all ,
    I know this question has been asked so many times and I have read all the posts but still i was unsuccessful.
    I am trying to send a string from a jsp to another jsp which is loading the applet to display that string.
    In my first jsp:
    <form method=post action="hello.jsp">
    <input type="text" name="formDesc" value="IBMTR/ABMTR Form" size="20" maxlength="20">
    <input type=submit name="Go" class="submituttontext" value="Go">
    </form>     
    in my seccond jsp:
    <APPLET CODE="ParamTest.class" WIDTH="400" HEIGHT="50">
    <PARAM NAME="font" VALUE="Dialog">
    <PARAM NAME="size" VALUE="24">
    <PARAM NAME="string" VALUE="Hello, world ... it's me. :)">
    <PARAM NAME="formDesc" VALUE="<%=request.getParameter("formDesc");%>">
    </APPLET>
    in my applet:
    String myFont = getParameter("font");
    String myString = getParameter("string");
    int mySize = Integer.parseInt(getParameter("size"));
    String desc =getParameter("formDesc");
    Font f = new Font(myFont, Font.BOLD, mySize);
    g.setFont(f);
    g.setColor(Color.red);
    g.drawString(myString, 20, 20);
    g.drawString(desc, 40, 40);
    but nope i cannot see...formDesc ..I jus see the <%=getParameter%>
    Thanx

    At first glance the only error I see is:
    <PARAM NAME="formDesc" VALUE="<%=request.getParameter("formDesc");%>">
    should be changed to:
    <PARAM NAME="formDesc" VALUE="<%=request.getParameter("formDesc") %>">
    No semicolon in expressions. This should give you JSP compile error, so maybe that was just a typo in your post and not the real problem.
    Let me know.

  • JSP & APPlet - HTML

    Hi All,
    I am new to web development platform. I know core java, now as I need to proceed to web development I would like to know certain concepts / languages used.
    Jsp - Jsp is used to develop webpages, how does it differ from html.
    Applets - We can develop web pages using applets. Then what are the circumstance we use applets, jsp.
    JSP & Applets - Can JSP and Applet both used to create a webpage? If yes how?
    Kindly answer my question. Thank you.
    Regards,
    lg

    Go look up a basic tutorial dude.
    Basically JSP lets you create an HTML page on the fly. Rather than just serving up a static page, you customise it for each request.
    This gives a pretty good example of how JSP fits into things
    http://www.javaranch.com/journal/200510/Journal200510.jsp#a1
    Applets - Its a program running on a web page. I kinda lump them into the same box as "flash" and "activex". They let you step outside the bounds of html which a webpage is tied to. That has both advantages and disadvantages. Most web applications don't use applets.

  • JSP, APPLET and JNLP

    OK, here is my question, we have a simple (sic) application, which consists of jsps, applets ( Runtime.exec ), I have been suggested to use jnlp and jws, A typical JSP page looks like this.
    <% %>
    :Bunch of JSP /HTML stuff
    <APPLET>
    </APPLET>
    Bunch of jsp/HTML/javascript stuff
    How should i go about changing it to jsp + jnlp, Any insight is helpful.
    Thanks.

    OK, here is my question, we have a simple (sic) application, which consists of jsps, applets ( Runtime.exec ), I have been suggested to use jnlp and jws, A typical JSP page looks like this.
    <% %>
    :Bunch of JSP /HTML stuff
    <APPLET>
    </APPLET>
    Bunch of jsp/HTML/javascript stuff
    How should i go about changing it to jsp + jnlp, Any insight is helpful.
    Thanks.

  • JSP - Applet problem

    Hi
    How do I call an Applet from JSP?
    I have a applet that talks with jsp which talks to a bean, the connection between jsp and the bean is okay but between jsp and the applet im not sure how to do. Any suggestions?
    Jonas

    Yes JSP is an extension of Servlets, bu you have to understand the difference and the need why JSP's are created and where it fits the best. For you situation I assuming you want to access a JSP page which has an applet in a browser, then to interact the applet which needs to communicate the server it came from(not necessarily that particular JSP). If that is the case you need and a Servlet for the rest of the communication(Servlets are better choice whent there is no presentation going back to the client) which is just exchange of data between the servlet and the Applet.
    The Applet and the servlet could communicate through sockets or URLConnection or even RMI which ever you feel more convertible(RMI if you are passing objects).

  • JSP- Applet- Servlet- JSP

    Ok, I know there are better ways to do what I am about to describe, but due to numerous circumstances this is my only option:
    I have a JSP that runs an Applet - All Good
    I have that Applet talk to a Servlet - All Good
    I need that Servlet to the load the original JSP - How?
    The entire process should look like this to the user:
    1) Load JSP
    2) Click a button, runs Applet
    3) Applet communicates with Servlet
    4) Servlet puts some data in the Request
    5) The original JSP is reloaded in the same browser window
    How do I do step #5?
    -or-
    Can I have the Applet put some data in the request and go directly to the JSP?

    You can use the "response.sendRedirect(<String url>)" for Servlet.

  • Please help me....JSP & Applet Translation

    Hi!!!
    I did the following JSP, and it run very well:
    <!doctype html public "-//w3c//dtd html 3.2//en">
    <html>
    <!-- Copyright (c) 1999-2000 by BEA Systems, Inc. All Rights Reserved.-->
    <head>
    <title>Query of Municipalities</title>
    </head>
    <body bgcolor=#FFFFFF>
    <font face="Helvetica">
    <h1>
    <font color=#DB1260>
    Municipalities List
    </font>
    </h1>
    <%@ page import="
    weblogic.db.jdbc.*,
    weblogic.html.*,
    java.sql.*,
    java.awt.*
    " %>
    <p>
    <%
    Connection conn = null;
    try {
    Class.forName("weblogic.jdbc.pool.Driver").newInstance();
    conn = DriverManager.getConnection("jdbc:weblogic:pool:DESAPool");
    catch (Exception e) {
    e.printStackTrace();
    Statement stmt = conn.createStatement();
    ResultSet rs = stmt.executeQuery("SELECT * from CAT_MUNICIPIO");
    %>
    <%!
    int cont=0;
    String mun[] = new String[1000];
    %>
    <%
    while (rs.next())
    mun[cont++] = rs.getString(3);
    %>
    <form method="post" name="p3" action="p3.jsp">
    <table border=0 cellspacing=2 cellpadding=2 width=80%>
    <tr>
    <td width=30%><font face="Helvetica"><b>Municipio</b></td>
    <td><font face="Helvetica"><select name="p3">
    <%
    for (int c = 0; c < cont; c++) {
    %>
    <option value=mun[c]><%= mun[c] %></option>
    <%
    %>
    </select></td>
    </tr>
    </table>
    </form>
    <%
    rs.close();
    stmt.close();
    conn.close();
    %>
    <p>
    <font size=-1>Copyright (c) 1999-2000 by BEA Systems, Inc. All Rights Reserved.
    </font>
    </font>
    </body>
    </html>
    Now I�m doing the translation to a applet...but I don�t obtain the information in the choice element.
    My applet is:
    import java.awt.*;
    import java.net.*;
    import java.applet.*;
    import java.sql.*;
    import java.awt.event.*;
    import java.io.*;
    import weblogic.html.*;
    import weblogic.common.*;
    import weblogic.db.jdbc.*;
    import weblogic.common.internal.*;
    public class p3 extends Applet { 
    Connection conn = null;
    Choice Municipios = new Choice();
    int cont = 0;
    String Municipios_array[] = new String[1000];
    public void init() {
    try {  
    Class.forName("weblogic.jdbc.pool.Driver").newInstance();
    Connection conn = DriverManager.getConnection("jdbc:weblogic:pool:DESAPool");
    Statement stmt = conn.createStatement();
    ResultSet rs = stmt.executeQuery("SELECT * FROM cat_municipio");
    while(rs.next()) {
    Municipios_array[cont++] = rs.getString(3);
    for (int c = 0; c < cont; c++) {
    Municipios.addItem(Municipios_array[c++]);
    add(Municipios);
    rs.close();
    stmt.close();
    conn.close();
    }catch (Exception e) {
    e.printStackTrace();
    Is like the information doesn�t put into the choice element....
    Somebody could help me please?....
    Thanks in advance.....
    Mary

    ok....excuse me....i did a mistake...but now I already add the line....my applet t1.java is:
    import java.awt.*;
    import java.net.*;
    import java.applet.*;
    import java.util.Vector;
    import java.util.Properties;
    import java.sql.*;
    import java.awt.event.*;
    import java.io.*;
    import weblogic.html.*;
    import weblogic.common.*;
    import weblogic.db.jdbc.*;
    import weblogic.common.internal.*;
    import javax.swing.JApplet;
    import java.awt.Dimension;
    import java.awt.Toolkit;
    import java.awt.BorderLayout;
    import javax.swing.JFrame;
    import javax.swing.UIManager;
    import javax.swing.JTabbedPane;
    import java.awt.Rectangle;
    import javax.swing.JPanel;
    import java.awt.event.MouseListener;
    import java.awt.event.MouseEvent;
    import javax.swing.JLabel;
    //import oracle.jdeveloper.layout.XYLayout;
    //import oracle.jdeveloper.layout.XYConstraints;
    import javax.swing.JComboBox;
    import javax.swing.JList;
    import javax.swing.JEditorPane;
    import java.awt.Font;
    import javax.swing.JSlider;
    import javax.swing.JTextArea;
    import javax.swing.JTextPane;
    import javax.swing.JTree;
    public class t1 extends Applet {
    Choice Municipios = new Choice();
    String Municipios_arr[] = new String[1000];
    public void init() {
    try {  
    Class.forName("weblogic.jdbc.pool.Driver").newInstance();
    Connection conn = DriverManager.getConnection("jdbc:weblogic:pool:DESAPool");
    Statement stmt = conn.createStatement();
    ResultSet rs = stmt.executeQuery("SELECT * FROM cat_municipio");
    int cont = 0;
    while(rs.next())
    Municipios_arr[cont++] = rs.getString(3);
    for (int c1 = 0; c1 < cont; c1++)
    Municipios.addItem(Municipios_arr[c1]);
    add(Municipios);
    rs.close();
    stmt.close();
    conn.close();
    }catch (Exception e) {
    e.printStackTrace();
    But the console sends the followig:
    Java (TM) Plug-in: Versi�n 1.3.1_02
    Usar versi�n JRE 1.3.1_02 Java HotSpot(TM) Client VM
    Directorio local del usuario = C:\Documents and Settings\Administrador
    Configuraci�n del delegado: sin delegado
    c: clear console window
    f: finalize objects on finalization queue
    g: garbage collect
    h: display this help message
    l: dump classloader list
    m: print memory usage
    q: hide console
    s: dump system properties
    t: dump thread list
    x: clear classloader cache
    0-5: set trace level to <n>
    java.lang.ClassNotFoundException: java.io.FileNotFoundException: File not found: http://172.21.9.23/gep/alterno/1/weblogic/jdbc/pool/Driver.class
         at sun.plugin.protocol.jdk12.http.HttpURLConnection.getInputStream(Unknown Source)
         at java.net.HttpURLConnection.getResponseCode(Unknown Source)
         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)
         at sun.applet.AppletClassLoader.findClass(Unknown Source)
         at sun.plugin.security.PluginClassLoader.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 java.lang.ClassLoader.loadClassInternal(Unknown Source)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Unknown Source)
         at t1.init(t1.java:49)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    The line no. 49 is:
    Class.forName("weblogic.jdbc.pool.Driver").newInstance();
    I think that in the server i have to add some code line in the classpath f...but I don�t which is it....
    Could you help me please?....
    Thanks...

  • Jsp-applets

    i want to pass values to applet from my jsp. am using <object>tag and am getting the values dynamicaly from database and i want to pass in while loop using <param>
    tag.i have tried something as below.but its not working.pls help me.
    <object type="applet" code="applet1.class">
    while(resultset.next())
    String s1=resultset.getString("xxx");
    %>
    <param name=xx value="<%= s1 %>"></param>
    <%
    pls send me the correct coding .
    thank u

    Couple of suggestions:
    1.declare your variable outside the while loop. You can null it if you like after you use it.
    2. have to specify a variable created with java code with the <%= %> signs- see below.
    Good luck.
    <%
    String s1;
    %>
    <applet name="applet1" code="packageName.appName.class"
    archive="appName.jar" codebase="" >
    <%
    while(resultset.next())
    s1=resultset.getString("xxx");
    %>
    <param name=xx value="<%= s1 %>">
    <%
    %>
    </applet>     

  • Focus on JSP Applet

    Hi,
    I have an application where an applet loads when the appropriate part is clicked from a tree. The problem here is the focus does not directly get on the applet and instead i first have to click on it to activate it. Can any one please tell me how to focus on the applet directly.
    Thanks,
    Sharath

    r u use <applet> tag independently with out depending or inside any click or load functions...
    check it ...
    r post ur code

  • JSP - Applet Object communication.

    Hi,
    I would like to know, what is the best way to pass Java Objects to Applet.
    My module requires a complex JTree to be dynamically constructed by the Applet, thus making the Applet very process intensive.
    To optimize the performance I want to write some components to generate the TreeModel (or relevant Value Objects) and the components will just pass objects to the Applet.
    In short I am trying to implement it as a MVC architecture, where my Applet is a thin View.
    However I do not know how to pass objects to Applets, I believe <param> tags are only useful for passing String datatypes, hence I am looking for alternatives, any recommendations on patterns/perfomance issues are welcomed.
    Thanks.
    Rgds,
    Shafique Razzaque,
    Singapore.

    Previous poster has a point. However, this is a way of reading an object through an ObjectInputStream.
    String servletLoc = "http://10.10.10.10/servlet/Servlet";
    URL servletURL = new URL(servletLoc);
    URLConnection servletConnection = servletURL.openConnection();
    servletConnection.setUseCaches (false);               
    servletConnection.setDefaultUseCaches(false);               
    servletConnection.setDoInput(true);
    servletConnection.setRequestProperty("Content-type", "application/octet-stream");
    ObjectInputStream inputFromServlet = new ObjectInputStream(servletConnection.getInputStream());    
    JTree someTree = (JTree) inputFromServlet.readObject();

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

  • How to use jsp:plugin type="applet" in jsp

    Hi ,
    I have a JSP File.
    How to use jsp:plugin tag in that.
    When I specify the file name in code="applet.class" Then it is giving an error saying that It could not find the class.
    What is the solution for this.

    its not working.. it shows exception class not found exception.
    i have placed the jsp and applet class in the same folder. but its not working.
    jsp file path : OracleSpatial\mypackage\webmap.jsp
    applet class : OracleSpatial\mypackage\demoApplet.class
    demoApplet class inside package "mypackage".
    code inside JSP is :
    <jsp:plugin type="applet"
    code="mypackage.demoApplet.class" width = "100%" height = "100%" >
    </jsp:plugin>

  • How can I use a applet in a JSP file?

    hi
    I failed to use applet in a jsp file.My workspace is a BC4J type. I put the applet's source file in business component project.the jsp is in JSP project.
    The jsp file calls applet by <jsp:plugin></jsp:plugin> style.
    The error is can't find the applet class.
    why? Thank someone for give me help.

    Actually using jsp applet tags does not mean that it is taking care of that the classes are available. It simply renders the Applet tag tothe JSP page. If e.g. teh codebase is specified as /java/, then there should be a mapping to the Java class location with thename of /java/. If codebase is not provided, then the Java class must be in the classpath of the JSp servlet.
    Frank

  • 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

Maybe you are looking for

  • Trying my hardest to download lightroom with no luck no matter what i update. Will Lightroom 5 run on Vista?

    I currently have Windows Vista. I know its an old system but bare with me. I am trying to download the trial of lightroom to see if its what im looking for as I dont want to spend the money but be let down. Every time i try it says i am running an op

  • CONFUSE

    Hello, i am having big confusion about the mandatory fields of fico tables, i asked the question regarding the same in expert somebody told me that mandatory fields are already clikmark in the filed of key/intial there i am having doubt that ok some

  • Office 2004 for the Mac

    When saving Excel files in a networked environment to their Home Document Folder the user gets the message 'Document not Saved'. The message offers no other information. The user can not 'Save' or 'Save As'. The document is already saved in the users

  • Cant Accept funds?

    I recently recieved a payment for an item I sold. The funds have sent but PayPal wont let me accept the funds because I am not verified. I have been using PayPal for a long time both purchasing and selling and have never had a problem until today? Wh

  • Photoshop/Lightroom @$9.99 month

    I signed up for Photoshop CS6 (only) for $9.99 a month when it was first offered. Now they include Lightroom 5. My monthly invoice says it is only for Photoshop. Anyone know how to upgrade to get the additional Lightroom 5 without canceling the one I