How can Refresh a Servlet

Hi,
My problem is I have an servlet which reads data from the data base and it display on the browser.
But my question the resultant page must be refreshed every 3 min ..(means every 3 min it retives data from the data base and it shown on the broser) so please help on this ..
Thanks

Thanks Mr Jhon...
But it working properly when content-type is text/html.
But In my servlet i have used
res.setContentType("image/svg-xml")..
so i canot embed that meta tag in response object..
..i Think u understood my problem clearly..
Any ..if not my problem is
1.I have to display the images dinamically on the browser.
2.For this my servlet will receive the image parameters from the data base and it displays the image on the browser..
3.So here my questioin without user interact the image automatically calls the servlet for each 30 seconds ..
4. Whener the it calls the servlet aumatically it retrives the data from database and it shown on the browser..
please help on this ..
i have already used respose,setHeader("Refresh",30) but it not worked
thank u

Similar Messages

  • How Can I Run Servlet in tomcat

    Hi My Friends
    Please can any one tell me how can I Run Servlet in tomcat using my own Virtual Directory � my ask about , what is the structure it must be make it in the hierarchy of the sub folder of Virtual Directory , and in watch folder it must be put the servlet files and there is any change it must be make it in any file of the tomcat files and so on
    Please give my full details about this thing
    And thanks

    What version of Tomcat are u using?

  • How to refresh in servlets

    Hi all
    I want to write servlets which refresh every time the form submitted, if I use
    out.println("<head><meta http-equiv=\"refresh\" content=\"3\"..."
    it will keep on refreshing, my question is how can you do only once when the page been generated? I have tried "<META HTTP-EQUIV=Cache-Control CONTENT=no-cache>" didn't seem to do what I want.
    Thanks for your help!

    Hi Roland
    Thanks for your quick reply, I have tried your code, still questions.
    What I am trying to do is to write
    out.println("<td><a href=\"servlet/servlet1\">view</a></td>");
    out.println("<td><a href=\"servlet/servlet2\">Insert</a></td>");
    servlet1 will do a query from a database table, and display the result. servlet2 displays a form to insert a row. After inserting/deleting/updating a row, I want to go back to view the table, but the display is the same, unless I press 'refresh' from the browser window.
    can you help please?
    Thanks

  • How can I use Servlets on Sun Java System WebServer 6.1

    Hi
    This is Khurram,
    I have just downloaded, and installed "Sun One Java System Web Server 6.1" on WindowsXP. This is installed and working properly on my system. But I want to use Servlet technology on this server, even I did download it just for working on servlets. Before it, I was using typical JavaWebServer2.0 for this purpose.
    Any ways.
    Can any one tell me, how can I do this on "Java System Web Server 6.1".
    Thanks
    any help will be appriciated
    regards
    Khurram

    Thanks for your such action.
    Actually I have installed it since 2 days, and have read throughly the documentation of WebServer, But Only the Link for this purpose is provided "Programmer's Guide to Web Applications", Now I have just searched for it and found only "Programmer's Guide" .PDF format. I have just read it out now, But here also provided a small refference to see "Programmer's Guide to Web Applications". Now I have just the problem that where to find it.
    Please, tell me if you have some solution to my problem
    or atleast tell me where to find the refference "Programmer's Guide to Web Applications". I tried but only found "Programmer's Guide" for Sun Web Server 6.1.
    Thanks any way to give some time.
    Khurram

  • How can make java servlet sent soap message to other java web application

    hello,
    i want to make simple servlet send soap message to other java web application containing web service????
    for example
    web application " A " contain web service add two number
    java servlet " B " send soap message contain num1 and num2 to A to add them.
    how can do this????

    I tried that but my problem is that the code is so old. At least what I saw. I don't know how old is too old and I'm trying to do things "right." I saw code from 1998, but I don't know if that's still what you do. It might still work, but that doesn't mean it's correct. There's so much out there on Java that so old that half the time I'm not sure what to do because some other technology in J2EE or the latest Java SDK might have come up with a new way to do things. Thanks.

  • How can i Use SERVLET with RMI to avoid trust certificate

    I know that for begining RMI, you must launch the server and the client.
    for the server i use :
    java -Djavax.net.ssl.trustStore=server.keystore -Djavax.net.ssl.keyStore=server.keystore -Djavax.net.ssl.keyStorePassword=server TestServer
    for the client I use :
    java -Djavax.net.ssl.trustStore=client.keystore -Djavax.net.ssl.keyStore=client.keystore -Djavax.net.ssl.keyStorePassword=client TestClient
    and all work fine.
    but i want to use a servlet for rmi client and i wrote this:
    public class AppelServlet extends HttpServlet
         public void doPost(HttpServletRequest request, HttpServletResponse response)
         throws ServletException, IOException
              try
                   System.out.println("Registering secure RMI socket factory ...");
                   java.rmi.server.RMISocketFactory.setSocketFactory(new SecureRMISocketFactory());
              TestRemote test = (TestRemote) Naming.lookup("rmi://127.0.0.1:7123/TestClient");
    String reponse=test.toLowerCase("HELLO WORLD");
                   System.out.println("la reponse est : "+reponse);
         catch (Exception e)
              System.out.println("test client exception: " +e);
    PrintWriter out = response.getWriter();
              response.setContentType("text/html");
    and i have the following error on tomcat:
    Registering secure RMI socket factory ...
    test client exception: java.rmi.ConnectIOException: error during JRMP connection
    establishment; nested exception is:
    javax.net.ssl.SSLHandshakeException: Couldn't find trusted certificate
    i think i must precise how to indicate the truststore like in the first case.
    help me please.
    hamdi

    Hi,
    Try doing the following steps.
    Assuming you have a certificate obtained
    Export the certificate into a .cer file.
    On IE, goto tools->internet options->content->certificates, and export to a .cer file.
    Using keytool of java import the certificate to the store that can be used doing the following command.
    keytool -import -alias <ailas> -file < .cer filename> -keystore <storename here>
    set the javax.net.ssl.trustStore and javax.net.ssl.trustStorePassword properties at the command prompt using the command below.
    java -Djavax.net.ssl.trustStore=<storename> -Djavax.net.ssl.trustStorePassword=<password> <classname>
    Let me know if this helped.
    Also take a look at this link for using RMI with SSL
    http://java.sun.com/products/jdk/1.2/docs/guide/rmi/SSLInfo.html
    Regards,
    Roopasri Vittal
    Developer Technical Support
    Sun Microsystems
    http://sun.com/developers/support

  • How can I compile servlets?  I'm still having problems...

    Ok, I've installed J2SE and it's been working perfectly using command-line compiling (javac) and also with the Eclipse IDE.
    Now I want to start using Servlets and JSP so I installed the JWSDP (Java Web Services Developer Pack). I couldn't quite figure it out, so I installed J2EE on top of everything.
    Eclipse doesn't recognize "import javax.servlet.*;" and neither does the command-line compiler javac.
    Am I doing something wrong?

    I don't know anything about ServletExec or how it expects you to deploy a Web app. You're on your own there. I don't know if ServletExec supports WAR files or even follows the specifications for directory structures.
    Look, there are two separate issues here: compiling and running.
    Whatever you do, however you do it, you've got to have a JAR in your CLASSPATH that has the javax.servlet and javax.servlet.http packages in it when you compile. You don't need the whole J2EE app server, just the JAR with those packages.
    When you deploy and run the app, you'll do it on the server. It'll have the appropriate JARs.
    To me, app server and J2EE are synonymous. Yes, the j2ee.jar comes with Sun ONE if that's what you've downloaded.
    You can use Tomcat, which is a free servlet/JSP engine. I believe that Sun ONE has Tomcat bundled inside. If so, it'll have the servlet.jar in there somewhere. Tomcat stores it in TOMCAT_HOME/common/lib.
    MOD

  • With iPlanet6.0 how can I include servlets in the cgi directory?

    I have created a cgi directory ex. http://hostname/cgi-bin to refer to the cgi.exe's. However.. I have developed a new servlet that replaces one of the cgi programs. The servlet context must fit in with our existing architecture so the servlets context must map to the cgi URL we have in place. This works fine with every web app server under the sun .. even Sun One7... but not on iPlanet 6.0. This is because it seems that every resource mapped by a CGI directory must be a CGI program - the web server doesn't have the intelligence to know that a servlet with the same context is available and so when the CGI directory is enabled... the servlet is not found, yet when it is removed the servlet is referenced just fine.
    Has anyone any ideas? Unfortunately I can't change the context of the servlet as our existing systems depend on the original cgi structure.
    Many thanks,
    Mark

    Right /cgi must reference a cgi and /servlet is for legacy servlets that arent deployed as applications.
    I dont think you are going to make it work like that, maybe do a redirect from /cgi/cginame to /servlet/servletname . That's the only thing that may work.

  • How can i run servlet in netbeans

    i am new to jsp & servlet. i am using netbeans 6.5 and tocat. i can not understand wehere to save the jsp & servlet
    files.please help me.

    Create a new Project
    > Enter ur project Name
    > By selecting finish u can create a new project only with Servlets & JSP
         > If you want to include Enterprise framework select on you requirement.
    Create a new file
         >Choose the type of file as Servlet
         >then input your servlet name
         >Here you can change Servlet Name and URL-Pattern for your servlet
         >Default is considered as ur servlet file name
    Do stuff in servlet
         >Compile and Run
    Hope these steps are helpful for you

  • How can i running servlet in tomcat 4.1

    sir,
    i want to know ,what are the settings?i have to do before running a servlet
    i installed tomcat4.1 in C:\Program Files\Apache Group\Tomcat 4.1.
    but i reffered a lot of tutorial ,i couldnt understand that.
    and also i set jsdk path;

    u need to set the path and classpath in command prompt.
    Create a directory on c drive say "c:\job_todler" and enter ----->
    set the path =c:\jdk1.3\bin;%path%
    set classpath = c:\Apache Group\Tomcat\Common\lib\servlet.jar
    Now come to,
    c:\Apache Group\Tomcat\bin>set JAVA_HOME=C:\JDK1.3
    c:\Apache Group\Tomcat\bin>set CATALINA_HOME=C:\ApacheGroup\Tomcat
    c:\Apache Group\Tomcat\bin>startup
    bye

  • How can i modify servlet but not restart oc4j

    after i replace the files under WEB-INF\classes,i need the new ones to be effective before i restart oc4j.
    what should i do?

    There are two options: (1) to redeploy the application,
    (2) to restart the application (but not OC4J).

  • How to refresh Servlet

    Hi Friends
    I have done a mistake in servlet file,compiled it and uploaded on Jakarta-tomcat server.
    Now i have taken care of this mistake and again compiled and uploadedthis servlet on the same jakarta-tomcat server.
    But the change is not reflected,I am getting the same error again and again.
    How to refresh this servlet.
    Here are my limitations-
    1)I can not shut down the server
    2)I can not delete the work folder or it's contents
    Any help?
    Thanks in advance

    If it is tomcat 4.1 then you can use its adminitrator jsp page to make your context(webapp) reloadable. This in turn will make chages to your your server file and will add the context back to tomcat without stopping it.
    Regards

  • How can i make a servlet (class) temporarily unavailable, except for ADMIN

    Hello All!
    I am rather new to the programming field and have already completed a web-project in Java only with Servlets. (no jsp). I have a login procedure, means I have a user management for users and admins. If an admin is logged in, he/she should be able to deactivate the servlet with a mouse-click as long he activates it again with the same. if the servlet is deactivated, other users/admins trying to access the servlet should get a "servlet is currently unavailable" message. but the admin, who is logged in, still should be able to work with the servlet! how can i realise that?
    in other words, by clicking that particular button, the servlet should be made "non-multi-thread" and other way round by activating it.
    any ideas??? how can the standard "servlet currently unavailable" page be displayed? I have tomcat 4 on a linux machine! i'd be really grateful if someone oculd help me.
    another question i have is, how to define a "pseudo" link address to the servlet. now, the servlet can only be accessed by typing like this: http://servername.xy.com:8080/ProjectName/servlet/ServletName (because I have activated the servlet mapping in the server.xml/web.xml with /servlet/*)
    but I want a link like this: http://servername.xy.com:8080/shortname
    How can I do this in an easy way?? I have treid to create a web.xml in der WEB-INF folder of the servlet with following content, but it is not working:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app PUBLIC
    "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <servlet>
    <servlet-name>
    shortname
    </servlet-name>
    <servlet-class>
    ClassName
    </servlet-class>
    </servlet>
    </web-app>
    Thanks a lot in advance for your kind help,
    lisa

    Ok,
    You'll need to find a tutorial on servlet filters. Its not that hard a concept.
    http://java.sun.com/j2ee/1.4/docs/tutorial/doc/Servlets8.html#wp64572
    Filters need to be configured in the web.xml.
    Basically they are a buffer between a request and your servlet.
    Any requests for the servlet, go through the filter first. It lets you do some processing before/after the servlet gets called. Its a good way of putting in some generic code that need to be run for many servlets - security checks are often implemented in this fashion.
    This should give you an idea of the sort of thing you need. I haven't really written one before, so I copied this out of the tutorial and did some basic framework for it....
    public final class TestFilter implements Filter {
       private FilterConfig filterConfig = null;
       public void init(FilterConfig filterConfig) throws ServletException {
          this.filterConfig = filterConfig;
       public void destroy() {
          this.filterConfig = null;
       public void doFilter(ServletRequest request,  ServletResponse response, FilterChain chain) throws IOException, ServletException {
            // if you want to get the session will need to cast request to an HttpServletRequest
            Session session = request.getSession();
            String requestURL = request.getRequestURL();
            // check if this URL is for a servlet that is disabled for this user
           // somehow you have to keep track of this ... maybe in the servletContext ?
        User user = (User) session.getAttribute("user")     
          boolean disabled = checkDisabled(requestURL, user);
          // if its not disabled, go ahead
          if (!disabled)
            chain.doFilter(request, response);
        else{
            // send the servlet off somewhere else - requestDispatcher maybe?
    }

  • How can send servlet out put to jsp

    Hi friends,
    my problem is ..
    1.In my jsp (let us assume that Test.jsp ) emded tag which emding out put from Servlet.. like
    <embed name="svg" border="1" type="image/svg+xml" width="100%" height="100%" src="http://localhost:8080/demo/Test?"/>
    here the jsp is calling Servlets but at the time display the jsp cannot understand the out put comming from servlets ..
    plz help how can read a Servlet data from JSP
    thanks

    Use <jsp:include page="relative_url_to_servlet"/>. Then have your servlet get the PrintWriter for output from response.getWriter() and you should have it.
    I do this every once in awhile.

  • How can I include personalization to WLS servlets

    Hello
    I have WLS 5.1 and WLCS\PS 3.2
    How can I personalized servlets which works on WLS 5.1 in the best way?
    (Some docs on BEA site?)
    Regards
    BP

    Hi Bartek,
    WLPS is running on WLS. Think of it as a really big WLS
    application comprised of EJBs, JSPs, etc. You typically do
    not need to run both at the same time. Take a look at the
    WLPS installation directory and you'll find things such as
    weblogic.properties which should be familiar.
    To add personalization, it's easiest if you use JSPs as we
    provide a number of tag libraries. If you must use servlets
    then you'll need to use the Java APIs. There is documentation
    for the tags and JavaDocs at:
    http://e-docs.bea.com/wlcs/docs32/index.html
    I would suggest taking a look at the Personalization Server tour
    to get an overview of what's available.
    Cheers,
    Skip
    "Bartek Peczkis" <[email protected]> wrote in message
    news:[email protected]..
    I know that my question is very general. Thanks for any suggestions.
    My project working on WLS 5.1. I must adding personalization to it.
    And I don't know how can I join WLPS with WLS.
    I know that
    WLS listens at port 7001
    WLPS listens at port 7501
    (default)
    How WLPS connects with WLS?
    Do both servers must be running?
    Skip Sauls wrote:
    Hi Bartek,
    Can you be more specific as to what you would like to do? By
    personalized servlets, what do you mean?
    Thanks,

Maybe you are looking for

  • Dinit - an alternative base/udev hook for mkinitcpio

    Note: dinit has been removed from the AUR is now part of geninit. It still exists on github as a separate project if you want to play with it. This is something fun that I've been fooling around with for the past week, and I'm pretty happy with it, s

  • CR displays unicode fonts as squares

    Hi I am deploying a report with chinese chars and its using unicode fonts. However the report does not display it corectly and it shows the lables as squares. Development tool. VS2005 +CR and deployed on Win2008 IIS7 Thanks for any help. Regds Jay

  • Replace inverter or whole display, or both?

    Right hinge was beginning to show sparks and smoke so I shut er down promptly and took out the battery. Curiosity got best of me though a few weeks later so I rebooted to see what would happen. Everything was beautiful, for about 3 seconds, when sizz

  • Streaming Application -- Buffering Error

    I'm having some trouble getting application streaming to work properly. I've followed the directions for setting up and configuring the server, creating the virtual application, placing the model files on the web server and generating the configurati

  • E-videos or downloads

    hi friends, can any one send the linkl related to e-videos of SAP-CRM regards, Rajesh