Server Push in JSP

Hi AnyOne!
          I have a jsp, and a database . If a column in my table gets updated I
          want all of my clients who are connected to it , to see the refreshed value
          without click any refresh/Reload button on the browser. A kind of
          Server-Push.
          That is, If one client makes changes, then all of the other clients on the
          web should get intimated.
          How can I achieve this ?
          thanks
          vikas
          

Vikas,
          There was a article about the same in java world a while back.
          http://www.javaworld.com/javaworld/jw-03-2000/jw-03-pushlet.html
          But I believe this is bad design. I don't think using opened HTTP Connections
          to do a real time operation is not a good Idea. What if you are serving couple
          of hundred clients?
          Kumar.
          Vikas Jolly wrote:
          > Hi AnyOne!
          >
          > I have a jsp, and a database . If a column in my table gets updated I
          > want all of my clients who are connected to it , to see the refreshed value
          > without click any refresh/Reload button on the browser. A kind of
          > Server-Push.
          > That is, If one client makes changes, then all of the other clients on the
          > web should get intimated.
          >
          > How can I achieve this ?
          >
          > thanks
          > vikas
          

Similar Messages

  • Server Push redirecting to a pre-existing JSP

    Question:
    Has anyone tried to create a Server Push servlet that can be used to serve up pre-existing JSPs?
    Is it even possible for a servlet to serve a pre-existing JSP or does the web page code have to be embedded within the servlet?

    Hi, do you mean you want to redirect to another JSP?
    you could use the "sendRedirect" method in the HttpServletResponse object.
    for example:
    public MyServlet perform(...HttpServletRequest request, HttpServletResponse response)
         throws IOException, ServletException {
      String redirectTo = "http://www.companyname.com/index.jsp";
      response.sendRedirect(redirectTo);
    }something like that....

  • Implementing Server Push

    How can i implement a server push in my jsp pages?
    any sample code would be appreciated.
    The server pushes the data to the jsp when the
    database changes because of an update.
    Thanks

    Http is a stateless protocol and cannot maintain a connection to the server. I am working on a project now that has the same type of requirement and we are using pushlet technology. You should have a look at the following
    www.pushlets.com
    Hope this helps
    SD

  • Server Push in Servlets

    Hi AnyOne!
              I have a servlet, and a database . If a column in my table gets updated I
              want all of my clients who are connected to it , to see the refreshed value
              without click any refresh/Reload button on the browser. A kind of
              Server-Push.
              That is, If one client makes changes, then all of the other clients on the
              web should get intimated.
              How can I achieve this ?
              thanks
              vikas
              

    I read the OP's message and imediately thought oh, cool, MVC candidate :-)          If I wanna talk about MVC I would prefer Sun's Design Patterns group.
              Kumar.
              [email protected] wrote:
              > "Mettu Kumar" <[email protected]> wrote in message
              > news:[email protected]...
              > > Ryan,
              > >
              > > I was not commenting on MVC pattern. I am talking about the problems
              > > pushlets implementation could potentially cause.
              >
              > Mettu, we completly crossed paths my friend. I read the OP's message and
              > imediately thought oh, cool, MVC candidate :-) Silly me! I understand what
              > you are talking about now :-)
              >
              > > 1. If you are serving 10,000 clients, probably a given instance your
              > server will
              > > be serving 100 or 1000 of the them. but with pushlets you have 10, 000
              > > conenctions open siumultaneously and your server is serving all the client
              > 100%
              > > of the time.
              >
              > No, you're right that isn't good.
              >
              > > Do you think this would scale? Imagine the number of threads on server.
              > > 2. This could potentially bring down the web server you are using.
              > >
              >
              > It would scale right up to the time the server came crashing down :-) Yes,
              > if the server kept a single connection, thread of execution, open to every
              > client while the client was running that would be not so hot indeed,
              > especially if your clients increased exponentially. This is precisely why I
              > like the callback method on each client, kind of a pain to implement though.
              >
              > >
              > > Kumar.
              > >
              > > [email protected] wrote:
              > >
              > > > I wasn't referring to the article on pushlets you mentioned when I said
              > the
              > > > idea of MVC was a valid one, nor have I read the article as I respond
              > but
              > > > heres the idea I was describing which is based on the concept of MVC.
              > It
              > > > provides perfectly for the scenario the OP described IMO. I think, at
              > least
              > > > based on what I've seen, that the notion of MVC in the J2EE sector is
              > used
              > > > mostly as a means to seperate business logic from presentation logic.
              > It
              > > > doesn't allow for any mechanisms to notify the ``views" when data
              > ``model"
              > > > changes. This is no big deal I guess for most applications but it does
              > > > break the MVC paradigm IMO. To aleiviate this problem we incorporate an
              > > > observer pattern to notify each subscribing view when the model changes.
              > > > There really isn't any difference in my mind between push and pull where
              > > > pull is a standard RFC 2616 request and push is a simple callback to the
              > > > object registered with the controller (servlet, jsp). If the server can
              > > > handle a thousand or so concurrent requests why couldn't it handle a
              > > > thousand concurrent callbacks. You could probably improve this by
              > > > multi-threading the controller. Just some thoughts I would like to hear
              > > > yours :-)
              > > >
              > > > ~Ryan
              > > >
              > > > "Mettu Kumar" <[email protected]> wrote in message
              > > > news:[email protected]...
              > > > > Ryan,
              > > > >
              > > > > Did you ever try to use to Pushlets serving thousands of clients?
              > > > > Why did you think its a good design? If you feel its a good design,
              > let
              > > > us
              > > > > know whats good about it.
              > > > >
              > > > > Kumar.
              > > > >
              > > > > [email protected] wrote:
              > > > >
              > > > > > "Mettu Kumar" <[email protected]> wrote in message
              > > > > > news:[email protected]...
              > > > > > > Vikas,
              > > > > > >
              > > > > > > There was a article about the same in java world a while back.
              > > > > > > http://www.javaworld.com/javaworld/jw-03-2000/jw-03-pushlet.html
              > > > > > >
              > > > > > > But I believe this is bad design. I don't think using opened HTTP
              > > > > > Connections
              > > > > > > to do a real time operation is not a good Idea. What if you are
              > > > serving
              > > > > > couple
              > > > > > > of hundred clients?
              > > > > > >
              > > > > > > Kumar.
              > > > > > >
              > > > > >
              > > > > > It's a perfectly valid design. OP, check out MVC and the observer
              > > > design
              > > > > > pattern I think you'll find what you're looking for there.
              > > > > >
              > > > > > ~Ryan
              > > > > >
              > > > > > > Vikas Jolly wrote:
              > > > > > >
              > > > > > > > Hi AnyOne!
              > > > > > > >
              > > > > > > > I have a servlet, and a database . If a column in my table gets
              > > > updated
              > > > > > I
              > > > > > > > want all of my clients who are connected to it , to see the
              > > > refreshed
              > > > > > value
              > > > > > > > without click any refresh/Reload button on the browser. A kind
              > of
              > > > > > > > Server-Push.
              > > > > > > > That is, If one client makes changes, then all of the other
              > clients
              > > > on
              > > > > > the
              > > > > > > > web should get intimated.
              > > > > > > >
              > > > > > > > How can I achieve this ?
              > > > > > > >
              > > > > > > > thanks
              > > > > > > > vikas
              > > > > > >
              > > > >
              > > > >
              > >
              

  • How can i upload a image file to server by using jsp or servlet.

    Hi,
    I m gurumoorthy. how can i upload a image file to server by using jsp or servlet without using third party API. pls anyone send me atleast outline of the source code.
    Pls send me anyone.
    Regards,
    Gurumoorthy.

    I'm not an applet programmer so I can't give you much advice there.
    If you want to stream the file from the server before it's entirely uploaded, then I don't believe you can treat it like a normal file. If you're just wanting to throw it up there and then listen to it, then you can treat it like a normal file.
    But again, I'm not entirely certain. You might be able to stream the start of the file from the server while you're still uploading the end of it, but it probably depends on what method you're using to do the transfer.

  • How to call webservice server application in jsp

    Hi Friends
    I followed this link http://www.eclipse.org/webtools/community/tutorials/BottomUpAxis2WebService/bu_tutorial.html and run the server and client web service application successfully. How to call the Webservice server application in JSP instead of using client (java main method) java appliaction. Is there any tutorial or code for accessing the webservice server application in jsp.
    Thanks and Regards
    Sherin Pooja

    797526 wrote:
    Hi
    I feel that JSP is just a view page.Not a feeling, it actually is :)
    So it is not good practise to write the scriplet code in JSP page. Absolutely right.
    Is there any other way to call the webservice server application in my client(JSP) page?
    What is it that you want to do? If despite all you have said, you still wish to call the webservice from a jsp, read my response above.
    You would do well to rephrase your question if there's something else that you are asking.
    ram.
    Edited by: ramp on Dec 27, 2010 12:35 PM

  • How to upload a file into server using j2ee jsp and servlet with bean?

    How to upload a file into server using j2ee jsp and servlet with bean? Please give me the reference or url about how to do that. If related to struts is more suitable.
    Anyone help me please!

    u don't need j2ee and struts to do file uploading. An example is as such
    in JSP. u use the <input> file tag like
    <input type="file"....>You need a bean to capture the file contents like
    class FileUploadObj {
        private FormFile srcFile;
        private byte[] fileContent;
        // all the getter and setter methods
    }Then in the servlet, you process the file for uploading
        * The following loads the uploaded binary data into a byte Array.
        FileUploadObj form = new FileUploadObj();
        byte[] byteArr = null;
        if (form.signFile != null) {
            int filesize = form.srcFile.getFileSize();
            byteArr = new byte[filesize];
            ByteArrayInputStream bytein = new ByteArrayInputStream (form.srcFile.getFileData());
            bytein.read(byteArr);
            bytein.close();
            form.setFileContent(byteArr);
        // Write file content using Writer class into the destination file in the server.
        ...

  • Db connection from content server context through JSP

    Hi All,
    Can anyone tell me how to get ucm db connection from Content Server context through JSP file? Thanks.
    Joe
    FMW Team,iTech,Shenzhen

    Start by getting a sample JSP here:
    http://www.corecontentonly.com/Blog/UsingJavaServerPagesWithContentServerAndAnExample
    Then, you can use the Workspace object in the jsp to create resultsets from SQL.
    String sql = "SELECT * FROM REVISIONS";
    // Execute the sql
    rs = objWorkspace.createResultSetSQL(sql);
    drs = new DataResultSet();
    drs.copy(rs);
    for (drs.first(); drs.isRowPresent(); drs.next())
    String dDocName = ResultSetUtils.getValue(drs, "dDocName");
    System.out.println(dDocName);
    }

  • 500 Internal Server Error OracleJSP: JSP Error: Exception:java.lang.NullPoi

    500 Internal Server Error
    OracleJSP:
    JSP Error:
    Request URI:/ForecastVsActualWithProgressBarWebApp/htdocs/forecastvsactualportlet/processing.jsp
    Exception:
    java.lang.NullPointerException at java.net.URLClassLoader$1.run(URLClassLoader.java:190) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at java.lang.ClassLoader.loadClass(ClassLoader.java:282) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274) at java.lang.ClassLoader.loadClass(ClassLoader.java:282) at com.evermind.naming.ContextClassLoader.loadClass(ContextClassLoader.java:143) at java.lang.ClassLoader.loadClass(ClassLoader.java:282) at com.evermind.naming.ContextClassLoader.loadClass(ContextClassLoader.java:143) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at oracle.jsp.parse.JspUtils.loadClassJDK(JspUtils.java:256) at oracle.jsp.parse.JspUtils.loadClass(JspUtils.java:246) at oracle.jsp.parse.JspRTTag.<init>(JspRTTag.java:149) at oracle.jsp.parse.JspParseState.createTagParser(JspParseState.java:575) at oracle.jsp.parse.JspParseTag.parseNextTag(JspParseTag.java:693) at oracle.jsp.parse.JspParseTagFile.parse(JspParseTagFile.java:184) at oracle.jsp.parse.OracleJsp2Java.transform(OracleJsp2Java.java:154) at oracle.jsp.runtimev2.JspPageCompiler.attemptCompilePage(JspPageCompiler.java:428) at oracle.jsp.runtimev2.JspPageCompiler.compilePage(JspPageCompiler.java:284) at oracle.jsp.runtimev2.JspPageInfo.compileAndLoad(JspPageInfo.java:483) at oracle.jsp.runtimev2.JspPageTable.compileAndServe(JspPageTable.java:542) at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:305) at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509) at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:824) at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330) at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830) at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:224) at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:133) at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192) at java.lang.Thread.run(Thread.java:534)
    --------------------------------------------------------------------------------

    Is this related to a download from Oracle website?
    You might want to post more information and the "question" here.

  • How to upload and download files using FTP to a server(webserver) in JSP

    I have to upload and download multiple files Of(size >5 MB)using FTP to a
    Server(webserver) in JSP
    how to do that ?

    Or he could create his own tag libraries, no? :)One supposes that, technically, one could create a taglib wrapper around an existing FTP library. There might be licensing issues with distributing that taglib wrapper.
    Of course, one could find the FTP RFC online, read it, and implement one's own FTP client implementation, complete with a tag library access point.

  • Getting image path from database( Remote server)  & display in jsp page

    hai frnds,
    i have one doudt regarding in my web application Development
    . I want to Getting image path from database( **Remote server**) & display in jsp page here iam forwarding my control through Servlets
    how this will passiable
    Thanks in Advance
    SonyKamesh
    [email protected]

    hai
    I think ur doubt will be...
    1) Getting a Image From Remote Server( & U stored a only path name in Data Base)
    2) Image r stroed in saparate Drive( Not in Webroot-- where u Created domine )
    Please Any Help Will be Appriciated
    [email protected]
    Edited by: Sonykamesha on Dec 18, 2007 11:02 PM

  • Using the new Data/Services generation with server push

    Have moved my Flex/BlazeDS app (which uses Blaze AMFChannel for request/response messages and StreamingAMFChannel for server push messaging) from Flex Builder 3 to Flash Builder 4. The new Data/Services works fine to generate service classes and value objects for the request/response messages, question is can it provide any help setting up a messaging consumer and value objects for the pushed data?
    rick holland

    I am so sorry - I meant AirPort Express - not extreme - but it's moot since I missed the point of your post - you want two outputs - and one to not be digital.
    For what it's worth - I still think the express might be your best bet.
    http://www.apple.com/airportexpress/airtunes.html
    It has combined digital/analog out - you plug in one and it switches the output depending on which connection is inserted. I would expect a very short wait until everything accepts digital input - expecially for people who want good sound quality. If you have to go digital to analog outside of the receiver/amp (where it really belongs) - why not let it be the express sitting right next to where you want the second "receiver" to be...

  • Server-Push

    I read somewhere that Flex Data Services provides Server-Push
    functionality. That is, the server starts a conversation with the
    client. It's obvious that, In order to such thing ocurr, there has
    to be a persistent connection between server and client.
    I've being reading about Data Management Service to learn how
    to implement this Server-Push and all I see is about a method
    called Fill() that is thriggered from the client and syncronizes
    it's data with the server. But it's not server-push
    Does it really exist?

    Hi,
    When you create a DataService and fill your collection. The
    collection becomes managed. You don't have to call fill again if
    there is any change in the data. Server pushs updates to clients
    when the client's dataservice is using rtmp channel. It is a live
    connection between the server and the client. For example,
    you fill(collection, "hqsql", from products where price <
    100). If one of the product's price increases, server push a
    message to your collection to remove it. If a product's product's
    price decrease, it will be added to the collection. The push is
    happened based on your fill method.
    William Chan

  • Each Vitrual Software server with own jsp

    Hi all,
    How to setup vitrual software server with its own jsp page
    I install jdk1.3.1 and iplanet server 4.1 sp8 done in sun machine with
    os 7,
    I config and test jsp ok in single host, but can't work to each vitrual
    host to run own jsp page
    somebody know. How to setup and config own jsp for each vitrual software
    in iplanet web server.
    Please help
    thank.

    I also did testing on same - struggling to get the same for last couple of months...
    I'm using iws6.0 with jdk1.3 on Win-XP box (just the testing box).
    say - docroot is D:/Servers/WWWRoot
    and for vs abc.com - D:/Servers/WWWRoot/VS/abc_com
    If there is no index.jsp in abc_com folder http://abc.com/index.jsp will give 404 (file not found)... if the index.jsp exists there... it will give 500 (server error)... I went through the internal details using FILEMON... the latter case is looking (checking) for abc_com/index.jsp till the JSP compiler is invoked... But this JSP compiler is looking for WWWRoot/index.jsp... (this means JSP compiler is not aware of virtual server concept)...
    Interestingly, if there is WWWRoot/index.jsp present and accessed earlier... http://abc.com/index.jsp will server WWWRoot/index.jsp :-(( only if abc_com/index.jsp exists...
    I am also confused - how to fix this.
    Any help will be appreciated...
    Regards,
    Sudhaker
    sudhaker@___yahoo___.com
    (remove underscores)

  • Implementing Server Push using LCDS 2.6

    Hi All,
    We have created an application where we are using polling to get certain constant updates. Now this polling is client polling wherein the client polls the server at regular intervals to get the fresh data for certain actions.
    Now we wish to take this to another level and implement Server Data Push so that the client does not keep polling unnecessarily and the server notifies the client as and when the data gets updated with the server. For this we have the DataService Transaction class that needs to be implemented.
    But there are a couple of questions that are in my mind regarding this technology. It would be great if someone could answer them.
    My questions are:
    1) Does the LCDS server know which client to push data to in case of multiple clients looking at the same data scenario. e.g. Two clients A and B are looking at the same data. A performs an action and that action needs some time to get completed at the server. Now in case we use Server Data Push, will the LCDS be intelligent enough to send the message on completion of the requested activity to only A and not B.
    2) In order to push data to the client, the server will invoke some method which will return the desired data to te client. How do we keep the parameters registered with the server that this method would need while getting invoked. SInce, the call to the method will not be client initiated, how does the server know what parameters to be passed to the method in order to invoke it. How will this work in a multi-user looking at the same data/screen scenario.
    The answers to these questions will really help us. In case anyone is well versed with this technology, please pitch in to give your inputs.
    Many Thanks.
    Regards,
    Shally

    Hi,
    As also, suggested by you, we were thinking of using an RTMP channel only for this since its a two way socket that establishes a communication channel between the client and the server and then helps keep messages moving to and fro.
    We have successfully implemented RTMP channel and achieved the following functionalities.
    1) A client initiated change which gets propagated to the server and then to all the clients.
    2) Server push to all the clients.
    Now our last step is to implement data push to a particular client. As told by you, we will use the client id but we have some doubts and questions regarding this since we do not have the code examples or anything that could help us in implementing the same.
    I would therefore request you to kindly lead us on the following fronts:
    1) Is the client id the one that is part of the request- response thread, I saw a client id being printed in the logs when a request is made and the response comes.
    2) What code needs to be written on the server side to extract this client id once a call is made so that it can keep this client id with itself to push a message later on.
    3) What methods or API are available to be used to push this message to a particular client? Do we need to call the fill method of a particular client using the client id parameter and inform the client that its requested job has been done.
    For (3) is the Messaging(Publish and Subscribe model) the right way to go??
    It would be great if you could provide us some code snippets just to give us an idea from where we can take it up ourselves.
    Looking forward to hear from you.
    Many Thanks,
    Shally
    Message was edited by: testing34

Maybe you are looking for