Is it possible to send Java Object as parameter to an applet

Is there a way to communicate to the applet using java objects instead of String parameters.
can we do the following while invoking an applet
<applet code=some.class>
<param name=name value=object/>
</applet>
in applet
Object obj = (Object) getParameter("name");
Please le me know if you have any suggestions.
Thanks!

in the applet:
URL url = new URL("mypage.jsp?somearg=somevalue");
URLConnection conn = url.openConnection();
conn.connect();
ObjectInputStream in = new ObjectInputStream(conn.getInputStream());and in the JSP (although servlets would be better for this):
<%@page import="java.io.*, java.util.*"
%><% // This is important... if you are going to use JSP, you can't allow any newlines,
// which is why servlets are better for this type of thing...
String somearg = request.getParameter("somearg");
ObjectOutputStream objOut = new ObjectOutputStream(response.getOutputStream());
objOut.writeObject(someObject);
objOut.flush();
objOut.close();
%>

Similar Messages

  • Sending Java Objects to Flex

    Hi All ,
       I have a Flex+Java Application , which is running fine , and i am sending the List of employess to Flex from my Java(Struts) like :(In flex i am using HTTPService)(Employee is a java bean)
    XStream xstream = new XStream();
    EmpDAO dao=new EmpDAO();
    ArrayList<Employee> empList=null;
    empList=(ArrayList<Employee>) dao.getEmployees();
    response.setContentType("text/xml");
    xstream.toXML(empList,response.getWriter());
    This is working fine , but now my requirement is to send java Objects to Flex.
    Is there any way to send Java objects to Flex ??
    Please help me...

    Looks like the properties in your Java class are having
    default scope. Please make sure the getters and setters for the
    properties are public and are following Java beans naming
    conventions. Can you also try creating a DataPoint class in the
    Flex application and map it to the respective Java class. One more
    thing is that, can you change the type of "data" varible in the
    Flex application to ArrayCollection.
    Hope this helps.

  • Sending Java object using E-Mail

    Dear Experts,
    In my application I am trying write java Object in a file. Then I have to attach that file with an E-Mail. In the receiver side I have to download the file and read the Java Object from file.
    The Problem is , when I am sending and receiving mail using outlook Express, My file is reduced by some Kbs(Example , I am sending 66kb but I am receiving only 64Kb).
    If any of you have some ideas to solve the above problem, please let me know.
    With Thanks
    Panneer

    Perhaps you are trying to send binary but e-mail must be in text or the data will get filtered/mangled.

  • Send Java objects through a socket

    I want to send some java objects to a J2SE server from a J2me socket. In normal j2me socket there is no way of putting whole obejct to the output stream. Is there any way that you can send a object from a socket ? Please advice..
    Thanks.

    Check this article on making serializable objects in MIDP. If the objects you want to send receive across the network implement this, then you can easily transform them into byte arrays and back to objects so they can be sent across a network.
    shmoove

  • Calling Web Service Proxy with Custom java Object as parameter

    I created a web service proxy from WSDL URL using JDeveloper 11g(.5 version)
    I need to call a webservice method which takes custom Java Object( Ex: ABC.java) as Input parameter. It creates the XSD java (ABC.java) file for that.
    @XmlElementRef(name = "abc", namespace = "http://impl.service.ns.test", type = JAXBElement.class)
    protected JAXBElement<ABC> abc;
    ABC.java has a property of type java.util.Set of a custom Java Object (Set<XYZ.class>)
    It doesn't create xsd file for XYZ.java.
    @XmlElementRef(name = "XYZ", namespace = "http://model.ns.test/xsd", type = JAXBElement.class)
    protected JAXBElement<Set> xyz;
    Please help me.

    The passing of Java objects in and out of a web service is NOT supported. variables must be xml documents defined by a XML schema. In my opinion, missing Java object and WSDL is not a good idea. -Edwin

  • 32-bit JVM receiving Java objects from 64-bit JVM

    Hi folks,
    Question is: will there be problems for 32-bit JVM receiving Java objects from 64-bit JVM? and vice versa.
    Our application client is running on 32-bit JVM, our server is running on 64-bit JVM. Client will send Java objects to server, and vice versa.
    My past experience suggested when sending Java objects between client and server, both client and server needs to be compiled under the same JVM version. Any advice?
    Christy

    My past experience suggested when sending Java
    objects between client and server, both client and
    server needs to be compiled under the same JVM
    version. Any advice?This is only a case if you omit explicit serialVersionUID. My advice is to ALWAYS specify it for classes you want to serialize over the wire or put into persistent storage. It is way too tricky to rely on default one to fail half a year later when some new programmer adds one new public method to a class.
    Unless you need to deserialize already existing resources, there is no need to put any magic number in serialVersionUID - just put 1 for every class you create and possibly increase it by 1 every time you want to make incompatible version (which is not happening so often, as in real world you often try to stay as compatible as possible)

  • How to create new java objects in native methods?

    Hello,
    Is it possible to create java objects and return the same to the java code from a native method?
    Also is it possible to pass java objects other than String objects (for example, Vector objects) as parameters to native methods and is it possible to return such objects back to the java code?
    If so how can I access those objects (say for example, accessing Vector elements) inside the native code?
    What should I do in order to achieve them?
    Regards,
    Satish

    bschauwe is correct in that constructing Java objects and calling methods on Java objects from native code is tough and takes some study. While you're at it, you might want to check out Jace, http://jace.reyelts.com/jace. It's a free open-source toolkit that really takes the nastiness out of doing this sort of stuff. For example,/**
    * A C++ function that takes a java.util.Vector and plays around with it.
    public void useVector( java::util::Vector& vector ) {
      // Print out all the contents of the vector
      for ( Iterator it = vector.iterator(); it.hasNext(); ) {
        cout << it.next();
      // Add some new elements to the vector
      vector.addElement( "Hello" );
      vector.addElement( "world" );
    } All this code just results in calls to standard JNI functions like FindClass, NewObject, GetMethodID, NewStringUTF, CallObjectMethod, etc...
    God bless,
    -Toby Reyelts

  • Sending request object to another application

    Hi
    Is there any possibility to send request object from one Application context to another application context.
    We have two JEE enterprise application that deployed on different application server I want to know if there is any possibilty to send request object to them or not?
    I don't like to redirect reuqest because I want to put some value in req body (POST method)

    It is possible to get a request dispatcher to a servlet in another context by first getting the other context's ServletContext object. For example, in the original servlet's doPost method::
        ServletContext otherContext = this.getServletContext().getServletContext(uriToSecondContext);
        RequestDispatcher dispatcher = otherContext.getRequestDispatcher(uriToForwardTo)
        dispatcher.forward(request, response);In order to work both applications have to be configured to be allowed Cross Context access. In Tomcat you do this in the <Context ...> element of the configuration XML file by defining the crossContext attribute to "true".

  • How to use the Java objects or methods in pl/sql function as a parameter

    dear all,
    I java object passed as a parameter in pl/sql. how can i access the java objects as parameter in pl/sql function. please give a soultion to me
    mohan reddy

    I'm not sure whether this would help you.
    Have a look at this program to list files from a directory.
    CREATE GLOBAL TEMPORARY TABLE DIR_LIST
    ( FILENAME VARCHAR2(255) )
    ON COMMIT DELETE ROWS
    Table created.
    create or replace
    and compile java source named "DirList"
    as
    import java.io.*;
    import java.sql.*;
    public class DirList
    public static void getList(String directory)
    throws SQLException
    File path = new File( directory );
    String[] list = path.list();
    String element;
    for(int i = 0; i < list.length; i++)
    element = list;
    #sql { INSERT INTO DIR_LIST (FILENAME)
    VALUES (:element) };
    Java created.
    SQL>
    create or replace
    procedure get_dir_list( p_directory in varchar2 )
    as language java
    name 'DirList.getList( java.lang.String )';
    SQL> exec get_dir_list( 'C:\Bhagat' );
    PL/SQL procedure successfully completed.
    Thanks,
    Bhagat

  • Send a array of user-defined java objects to stored procedure

    hi,
    I´d like to know if its possible send java user-defined objects to a collection. I've tried the exemple bellow but it doesn´t work:
    1) In database
    -- nested table type
    create or replace type client_table_type is table of client%rowtype;
    -- table client:
    teste
    ( id number(18,0),
    name varchar2(80),
    birthday date)
    -- stored procedure
    create or replace package client_pkg
    is
    procedure insert_clients(
    p_array_clients client_table_type
    end;
    2) In Java
    java.lang.Class.forName ("oracle.jdbc.driver.OracleDriver");
    java.sql.Connection conn = java.sql.DriverManager.getConnection("jdbc:oracle:thin .....);
    ArrayDescriptor descriptor = ArrayDescriptor.createDescriptor("client_table_type", conn);
    ARRAY a2 = new ARRAY(descriptor, conn, anArrayIn);
    PreparedStatement ps = (PreparedStatement)conn.prepareStatement("{ call client_pkg.insert_clients(?) }");
    ps.setArray(1, a2);
    ps.execute();
    Where anArrayIn is an array of Client and Client is a java user-defined class with these attributes:
    public class Client{
    public long id;
    public String name;
    public Date birthday;
    3) when I´ve tried to run the java code its returned the error in the ArrayDescriptor line:
    Exception in thread "main" java.sql.SQLException: .....:
    Unable to resolve type: "SISSERV.CLIENT_TABLE_TYPE"
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
    at oracle.sql.ArrayDescriptor.initPickler(ArrayDescriptor.java:1976)
    at oracle.sql.ArrayDescriptor.<init>(ArrayDescriptor.java:199)
    at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:118)
    at teste_array_oracle.Carga.callPLSQL(Carga.java:60)
    at teste_array_oracle.Carga.<init>(Carga.java:41)
    at teste_array_oracle.Carga.main(Carga.java:32)
    erro de execuþÒo
    Tks for any help!

    A brief answer to this from my side (not knowing Java that wel), but hopefully suffices to put you on the right track.
    <p>
    A SQL user defined type is basically a class (it can contain properties and methods). It has only superficial resemblence to a traditional record struct. So you cannot use one. Even if you could (assuming you code a PL/SQL "traditional" record struct), there are issues around how char and numeric data are represented binary inside Oracle and issues around byte/word alignment.
    <p>
    So bottom line - what you're doing will not work (as the errors show).
    <p>
    Okay, so what then? Well, the OCI (Oracle Call Interface) supports all Oracle data types, including these user types (also called Advance Data Types in Oracle-speak). You therefore need to use the supplied API calls to deal with instantiated objects (structures) of these type.
    You're best bet is to have a look Oracle® Database Java Developer's Guide

  • Sending Custom Java Objects over XML!!

    Hello all !
    Can anybody please tell me how can I send custom Java Objects through XML? For example we can set attributes for a node using the setAttribute method, it accepts only strings, also the setTextContent method requires text and sets the node's value.Can I some way set my own Java object as the value of a particular node or attach it to the node?
    Thanks in advance.

    Kami_Pakistan wrote:
    So I should rather go for Marshalling or Serialization or is there any other work-around possible?I don't know. You didn't say what you had against text formats. Since all Java objects are composed of primitives when you get right down to the bottom, everything in Java can be serialized as text versions of those primitives. So you're going to have to explain why you think a work-around is necessary at all.

  • Send a Serializable java object as a payload in SOAPMessage

    Hi,
    I want to send any kind of java object (Serializable) as payload in SOAPMessage.
    I need the best solution to achive this.
    Regards,
    Riyaz..

    Lenine,
    Pardon me if I am stating the obvious here, but since you are talking about a java stored procedure, then you can use the "internal driver" to connect to the database. Have you read the relevant section of the documentation?
    (Note: Since I saw no details in your post regarding the Oracle version you are using, I have assumed the latest version, hence the above link.)
    Good Luck,
    Avi.

  • Is it possible to create the memory for a Java object in C/C++?

    Is it possible to have a C/C++ program allocate some memory, then have JNI use that memory for primitive java objects (such an array of bytes) that are passed to Java objects ?
    I would like to allocate a region of memory in C++, then give that memory to a Java object (via some kind of JNI type) and have that Java object fill the memory region with data.
    My impression from reading the JNI API and the few examples I've looked at is "No", there is a strict boundary between C++ and JNI as regards memory management. There may be serious implications as to why what I'm suggesting is not feasible, I am not enough of a JNI expert to know yet, and would greatly appreciate any input/comment.
    Many thanks,
    Colm.

    No, you cannot. However, writing your JNI code you should not use memory of Local Heap (if it possible). Because Local Heap Memory used also by JVM. I have developed tools that generate C++ wrappers for JNI code. In these wrappers I use mainly Global/Virtual Memory. I also reduce to minimum creation of local/global references, as it is affects to JVM memory use. If you are writing JNI code under MS Windows then you can try my tools that automate JNI code writing:
    http://simtel.net/product.php[id]93174[SiteID]simtel.net
    http://simtel.net/product.php[id]94368[SiteID]simtel.net
    Now I am developing this tool for .Net. In two weeks it will be finished.

  • Is it possible to send email notifications in UCM without workflow/java?

    Is it possible to send email notifications in UCM without workflow/java?
    I need to send email notifications when an item is checked-in ,without workflow and without java code.
    Thanks,
    Chely

    Yes. You need subscriptions - see here http://docs.oracle.com/cd/E23943_01/doc.1111/e10797/c04_working_with_files.htm#CSUSG899

  • Converting XML to Java Objects...possible?

    Hi, Am a newbie to JAXB. As far as I read, JAXB has facility to convert "XSD" (not XML) to Java "classes" (not objects). This can be done using xjc compiler. Can XML files (i.e. ones with data) be converted to Java objects (retaining the data from XML files)? If yes, please throw some light on how it can be done. If no, then is there some java technology to do such a thing?
    Thanks.

    http://xmlbeans.apache.org/

Maybe you are looking for

  • Error message when importing CD's into iTunes.

    I've just started getting an error message when importing audio CD's into itunes. +"Error occured while converting the file "........". The disk could not be read from or written to."+ I've been importing CDs for years now and this just started happe

  • How do you change your apple id on the ipod

    how do you change your apple id on the ipod

  • GUI_UPLOAD can't upload data in a tab-delimited text file

    Hi. I was trying to upload data in a tab-delimited textfile. I could do it for a ASC textfile (by setting FILETYPE = 'ASC'), but I couldn't do it for a tab-delimited textfile (by setting FILETYPE = 'DAT'). Any help is appreciated.

  • Benifits of 10g(Application Server)

    Hi, I want to know the benifits of oracle 10g(Application Server) as compare to Developer 6i.Actually we are using an application built on forms6i & reports6i with Oracle 9i database.We want to convert that application on Oracle 10g(Application Serve

  • How to identify blocked stock to the concern GR inspection stock

    Dear All, my client want to have tracking for blocked stock posted good against the the same GRN. is there is any way or any T-code to indetify the concer related stocks. Please provide your valuable solution, it may help me to resolve the issue ...