Inter servlet  communication......is it  possible ?

here i have posted "Inter servlet communication......is it possible ?"
have u come across this ?
http://forum.java.sun.com/thread.jspa?threadID=588996
thank you

sorry for the cross post. It wont be again. In fact i refered the link if anybody could give some comment. i saw some poster also post questions from diffrent topics of java.
My english is not good .
But why you are so tough on me ? you are targetting me in some of my posts. you have been helping learners for a long time . Old archieve /posts prove that. I dont claim my post are expert level. If you feel those are too simple for you plz ignore that.
thank you

Similar Messages

  • Apache inter server communication possible?

    Hi,
              we are using two Apache web servers and four WLS 5.1 server instances. Each
              Apache instance uses the WLS 5.1 proxy plugin. The HTTP session objects are
              replicated via in memory state replication.
              My question is:
              Is it possible for the two Apache instances to communicate with each other
              to ensure that each requests within one client session is forwarded to the
              same WLS instance
              or
              do we have to ensure by other means that each request within a client
              session is forwarded to the same Apache instance to enable its proxy to
              determine the proper WLS instance?
              The same question in a short version: Is there such a thing as
              inter-webserver-plugin communication for WLS 5.1?
              Thanks Wolf
              

              Just make sure that they all apache servers are configured identical and the proxy
              does the right thing.
              -- Prasad
              "Giri Alwar" <[email protected]> wrote:
              >The weblogic proxy residing in your Apache server(s) determines the primary
              >and secondary weblogic instances from the request (either from the cookie
              >or
              >from the URL through URL re-writing). There is no inter-proxy communication
              >going on and you do not have to worry about routing requests to the same
              >Apache server for a client. Regular load-balancing among the Apache servers
              >will do.
              >Giri
              >
              >"Wolf.Schlegel" <[email protected]> wrote in message
              >news:[email protected]...
              >> Hi,
              >>
              >> we are using two Apache web servers and four WLS 5.1 server instances.
              >Each
              >> Apache instance uses the WLS 5.1 proxy plugin. The HTTP session objects
              >are
              >> replicated via in memory state replication.
              >>
              >> My question is:
              >>
              >> Is it possible for the two Apache instances to communicate with each
              >other
              >> to ensure that each requests within one client session is forwarded
              >to the
              >> same WLS instance
              >>
              >> or
              >>
              >> do we have to ensure by other means that each request within a client
              >> session is forwarded to the same Apache instance to enable its proxy
              >to
              >> determine the proper WLS instance?
              >>
              >> The same question in a short version: Is there such a thing as
              >> inter-webserver-plugin communication for WLS 5.1?
              >>
              >> Thanks Wolf
              >>
              >>
              >>
              >
              >
              

  • Need help with applet servlet communication .. not able to get OutputStream

    i am facing problem with applet and servlet communication. i need to send few image files from my applet to the servlet to save those images in DB.
    i need help with sending image data to my servlet.
    below is my sample program which i am trying.
    java source code which i am using in my applet ..
    public class Test {
        public static void main(String argv[]) {
            try {
                    URL serverURL = new URL("http://localhost:8084/uploadApp/TestServlet");
                    URLConnection connection = serverURL.openConnection();
                    Intermediate value=new Intermediate();
                    value.setUserId("user123");
                    connection.setDoInput(true);
                    connection.setDoOutput(true);
                    connection.setUseCaches(false);
                    connection.setDefaultUseCaches(false);
                    // Specify the content type that we will send binary data
                    connection.setRequestProperty ("Content-Type", "application/octet-stream");
                    ObjectOutputStream outputStream = new ObjectOutputStream(connection.getOutputStream());
                    outputStream.writeObject(value);
                    outputStream.flush();
                    outputStream.close();
                } catch (MalformedURLException ex) {
                    System.out.println(ex.getMessage());
                }  catch (IOException ex) {
                        System.out.println(ex.getMessage());
    }servlet code here ..
    public class TestServlet extends HttpServlet {
         * Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods.
         * @param request servlet request
         * @param response servlet response
         * @throws ServletException if a servlet-specific error occurs
         * @throws IOException if an I/O error occurs
        protected void processRequest(HttpServletRequest request, HttpServletResponse response)
                throws ServletException, IOException {
             System.out.println(" in servlet -----------");
            response.setContentType("text/html;charset=UTF-8");
            PrintWriter out = response.getWriter();
            ObjectInputStream inputFromApplet = null;
            Intermediate aStudent = null;
            BufferedReader inTest = null;
            try {         
                // get an input stream from the applet
                inputFromApplet = new ObjectInputStream(request.getInputStream());
                // read the serialized object data from applet
                data = (Intermediate) inputFromApplet.readObject();
                System.out.println("userid in servlet -----------"+ data.getUserId());
                inputFromApplet.close();
            } catch (Exception e) {
                e.printStackTrace();
                System.err.println("WARNING! filename.path JNDI not found");
            } finally {
                out.close();
        @Override
        protected void doGet(HttpServletRequest request, HttpServletResponse response)
                throws ServletException, IOException {
            System.out.println(" in foGet -----------");
            processRequest(request, response);
         * Handles the HTTP <code>POST</code> method.
         * @param request servlet request
         * @param response servlet response
         * @throws ServletException if a servlet-specific error occurs
         * @throws IOException if an I/O error occurs
        @Override
        protected void doPost(HttpServletRequest request, HttpServletResponse response)
                throws ServletException, IOException {
            System.out.println(" in doPost -----------");
            processRequest(request, response);
         * Returns a short description of the servlet.
         * @return a String containing servlet description
        @Override
        public String getServletInfo() {
            return "Short description";
        }// </editor-fold>
    }the Intermediate class ..
    import java.io.Serializable;
    public class Intermediate implements Serializable{
    String userId;
        public String getUserId() {
            return userId;
        public void setUserId(String userId) {
            this.userId = userId;
    }

    Hi,
    well i am not able to get any value from connection.getOutputStream() and i doubt my applet is not able to hit the servlet. could you review my code and tell me if it has some bug somewhere. and more over i want to know how to send multiple file data from applet to servlet . i want some sample or example if possible.
    do share if you have any experience of this sort..
    Thanks.

  • Applet/servlet communication for byte transmission

    Hello all !
    I wrote an applet to transfer binary file from web servlet (running under Tomcat 5.5) to a client (it's a signed applet) but I have a problem of interpretation of byte during transmission.
    the code of the servlet is :
            response.setContentType("application/octet-stream");
            ServletOutputStream sos = response.getOutputStream();
            FileInputStream fis = new FileInputStream(new File(
                    "C:\\WINDOWS\\system32\\setup.bmp"));
            byte[] b = new byte[1024];
            int nbRead = 1;
            while (nbRead > 0) {
                nbRead = fis.read(b);
                System.out.println("octets lus = " + nbRead);
                sos.write(b, 0, nbRead-1);
            fis.close();
            sos.close();et le code de l'applet qui appelle cette servlet est :
            URL selicPortal = null;
            try {
                selicPortal = new URL(
                        "http://localhost:8080/AppletTest/servlet/FileManipulation");
            } catch (MalformedURLException e) {
                e.printStackTrace();
            URLConnection selicConnection = null;
            try {
                selicConnection = selicPortal.openConnection();
            } catch (IOException e) {
                e.printStackTrace();
            selicConnection.setDoInput(true);
            selicConnection.setDoOutput(true);
            selicConnection.setUseCaches(false);
            selicConnection.setRequestProperty("Content-Type",
                    "application/octet-stream");
            try {
                InputStream in = selicConnection.getInputStream();
                FileOutputStream fos = new FileOutputStream(new File(tempDir
                        + "\\toto.bmp"));
                byte[] b = new byte[1024];
                int nbRead = in.read(b);
                while (nbRead > 0) {
                    fos.write(b);
                in.close();
                fos.close();
             } catch (IOException ioe) {
                ioe.printStackTrace();
            }the file dowloaded is broken. it seems that bytes 01 00 or 00 01 are not correctly process.
    Some ideas to help me please ?

    hi,
    have you solved this issue.. please post me the code since i m also doing the applet/servlet communication and can use your code as reference.
    how to read the content placed in the urlConnection stream in the servlet
    Below is my code in applet
    public void upload(byte[] imageByte)
              URL uploadURL=null;
              try
                   uploadURL=new URL("<url>");
                   URLConnection urlConnection=uploadURL.openConnection();
                   urlConnection.setDoInput(true);
                   urlConnection.setDoOutput(true);
                   urlConnection.setUseCaches(false);
                   urlConnection.setRequestProperty("Content-type","application/octet-stream");
                   urlConnection.setRequestProperty("Content-length",""+imageByte.length);
                   OutputStream outStream=urlConnection.getOutputStream();
                   outStream.write(imageByte);
                   outStream.close();
              catch(MalformedURLException ex)
              catch(IOException ex)
    How can i read the byte sent on the outstream (in above code) in the servlet.
    Thanks,
    Mclaren

  • Asynchronous applet-servlet communication

    Hi all,
    I am trying to implement asynchronous applet-servlet communication and need your help. Anything would help(I tried with synchronous applet-servlet communication but doesn't solve my problem).
    Thanks,

    http://java.sun.com/docs/books/tutorial/networking/index.html
    You can open a socket connection. Bother the client and the server
    can have separate threads for reading and writing and that you gives you
    asynchronous communication. Later, if you think the server is generating
    too many threads and not scaling, you can use features of .java.nio to
    make it more scalable:
    java.nio.channels

  • Is there a good advanced review on applet-servlet communication

    I am working on a web application and unfortunately experiencing a lot of trouble trying to use an applet as front end which interacts with a couple of servlets running on Tomcat. I need to get data from one servlet and send data to another.
    There is a lot of messages posted in this and other forums about how to do this, but none of them got a response pointing to a useful advanced reference on this subject. I have reviewed some of the references given, but couldn't find a thorough detailed advanced reference on applet-servlet communication. For this I mean an exhaustive explanation of the mechanism of communication and when and when is neccesary to use each of the multiple configuration possibilities regarding content-type, message-length, request-method, connection settings, and so on.
    Would anybody be so kind to show me the right direction? As I read the (literally) hundreds of messages posted on this topic, I see this info as widely useful. Most of the topic tracks ends on void or with painful no-way sentences, and maybe many people is avoiding Java technology on web application because of this problem (development delays can abort a project).

    This sample chapter in Java developers' guide to Servlets and Jsp focuses on Applet-Servlet communication, is a pretty good one, and is free :
    http://www.javaranch.com/bunkhouse/samps/2809ch12.pdf
    As to an exhaustive & complete guide that covers absolutely everything, I may be wrong but I doubt you'll find anything like that...unless there is a book somewhere dedicated to the subject.

  • Applet-servlet communication, object serialization, problem

    hi,
    I encountered a problem with tomcat 5.5. Grazing the whole web i didn't find any solution (some guys are having the same problem but they also got no useful hint up to now). The problem is as follows:
    I try to build an applet-servlet communication using serialized objects. In my test scenario i write a serialized standard java object (e.g. a String object) onto the ObjectOutputStream of the applet/test-application (it doesn't matters wheter to use the first or the latter one for test cases) and the doPost method of the servlet reads the object from the ObjectInputStream. That works fine. But if i use customized objects (which should also work fine) the same code produces an classnotfound exception. When i try to read and cast the object:
    TestMessage e = (TestMessage)objin.readObject();
    java.lang.ClassNotFoundException: TestMessage
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1359)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1205)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    ...That seems strange to me, because if i instantiate an object of the same customized class (TestMessage) in the servlet code, the webappclassloader doesn't have any problems loading and handling the class and the code works fine!
    The class is located in the web-inf/classes directory of the application. I've already tried to put the class (with and without the package structure) into the common/classes and server/classes directory, but the exception stays the same (I've also tried to build a jar and put it in the appropriate lib directories).
    I've also tried to catch a Throwable object in order to get information on the cause. But i get a "null" value (the docu says, that this will may be caused by an unknown error).
    I've also inspected the log files intensively. But they gave me no hint. Until now I've spend a lot of time on searching and messing around but i always get this classnotfound exception.
    I hope this is the right place to post this problem and i hope that there is anyone out there who can give me some hint on solving this problem.
    Kindly regards,
    Daniel

    hi, thanks for the reply,
    all my classes are in the web-inf/classes of the web-app and have an appropriate package structure. thus the TestMessage class is inside a package.
    i tried some names for the testclass but it didn't matter. the exception stays the same. I also tried to put the jar in the common/lib but the problem stays.
    Well the problem with loaded classes: As i mentioned in the post above i can instantiate an object of TestMessage in the code without any problems (so the classloader of my webapp should know the class!!)
    only when reading from the objectinputstream the classloader doesn't seem to know the class?? maybe theres a parent classloader resposible for that and doesn't know the class?
    strange behaviour...
    p.s. sending the same object from the servlet to the client works well
    regards
    daniel
    Message was edited by:
    theazazel

  • Applet/Servlet communication - StreamCorruptedException

    Hi, I'm having a problem when I try to connect to a servlet. I am using applet/servlet communication. The problem only occurs when I have lauched a crystal report via http in a new window.
    After the report is launched if I try to hit my servlet I get the following error:
    java.io.CorruptedStreamException: invalid stream header
    Not all crystal reports I launch cause this behavior but I can see nothing in the url I use to launch the report that is out of place or different than other reports.
    APPLET-SERVLET CONNECTION
    try {
    StringBuffer path = new StringBuffer();
    path.append(ip);
    path.append("servlet/DatabaseServlet?");
    path.append("option=getRecords&query=").append(URLEncoder.encode(query,"UTF-8"));
    URL url = new URL(path.toString());
    URLConnection servletConnection = url.openConnection();
    servletConnection.setUseCaches(false);
    servletConnection.setDoInput(true);
    servletConnection.setDoOutput(true);
    servletConnection.setRequestProperty("Content-Type", "application/x-java-serialized-object");
    ObjectInputStream inputFromServlet = new ObjectInputStream(servletConnection.getInputStream());
    rc = (RecordCollection) inputFromServlet.readObject();
    inputFromServlet.close();
    } catch (Exception e) {
    e.printStackTrace();
    SERVLET CODE
    Forwards to doPost
    public void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    System.out.println("session id: " + request.getSession().getId());
    this.doPost(request, response);
    LAUNCHING REPORT FROM APPLET
    try {
    String launchURL = host + directory + report + "?promptOnRefresh=0"+ "&" +
    authentication + "&" + key + "&" + startPeriods + "&" + reportYears + "&" + reportTitle + "&" endPeriods "&" + locations + "&" + reportPeriod + "&" + fiscalWeek + "&" + fiscalYear + "&" +time;
    context.showDocument(new URL(launchURL), "_blank");
    } catch (Exception ex) {
    ex.printStackTrace();
    SAMPLE URL THAT CAUSES PROBLEM
    http://localhost:113/Reports/OpenToBuy_3.class?promptOnRefresh=0&user0=rpuser&password0=er34sw1&[email protected]=rpuser&[email protected]=er34sw1&user0@sub2=rpuser&[email protected]=er34sw1&promptex-key="L","L1","ALL"&promptex-start="1"&promptex-years="2004","2004"&promptex-title="Report Title"&promptex-end="1"&promptex-locs="01","03","04","05"&promptex-period="Feb 2004 [04-01]"&promptex-cw="1"&promptex-cy="2004"&promptex-time=-2-52728"
    Everything works fine until I launch this report then I can no longer get data from my servlet. I thought the URL lenght for the report might be the problem but I lauch a report with a URL longer than the problem one and there I don't get the errors after. When I try to connect to the servlet the println statement in the doGet method of my servlet doesn't get printed so it's not even making it inside that method in the servlet.
    Anyone have any idea what could be causing this? Anyone have any ideas what would be causing this? I'm really stumped.

    I've seen this problem before. Because your accessing a complete URL (ie http://<host>:<port>/xxx), you are actually creating a new session. Whenever the applet opens a connection to a servlet it is running on it's own session not the same as the JSP. This is rather obvious since the Page and Applet are separate entities.
    Try sending authentication with the url. I think the syntax is:
    username:password@http://localhost/xxx
    However I'm not sure how well this might work for Tomcat. As for Java it may try and throw a MalformedURLException I would have to test it first - it's been a long time since I used this technique!
    Wish I could be more help,
    Anthony

  • Secure inter-session communication

    How to pass data from one session to another session of same user?
    I mean how to pass it a way that nobody else can intercept?
    Oracle's DBMS_PIPE private pipes are not secure enough, SYSDBA can read/write from/to anybody's private pipe. :(.
    Any ideas?

    Why use DBMS_PIPE ?this was first that came to me for inter-session communication.
    What is the actual requirement that needs to be met? Actual requirement is to provide a session with crypto-key(s) from outside of Oracle, transparently to applications, and so that even SYSDBA could not get the keys.
    The session should use crypto-key in a same manner as VPD does to encrypt/decrypt some sensitive columns transparently to applications and adhoc reports (via layer of views that use the key).
    What is the purpose of those sessions communicating with one another? My first idea was to create a crypto-function that initially (when key is null) listens from pipe to get a key value from it.
    Another session of same user should send the key entered by the user into this pipe.
    Then, after the key received, the first main session proceeds having key in its package memory (or context).
    The problem here is that SYSDBA can mount a man-in-the-middle attack, quickly reading the key from pipe and writing it back.
    Why does that need to be secure? What data will be send? Is this peer-to-peer or client-server?SYSDBA should not know values from sensitive columns. Only users that have a key should.
    DBMS_PIPE is a solution. Not really.
    So it is difficult to comment on your view that DBMS_PIPE is insecure, when not knowing what the actual requirement is. I thought that the fact that SYSDBA can access any pipe is enough to see it is not 100% secure.
    Currently I am looking into externally or globally initialized contexts. Without that supplemental session where user enters a key.
    I am not sure yet if it is a right direction.

  • Big Problem in Applet-Servlet Communication-(Help)

    I wrote an method to send serialized objects from Applet to Servlet,
    the method is as following:
    private ObjectInputStream postObjects (URL servlet, Serializable objs[], String sessionID) throws Exception {
    ObjectInputStream in = null;
    ObjectOutputStream out = null;
    try{
    URLConnection con = servlet.openConnection();
    con.setDoInput(true);
    con.setDoOutput(true);
    con.setUseCaches(false);
    con.setRequestProperty("Content-Type","application/x-java-serialized-object");
    con.setAllowUserInteraction(false);
    con.setRequestProperty("Cookie", sessionID);
    out = new ObjectOutputStream(con.getOutputStream());
    int numObjects = objs.length;
    for(int x = 0; x < numObjects; x++){
    out.writeObject(objs[x]);
    out.flush();
    out.close();
    in = new ObjectInputStream(con.getInputStream());
    }catch(Exception e){
    e.printStackTrace(System.err);
    throw e;
    }finally{
    return in;
    when I call this method, I got the following error message in Applet console,
    my platform is Salaris 5.8 + iPlanet 6.0.
    java.io.EOFException
         at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2150)
         at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2619)
         at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:726)
         at java.io.ObjectInputStream.<init>(ObjectInputStream.java:251)
         at com.shinewave.lms.core.client.ServletProxy.postObjects(ServletProxy.java:255)
         at com.shinewave.lms.core.client.ServletProxy.doInitialize(ServletProxy.java:76)
         at com.shinewave.lms.core.client.APIAdapterApplet.LMSInitialize(APIAdapterApplet.java:60)
    java.lang.NullPointerException
         at com.shinewave.lms.core.client.ServletProxy.doInitialize(ServletProxy.java:77)
         at com.shinewave.lms.core.client.APIAdapterApplet.LMSInitialize(APIAdapterApplet.java:60)
    java.lang.NullPointerException
         at com.shinewave.lms.core.client.ServletProxy.doInitialize(ServletProxy.java:82)
         at com.shinewave.lms.core.client.APIAdapterApplet.LMSInitialize(APIAdapterApplet.java:60)
    Please help me to solve this problem, thank you very much.

    Hi..
    Sorry abt this. But I was hoping if u could help out on this..
    I am trying to implement a applet to servlet communication...
    wherin the servlet would read data from the database... and send it back to the applet which gets displayed on the applet...
    But the problem is that the applet is not able to establish a connection with the servlet..
    I am also using another supportive class whose object is basically passed from the servlet to the applet..
    could u help me..
    below is the piece of code...
    APPLET:
    import java.net.*;
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.io.*;
    import java.util.*;
    public class TestApplet extends JApplet implements ActionListener
         JButton btnLoad;
         JTextField tfEmpno, tfFname, tfLname, tfSalary;
         URL url;
    private String webServerStr = null;
    private String hostName = "sandy";
    private int port = 8085;
    private String servletPath = "/jdbcTest.DBDetailsServlet";     
    public TestApplet()
         super();
    // suppress Warning Message
    getRootPane().putClientProperty"defeatSystemEventQueueCheck",Boolean.TRUE);
         public void actionPerformed(ActionEvent ae)
              if(btnLoad.getText().equals("Load"))
                   if(loadData())
                        btnLoad.setText("Save");
              else
                   btnLoad.setText("Load");
    //               saveData();
         public void init()
              setBackground(Color.pink);
              tfEmpno = new JTextField(10);
              tfFname = new JTextField(10);
              tfLname = new JTextField(10);
              tfSalary= new JTextField(10);
              JPanel panel = new JPanel();
              panel.setLayout(new FlowLayout());
              panel.add(tfEmpno);
              panel.add(tfFname);
              panel.add(tfLname);
              panel.add(tfSalary);
              getContentPane().add(panel, BorderLayout.CENTER);
              JPanel bottom = new JPanel(new FlowLayout());
              btnLoad = new JButton("Load");
              btnLoad.addActionListener(this);
              bottom.add(btnLoad);
              getContentPane().add(bottom, BorderLayout.SOUTH);
         public boolean loadData()
              try
         System.out.println("Web Server host name: " + hostName);
         webServerStr = "http://" + hostName + ":" + port + servletPath;
         System.out.println("Web String full = " + webServerStr);
                   String servletGET = webServerStr + "?"
         + URLEncoder.encode("UserOption") + "="
         + URLEncoder.encode("AppletDisplay");     
    //               url = new URL(getCodeBase(),"http://sandy:8080/servlet/jdbcTest.DBDetailsServlet");
                   System.out.println("Complete Servlet Url => " + servletGET);
                   url = new URL(servletGET);
                   URLConnection con = url.openConnection();
                   con.setUseCaches(false); // Turn off caching.
                   InputStream in = con.getInputStream();
                   System.out.println("\nsuccess ....... con.getInputStream() ");
                   ObjectInputStream ois = new ObjectInputStream(in);
                   System.out.println("\nsuccess ....... new ObjectInputStream(in) ");
                   Object object = ois.readObject();
                   System.out.println("\nGot the object from servlet...");
                   if(object != null)
                        System.out.println("\nObject NOT null ...");
                        ArrayList result = (ArrayList) object;
                        jdbcTest.EmployeeValue empval = (jdbcTest.EmployeeValue) result.get(0);
                        tfEmpno.setText(""+empval.getEmp_no());
                        tfFname.setText(empval.getFname());
                        tfLname.setText(empval.getLname());
                        tfSalary.setText(""+empval.getSalary());
                        System.out.println("\nObject processed " + result);
                        repaint();
                   return true;
              catch(Exception e)
                   e.printStackTrace();
                   System.out.println("\n\n loadData()=> E X C E P T I O N : " + e + "\n");
                   return false;               
         public void saveData()
              //yet to be implemented..
    SERVLEt:
    package jdbcTest;
    import java.util.*;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class DBDetailsServlet extends HttpServlet
         public void doGet(HttpServletRequest req,HttpServletResponse res )throws ServletException, IOException
              System.out.println("\nInside the doGet()\n");
              ArrayList results = getDetails();
              ObjectOutputStream oos = new ObjectOutputStream(res.getOutputStream());
              oos.writeObject(results);
         public void doPost(HttpServletRequest req,HttpServletResponse res )throws ServletException, IOException
              System.out.println("\nInside the doPost()\n");
              doGet(req,res);
         public ArrayList getDetails()
              try
                   System.out.println("\nServlet : inside GetDetails...");
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   java.sql.Connection con = java.sql.DriverManager.getConnection("jdbc:odbc:SandyDSN","","");
                   java.sql.Statement stmt = con.createStatement();
                   System.out.println("\n Statement created..");
                   java.sql.ResultSet rs = stmt.executeQuery("SELECT * FROM EMP WHERE EMP_NO = 222");
                   System.out.println("\n Query Executed...");
                   ArrayList results = new ArrayList();
                   while(rs.next())
                        EmployeeValue empval = new EmployeeValue();
                        empval.setEmp_no(rs.getLong("EMP_NO"));
                        empval.setFname(rs.getString("FNAME"));
                        empval.setLname(rs.getString("LNAME"));
                        empval.setSalary(rs.getLong("SALARY"));
                        results.add(empval);
                   System.out.println("\n Resultset Obtained...");
                   stmt.close();
                   con.close();
                   return results;
              catch(Exception e)
                   System.out.println("Error while retreiving details....." + e);
                   return null;
         public boolean saveDetails(EmployeeValue empval)
              try
                   return true;
              catch(Exception e)
                   System.out.println("Error while updating details....." + e);
                   return false;
    The utility class EMployeeValue is as below:
    package jdbcTest;
    import java.io.*;
    class EmployeeValue implements Serializable
         private long emp_no;
         private String fname;
         private String lname;
         private long salary;
         public EmployeeValue()
              super();
         public EmployeeValue(long eno, String fn, String ln,long sal)
              super();
              setEmp_no(eno);
              setFname(fn);
              setLname(ln);
              setSalary(sal);
         public long getEmp_no()
              return emp_no;
         public java.lang.String getFname()
              return fname;
         public java.lang.String getLname()
              return lname;
         public long getSalary()
              return salary;
         public void setEmp_no(long newEmp_no)
              emp_no = newEmp_no;
         public void setFname(java.lang.String newFname)
              fname = newFname;
         public void setLname(java.lang.String newLname)
              lname = newLname;
         public void setSalary(long newSalary)
              salary = newSalary;

  • Servlet Communication with Java WebStart

    Hi there,
    we have an application that works fine with Java WebStart whenever we start it in a local area network. But from outside the LAN the application cannot communicate to it's servlets. I use the codebase IP address with the servlet runner's port (http://<codebase IP>:port/) as URL for servlet communication, but the application's request never reaches the servlets.
    My question is now, if anyone had the same or a similar problem with servlet communication using Java WebStart, or if anyone knows, if that might be a problem with proxy configuration.
    The servlet runner we use, is JServ from Sun (JSDK2.0) and the webserver where it is running on is not behind a firewall or a proxy, but the client PC with the web start application is.
    Thanks,
    Katja

    Thank you for your early reply. But I think, that's not the problem.
    I get no security error and the webserver is identified the same way it is in the jnlp file. Also my application is not running in the Sandbox. My assumption is, that the http-request to the servlet does not go through the proxy server between my PC and the PC the servletrunner is running on.
    I wonder if I have to configure my application to use a proxy server for communication with the servlets instead of the direct http-request to the servlet runner?

  • Inter portlet communication in SP4

    Can any one tell me in step by step process with sample code to do inter portlet communication in SP4
    Here i have 2 portlets
    Portlet A and portlet B
    Portlet A has 2 hyperlinks link1 and link2
    When i click link1 or link2 in portlet A, i am passing a parameter,depends on the paramater i have to display some details in portlet B
    Thanks
    maria
    [email protected]
    Message was edited by marianair at Feb 10, 2005 2:27 AM

    hi,
    implement both portlets as page flow portlets. For both the links in portlet A, implement an action that generates an event and fires thisone. Then let the pageflow in portlet A show whatever content is appropriate, eg. the same as before the link.
    Portlet B cathces this event and in the connected pageflow action does whatever it needs to do and redirects to the appripriate JSP.
    Just remeber that you probably needs to use a custom event here.
    For details on IPC and events, see doc:
    http://e-docs.bea.com/workshop/docs81/doc/en/portal/howdoi/howInterPortletComm_wkshp.html
    As an alternative you can use the SP3 mechanism, I find thisone somewhat more cumbersome and messy.
    http://e-docs.bea.com/workshop/docs81/doc/en/portal/howdoi/howInterPortletComm.html
    Feel free to post follow-ups if you get stuck.
    - Anders M.

  • Event interface for inter-portlet communication

    In which jar file can I find the com.bea.netuix.events.Event interface?
    I wish to offer some support for inter-portlet communication while running inside a 8.1sp4 weblogic portal server.
    Firstly, there is almost no documentation for working with Custom/Generic Events and definitely none for working with "Invoke a java portlet method"
    Found out by decompiling the code that you can do the following:
    add methodName(HttpServletRequest, HttpServletResponse, Event) to you backing file, or
    add methodName(ActionRequest, ActionResponse, Event) to your java portlet
    In both cases, I need find the jar file containing the "Event" interface. Have found most of the other classes in netuix_servlet.jar
    Would also appreciate any further info on when the above methods actually get called with respect to the "processAction" and "processRender" methods for jsr168 portlets...

    Found the answer after a pretty manual search - its located inside:
    BEA_HOME/weblogic81/portal/lib/netuix/system/netuix_system.jar
    All other interfaces being inside the WEB-INF/lib/netuix_servlet.jar, this one class from this package has been packed into a jar at the system classpath level!!
    Had to manually look at the classpath in startWeblogic.cmd and then open up every jar file, follow dependent jar files via the manifest.mf etc...

  • Inter Portlet communication without using workshop

    Hi
    Does any one have any luck trying to do inter portlet communication without using weblogic workshop IDE?

    Hi Curt,
    WLP's eventing system is designed such that portlet's don't have to care
    whether the source/destination is local or remote. If you have a portlet
    that fires/consumes events, when you create a proxy portlet on a
    consumer, the portlet on the producer will be able to fire and receive
    events without any changes to it. In this scenario, the proxy portlets
    work with the WLP's event runtime to collect and dispatch events on
    behalf of portlets on the producer. Going forward, WSRP 2.0 and
    JSR168-next's eventing models will be mapped to the same WLP event runtime.
    Subbu
    Curt Smith wrote:
    Thanks Subbu for your enlightenment here and in this group!!
    You mentioned my next quest, WSRP'ifying my portlet & IPC system.
    Can you suggest an WSRP example anywhere on the net or in bea?
    I guessing that suitability of IPC is also a function of whether the portlets are the remote portlets or the local portlets.
    Might a non-Bea IPC choice be usable within the local portlets, which are WSRP clients to stand alone remote portlets?
    I can imagine now that you mention it that the remote WRSP producer portlets can't use just any IPC facility and the events be pushed inband to the consumer portal...
    tnx curt

  • Inter portlet communication using a float portlet

    Hi,
    I am trying to achieve inter portlet communication between a jsp portlet and a pageflow portlet.
    The jsp portlet will open up as a pop up window or as a float portlet.
    I am using BEA Weblogic 8.1 SP5.
    Has any body tried this IPC when the jsp portlet is a float portlet?
    If there is any documentation available for the same?
    Thanks,
    Shreesh

    Hi,
    Thanks for the reply.
    In the search.jsp I am adding an action associated with a form bean, and passing the search string to the form, which will pass the request to the action method. This is the code snippet:
    * @jpf:action
    * @jpf:forward name="success" path="search.jsp"
    protected Forward searchcriteria(SearchcriteriaForm form)
    String searchString = form.getString();
    try {
    URL url = new URL("http://localhost/demo_search.asp");
    HttpURLConnection http = (HttpURLConnection) url.openConnection();
    http.setRequestMethod("POST");
    PrintStream out=new PrintStream(http.getOutputStream());
    out.println("searchParam=searchstring");
    out.flush();
    out.close();
    BufferedReader reader=new BufferedReader(new InputStreamReader(http.getInputStream()));
    reader.readLine();
    String patternStr = "pattern";
    Pattern pattern = Pattern.compile(patternStr);
    Matcher matcher = pattern.matcher("<a href");
    // Retrieve all lines that match pattern
    String line = null;
    while ((line = reader.readLine()) != null)
    out.println("***"+line+"***");
    matcher.reset(line);
    if (matcher.find()) {
    // line matches the pattern
    } catch(Exception e)
    e.printStackTrace();
    return new Forward("success");
    * FormData get and set methods may be overwritten by the Form Bean editor.
    public static class SearchcriteriaForm extends FormData
    private String string;
    public void setString(String string)
    this.string = string;
    public String getString()
    return this.string;
    The question is what should be the return forward for the search coz, the result should be displayed in a seperate portlet. Also, how do I capture only the result in the result.jsp.
    I would appreciate if you help me,
    Thanks in Advance,
    Sailatha

Maybe you are looking for

  • How well does the wireless "Wild Charge" pad work with the iPhone?

    how well does the wireless "Wild Charge" pad work with the iPhone?

  • ADRS Text swaps in SAPscript Debugger

    Can somebody explain this to me? Execute form F110_IN_AVIS in the SAPScript debugger (Activate the debugger then execute a printing test) Why do all the ADRS text ID includes change? Here is a trace snippet: WRITE_FORM_LINES     Lines                

  • Report wizard cannot add tables having "hyphen" in their names

    I am trying to design a *.rpt file.  I am using report wizard and connecting to a Progress/OpenEdge database. Progress allows the hyphen "-" in table names. We have tables which were created about 15 years ago and all the tables have hyphens in their

  • Hey, whiners! Apple doesn't want your business.

    You bandwagon-jumpers have really been stinking up the Apple community these last few years. Stomping about with your aesthetically-impaired judgment on full display, hollering about the loss of the "open Apple" key, demanding a way to "maximize" you

  • Can I down load pictures from phones camera

    or deleat them? I took them can I save them in my powerbook same with music? can I deleat the songs I load long time Apple, new to Itunes and like all Iphone ... thanks! powerbook G4 17"   Mac OS X (10.4.10)   powerbook G4 17"   Mac OS X (10.4.7)