Outputstream and inputstream at servlet

hi
i need send count_s to my applet from servlet
what's i'm doing wrong ?my servlet code is :
import java.net.*;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class CountServlet extends HttpServlet{
     String count_s;
     String client_name;
     int count;
     public void doPost(HttpServletRequest req, HttpServletResponse res)throws ServletException,IOException{
     count=0;
     BufferedReader in=new BufferedReader(new InputStreamReader(req.getInputStream()));
     client_name=in.readLine();
     count++;
     ByteArrayOutputStream byteStream=new ByteArrayOutputStream(512);
PrintWriter out=new PrintWriter(byteStream,true);
out.print(Integer.toString(count));               
byteStream.writeTo(res.getOutputStream());
thanks

in your code i can't see you useing your count_s...
that might be the problem...
SeJo
ps why use input & outputstream?
servlets can acces applets and classes like normal classes would.. you can use the public objects (if you refer to it)

Similar Messages

  • OutputStream and InputStream issues

    Hi
    I have an echo server and a client.
    Now the problem is that whenever I send something to the server it comes up gibberish, even though I transform it to String.
    Server code:
    public class Server
      StringTokenizer st;
      BufferedOutputStream out;
      InputStream in;
      private void init()
        try
          {srv = new ServerSocket(port);}
        catch(IOException e)
          {System.err.println("Could not listen on port " + port + ".\nLet's trace:\n" + e + "\n"); System.exit(-1);}
      private void reset()
        try
          {socket = srv.accept();}
        catch(IOException e)
          {System.out.println("Could not open socket for client, let's trace:\n" + e + "\nExiting now...");}
        try
          out = new BufferedOutputStream(socket.getOutputStream());
          in = socket.getInputStream();
        catch(IOException e)
          System.out.println("Could not open IO, exiting now...");
      private byte[] receive() throws IOException
        byte[] inputBuffer = new byte[100];
        byte[] byteInput = new byte[in.read(inputBuffer)];
        for(int i = 0; i < byteInput.length; i++) byteInput[0] = inputBuffer;
    return byteInput;
    public Server() throws IOException
    init();
    String input = "";
    byte[] byteInput = null;
    int params;
    String stage = "";
    while (input != null)
    reset();
    try
    byteInput = receive();
    input = new String(byteInput);
    // Parsing data //
    st = new StringTokenizer(input, " ");
    params = st.countTokens();
    stage = st.nextToken();
    System.out.println("client: " + input + "\nparams=" + params + "\nstage=" + stage);
    The client is using an OutputStream to send out bytes and InputStream to recieve bytes. I need to leave it on the bytes level so I cannot use any subclasses of OutputStream or InputStream.
    Any idea why I get junk on the server side?
    Thanks

    Thanks for the feedback, much appreciated!
    I don't see why not. Please explain further. If
    you're sending Strings you should be reading Strings,
    probably with DataInputStream.readUTF()/writeUTF(),
    and you wouldn't be having any of the problems above.
    If you're not sending Strings don't convert the data
    from/to Strings at all, just process the bytes
    directly.Because I only need to convert to String at this initial stage.
    After this the client will send bytes and server will process bytes.
    In general I need to measure the Throughput of a TCP link, so the client has to send probes of various size (in particular 1 byte, 100 bytes, 400 bytes...). But before this can happen, the client needs to prepare the server for what's coming by sending a String with a special format. However, since a character is encoded into 2 bytes, I don't see how to make this work rather then do this nasty half byte half character processing.
    byte[] inputBuffer = new byte[100];
    byte[] byteInput = new byte[in.read(inputBuffer)];
    That could result in trying to allocate new byte[-1], which won't work. It could >also result in any size of byteInput from 1 to 100. There is no guarantee you >have read the whole request at this point.Yes I was aware of the fact that read() can return -1. I ignored it at this point because I was stuck with the junk problem. If it returns -1 an exception will be thrown so I am less worried about this for the moment.
    I took a 100 because the max size of any message send by the client is not going to exceed this. Restricted by the protocol I work around.
    for(int i = 0; i < byteInput.length; i++)
    byteInput[0] = inputBuffer;
    Waste of time. See above.Ok, I agree I am not the most sophisticated programmer :) but how else would I parse meaningful data out of that 100 byte buffer?
    while (input != null)
    How is input ever going to be null?Sorry I should have said while(0) or something of that nature.
    It's an endless loop. Originally the server worked differently so that statement actually made sense, but now it's just an endless loop.
    However I still don't understand why I get junk.
    If I send only one character from the client the server gets it correctly.
    It's only a problem once I send some stuff.
    Any suggestions?
    Many Thanks!
    Message was edited by:
    eXKoR
    Message was edited by:
    eXKoR

  • Does closing socket with close() also closes the outputStream and inputStre

    hi i have a simple query
    does closing socket with close() also closes the outputStream and inputStream() associated with the socket

    Yes.

  • Cant get inputstream in servlet

    Hi,
    I am using tomcat 5.0 and trying to get inputstream in servlet to print the content which i got from client..
    Here is the code of my doGet()
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
         System.out.println("In Doget");
         try
              InputStream in = request.getInputStream();
              BufferedReader br = new BufferedReader(new InputStreamReader(in));
              String line = br.readLine();
              System.out.println("Line :"+line);
              while (line != null)
                   System.out.println("Line :"+line);
                   line=br.readLine();
         catch (Exception e)
              System.out.println("Exception occured in doGet:");
              e.printStackTrace();
         System.out.println("End of doGet :::");
    When it try to invoke above servlet with this URL( http://localhost:8080/USUResetPasswordServlet?afadfasfd ), it is suppose to print me "afadfasfd" in the server console..But is not..Any idea, why it is failing...
    Thanks in advance
    Satya

    Hi,
    Thanks for the response..
    It is some thing confusing..Let me put it this way..I
    am trying to contact the servlet from a java
    program..Here is the code for it..
    URL servlet = new
    URL("http://127.0.0.1:8080//USUResetPasswordServlet");
    String xmlStr = "<hai>hasafd</hai>";
    URLConnection connect = servlet.openConnection();
                   connect.setDoOutput(true);
                   connect.setDoInput(true);
                   //connect.connect();
                   OutputStream outStr = connect.getOutputStream();
                   //PrintWriter out = new PrintWriter(outStr);
                   outStr.write(xmlStr.getBytes());
                   outStr.flush();
                   outStr.close();
    InputStream is = connect.getInputStream();
    Any idea, why it is not priting content in servlet
    console??
    SatyaThat would cause your servlet's doPost method to be invoked, not doGet. So what is your doPost doing?

  • Problem with Thread and InputStream

    Hi,
    I am having a problem with threads and InputStreams. I have a class which
    extends Thread. I have created and started four instances of this class. But
    only one instance finishes its' work. When I check the state of other three
    threads their state remains Runnable.
    What I want to do is to open four InputStreams which are running in four
    threads, which reads from the same url.
    This is what I have written in my thread class's run method,
    public void run()
         URL url = new URL("http://localhost/test/myFile.exe");
    URLConnection conn = url.openConnection();
    InputStream istream = conn.getInputStream();
    System.out.println("input stream taken");
    If I close the input stream at the end of the run method, then other threads
    also works fine. But I do not want to close it becuase I have to read data
    from it later.
    The file(myFile.exe) I am trying to read is about 35 MB in size.
    When I try to read a file which is about 10 KB all the threads work well.
    Plz teach me how to solve this problem.
    I am using JDK 1.5 and Win XP home edition.
    Thanks in advance,
    Chamal.

    I dunno if we should be doing such things as this code does, but it works fine for me. All threads get completed.
    public class ThreadURL implements Runnable
        /* (non-Javadoc)
         * @see java.lang.Runnable#run()
        public void run()
            try
                URL url = new URL("http://localhost:7777/java/install/");
                URLConnection conn = url.openConnection();
                InputStream istream = conn.getInputStream();
                System.out.println("input stream taken by "+Thread.currentThread().getName());
                istream.close();
                System.out.println("input stream closed by "+Thread.currentThread().getName());
            catch (MalformedURLException e)
                System.out.println(e);
                //TODO Handle exception.
            catch (IOException e)
                System.out.println(e);
                //TODO Handle exception.
        public static void main(String[] args)
            ThreadURL u = new ThreadURL();
            Thread t = new Thread(u,"1");
            Thread t1 = new Thread(u,"2");
            Thread t2 = new Thread(u,"3");
            Thread t3 = new Thread(u,"4");
            t.start();
            t1.start();
            t2.start();
            t3.start();
    }And this is the o/p i got
    input stream taken by 2
    input stream closed by 2
    input stream taken by 4
    input stream closed by 4
    input stream taken by 3
    input stream closed by 3
    input stream taken by 1
    input stream closed by 1
    can u paste your whole code ?
    ram.

  • Using getSessionContext() and getIds() in servlets

    hello
    Problem is getSessionContext() and getIds in servlets are not working at all. I 've a servlet which uses these methods to manupulate sessions what it does'nt work.
    getSessionContext() returns session context under which this servlet is running. through this context i want to access all the sessions which are associated with servlet. this context is used with getIds() to get the ids of different sessions. it returns enumeration. but in my case it is always empty even when there are two browsers have valid sessions going on.
    so please suggest me some way out
    waiting desperately
    thanks

    As long as you created the session, it should have returned the session id. You may need to post some code.
    Bosun

  • Problems compiling and running a servlet

    I have been trying to compile and run my servlet program to no avail. Please help. I am using Tomcat 5.5 and j2sdk1.4.2
    These are the errors I keep getting. I have already set the classpath appropriately.
    MyServletTest.java:5: package javax.servlet does not exist
    import javax.servlet.*;
    ^
    MyServletTest.java:6: package javax.servlet.http does not exist
    import javax.servlet.http.*;
    ^
    MyServletTest.java:10: cannot resolve symbol
    symbol : class HttpServlet
    location: class MyServletTest
    public class MyServletTest extends HttpServlet {
    ^
    MyServletTest.java:13: cannot resolve symbol
    symbol : class HttpServletRquest
    location: class MyServletTest
    public void doGet (HttpServletRquest req, HttpServletResponse resp)
    ^
    MyServletTest.java:13: cannot resolve symbol
    symbol : class HttpServletResponse
    location: class MyServletTest
    public void doGet (HttpServletRquest req, HttpServletResponse resp)
    ^
    MyServletTest.java:48: cannot resolve symbol
    symbol : class HttpServletResponse
    location: class MyServletTest
    private void printResultSet (HttpServletResponse resp, ResultSet rs)
    throws SQLException {
    ^
    MyServletTest.java:52: cannot resolve symbol
    symbol : method prinln (java.lang.String)
    location: class java.io.PrintWriter
    out.prinln("<html>");
    ^
    7 errors

    Thank you. I have managed to compile the program but
    when I run it I get:
    Exception in thread "main"
    java.lang.NoSuchMethodError: main
    How should I run a servlet?Servlets are not run like applications. You need to deploy them to a servlet container, and they get invoked and initialized by constructor, init() method and goGet/doPost().

  • Read contents of file into outputstream and send through socket

    I have a file. Instead of transferring the whole file through socket to the destination, I will read the contents from the file (big or small file size) into outputstream and send them to the destination where the client will receive the data and directly display it....
    Can you suggest any efficient way/methods to achieve that?
    Thanks.

    I don' t understand what you think the difference is between those two techniques, but:
    int count;
    byte[] buffer = new byte[16384];
    while ((count = in.read(buffer)) > 0)
      out.write(buffer, 0, count);
    out.close();
    in.close();

  • Read file with nio and flush with servlet

    Can I read file, by using java.nio (for example by FileInputStream.getChannel()) and then flush the file content thru the servlet?
    I kwow about reading without java.nio, get a byte array and then flush it by httpservletresponse writer or outputstream, but I wish to know if it is possibile with java.nio reading.
    thanks

    I'm doing it only for file reading..
    protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
            response.setContentType("text/html;charset=UTF-8");
            PrintWriter out = response.getWriter();    
            FileInputStream fis = null;                               
            try
                String path = "/var/hello.txt";
                fis = new FileInputStream(path);       
                FileChannel channel =  fis.getChannel();
                ByteBuffer bb = ByteBuffer.allocate((int) channel.size());
                channel.read(bb);
                byte[] data2 = bb.array();
                channel.close();
                out.write(new String(data2));
            } catch (FileNotFoundException ex)
                ex.printStackTrace();
            } finally
                try
                    fis.close();
                } catch (IOException ex)
    ex.printStackTrace();
                out.close();
        }

  • Java concurrency and inputstream

    HI,
    I want to write the image file from a database to disk by using a queue. I can write these images on disk from the result set.
    Can someone tell me where I am wrong in the following code? I get: "trying to write to disk: Closed Connection"
    Thank you.
    {code}
    public class ExtractPicture implements Runnable{
        private BlockingQueue<InputStreamMessage> queue;
        public ExtractPicture(BlockingQueue<InputStreamMessage> queue){
            this.queue = queue;
        @Override
        public void run() {
            try(Connection conn = new DatabaseConnection().getConnection();
                Statement stmt = conn.createStatement();
                ResultSet rs = stmt.executeQuery("select mypicture from testpicture")){           
                while(rs.next()){
    //                System.out.println(rs.getInt("mypicture") + " <== added");
    //                queue.put(rs.getInt("id"));
                    InputStreamMessage ism = new InputStreamMessage(rs.getBinaryStream("mypicture"));
                    try{
                        queue.put(ism);
                    }catch(Exception e){
                        System.out.println(e.getMessage());
            }catch(Exception e){
                System.out.println(e.getMessage());
    class Consumer implements Runnable{
        private BlockingQueue<InputStreamMessage> queue;
        public Consumer(BlockingQueue<InputStreamMessage> queue){
            this.queue = queue;
        @Override
        public void run() {
            try{           
                int z = 0;
                InputStreamMessage is;
    //            (is = queue.take()) != null
                while((is = queue.take()) != null){
                    System.out.println("consumer aa" + is.getInputStream());
    //                writeToDisk(is.getInputStream(), "c:\\temp\\p" + z + ".jpeg");
                    try{
                        int c = 0;
                        OutputStream f = new FileOutputStream(new File("c:\\temp\\p" + z + ".jpeg"));
                        while((c = is.getInputStream().read()) > -1 ){
                            f.write(c);
                        f.close();
                    }catch(Exception exce){
                        System.out.println("trying to write to disk: " + exce.getMessage());
                    z++;
            }catch(Exception e){
                System.out.println(e.getMessage());
    class InputStreamMessage{
        private InputStream is;
        public InputStreamMessage(InputStream is){
            this.is = is;
        public InputStream getInputStream(){
            return is;
    class RunService{
         public static void main(String[] args) {
            BlockingQueue<InputStreamMessage> queue = new ArrayBlockingQueue(10);
            ExtractPicture ep = new ExtractPicture(queue);
            Consumer c = new Consumer(queue);
            new Thread(ep).start();
            new Thread(c).start();
    {code}

    This is really a JDBC issue: Java Database Connectivity (JDBC)
    Your code is getting a 'STREAM' from the result set and putting a reference to that stream in a queue.
    But then the code executes 'rs.next()' which closes the stream and attempts to move to the next row, if any, of the result set.
    Stream data MUST BE read immediately. Any attempt to access columns after the column being streamed or moving to another rows will close the streamj.
    See the JDBC Dev Guide for the details of processing LOBs and using streams.
    http://docs.oracle.com/cd/B28359_01/java.111/b31224/jstreams.htm#i1014109
    Data Streaming and Multiple Columns
    If a query fetches multiple columns and one of the columns contains a data stream, then the contents of the columns following the stream column are not available until the stream has been read, and the stream column is no longer available once any following column is read. Any attempt to read a column beyond a streaming column closes the streaming column.
    Also see the precautions about using streams:
    http://docs.oracle.com/cd/B28359_01/java.111/b31224/jstreams.htm#i1021779
      Use the stream data after you access it. 
    To recover the data from a column containing a data stream, it is not enough to fetch the column. You must immediately process the contents of the column. Otherwise, the contents will be discarded when you fetch the next column.
    It is important that the process consuming the stream has COMPLETE control over the components needed to process it properly. That includes the connection, statement and result set.
    As TPD pointed out by defining the connection, statement and result set within a method those instances goe OUT OF SCOPE when the method ends.
    Since you also defined the objects within a try block they go out of scope when the block exits even if the method doesn't end.
    You didn't say why you are trying to use queues to do this but I assume it is part of some multi-threaded application. If so you have some additional architectural considerations in terms of keeping things modular while still being able to share certain components.
    For example how are you connections being handled? Are you using a connection pool? That 'queue' processsor need sole access to the connection being used to stream an object. Your code ONLY puts a reference to a stream on the queue but then has to WAIT until the stream has been FULLY READ before that code can try to read the next column, next row or close the result set.
    That makes those two processes mutually dependent and you aren't taking that dependency into account.
    Hopefully you are doing the dev and testing using TINY files until things are working properly?.

  • OutputStream and Printwriter

    Is it possible within the same servlet to do both of these commands.
    I need to use the response to firstly get an OutputStream.
    (This is needed to draw out a dynamic graph)
    so use the following code.
    OutputStream out2 = response.getOutputStream();
    ChartUtilities.writeChartAsJPEG(out2, chart, 600, 300); But then i also need to get a PrintWriter.
    so use the following code.
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();I use this because the servlet already existed before inclusion of the chart.
    Is there any way to include both these commands within the same servlet ie within the doget method??
    I have tried this but it either just prints out the graph and doesnt do hte chart or doesnt do hte chart and prints out the servlet html code.
    Any advice gracefully accepted.
    delboy

    Nope. Not possible with one request.
    You will need to make two requests to your servlet. One for the image, the other for the accompanying text.
    I would suggest you send back the html text first, including a link to load the image into the page (via the servlet call)
    good luck,
    evnafets

  • AutoVue API - ActionDownload - OutputStream to InputStream

    All,
    The ActionDownload implementation usually requires an inputstream to be returned. Currently we implement a FileInputStream from the document to be view physically being on disk.
    The currently works fine.
    We are looking at removing the need to output files from the DMS to disk as this requires managing our own cache and if we can remove the need that would be great.
    The API for the DMS we use give the option to return you an OutputStream object, from what i can tell i can convert the output to an input stream but i am concerned about memory use as the entire document will be held in memory completely until the it has been written out to disk.
    I have been reading up on PipedOutStream and PipedInputStreams and if they would be beneficial in my use case scenario?
    Can any advice be given on this?
    Nick

    All,
    The ActionDownload implementation usually requires an inputstream to be returned. Currently we implement a FileInputStream from the document to be view physically being on disk.
    The currently works fine.
    We are looking at removing the need to output files from the DMS to disk as this requires managing our own cache and if we can remove the need that would be great.
    The API for the DMS we use give the option to return you an OutputStream object, from what i can tell i can convert the output to an input stream but i am concerned about memory use as the entire document will be held in memory completely until the it has been written out to disk.
    I have been reading up on PipedOutStream and PipedInputStreams and if they would be beneficial in my use case scenario?
    Can any advice be given on this?
    Nick

  • Uploading a file using jsp and com.oreilly.servlet lib package

    Sorry to bother you but I need your help folks
    I am developing an application to pick up files from a database and sent to a specified location on a different system.
    I am presently trying to run this code,I have placed this lib package from oreilly which is supposed to encapsulate the usage of file uploads,which is a jar file called cos.jar into C:\Program Files\Java\jdk1.5.0_03\jre\lib\ext folder .I have a jsp page that calls the bean which does the upload and implement the classes in the oreilly package.I am using tomcat 5
    [b]the jsp page that acts as the user interface
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
    <title>Please Choose The File</title>
    </head>
    <body bgcolor="#ffffff">
    <table border="0"><tr>
    <form action="Upload.jsp" method="post"
    enctype="multipart/form-data">
    <td valign="top"><strong>Please choose your document:</strong><br></td>
    <td> <input type="file" name="file1">
    <br><br>
    </td></tr>
    <tr><td><input type="submit" value="Upload File"></td></tr>
    </form>
    </table>
    </body>
    </html>
    this is the jsp page that calls the bean
    <jsp:useBean id="uploader" class="com.UploadBean" />
    <jsp:setProperty name="uploader" property="dir" value="<%=application.getInitParameter(\"save-dir\")%>" />
    <jsp:setProperty name="uploader" property= "req" value="${pageContext.request}" />
    <html>
    <head><title>file uploads</title></head>
    <body>
    <h2>Here is information about the uploaded files</h2>
    <jsp:getProperty name="uploader" property="uploadedFiles" />
    </body>
    </html>
    [b]this is the bean class
    package com;
    import java.util.Enumeration;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.ServletRequest;
    import com.oreilly.servlet.MultipartRequest;
    import com.oreilly.servlet.multipart.DefaultFileRenamePolicy;
    import javax.servlet.*;
    public class UploadBean {
    private String webTempPath;
    private HttpServletRequest req;
    private String dir;
    // private ServletRequest request;
    public UploadBean( ) {}
    public void setDir(String dirName) {
    if (dirName == null || dirName.equals(""))
    throw new IllegalArgumentException("invalid value passed to " + getClass( ).getName( )+".setDir");
    //webTempPath = dirName;
    dir = dirName;
    /* public String getDir()
    return webTempPath;
    public void setReq(ServletRequest request) {
    if (request != null && request instanceof HttpServletRequest)
    req = (HttpServletRequest) request;
    } else {
    throw new IllegalArgumentException("Invalid value passed to " + getClass( ).getName( )+".setReq");
    public String getUploadedFiles( ) throws java.io.IOException{
    //file limit size of 5 MB
    MultipartRequest mpr = new MultipartRequest(req,dir,5 * 1024 * 1024,new DefaultFileRenamePolicy( ));
    Enumeration enume = mpr.getFileNames( );
    StringBuffer buff = new StringBuffer("");
    for (int i = 1; enume.hasMoreElements( );i++){
    buff.append("The name of uploaded file ").append(i).append(" is: ").append(mpr.getFilesystemName((String)enume.nextElement( ))).append("<br><br>");
    }//for
    //return the String
    return buff.toString( );
    } // getUploadedFiles
    On running the code I find this error messages
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: javax/servlet/ServletRequest
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781)
         org.apache.jsp.jsp.Upload_jsp._jspService(org.apache.jsp.jsp.Upload_jsp:73)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    java.lang.NoClassDefFoundError: javax/servlet/ServletRequest
         com.oreilly.servlet.MultipartRequest.<init>(MultipartRequest.java:222)
         com.oreilly.servlet.MultipartRequest.<init>(MultipartRequest.java:151)
         com.UploadBean.getUploadedFiles(UploadBean.java:49)
         org.apache.jsp.jsp.Upload_jsp._jspService(org.apache.jsp.jsp.Upload_jsp:63)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.9 logs.
    Apache Tomcat/5.5.9
    tanks

    Hi,
    Looks like you are missing a file from the classpath. Make sure servlet.jar is available in your classpath. Ordinarily files in <tomcat_home>/lib directory should be added automatically. You need to check why it hasn't been added in your case. A good place to start would be the bat files in the bin directory viz startup.bat, catalina.bat etc.
    cheers,
    vidyut

  • Reading Variable from JSP and pass to servlet

    hello
    i have a servlet page which transfers data to a jsp page. The jsp displays the data only. Now i want to read a string from a jsp page and then pass it to the servlet.
    How can i do it?
    thnks

    hello
    this is working fine: out.println("<input
    type=\"hidden\" name=\"bookId\" value=\"+bookId+\"
    size=\"25\">") ;
    works fine
    thnksI guess you didn't understand me. Look to the difference between the following two statements:
    out.println("<input type=\"hidden\" name=\"bookId\" value=\"+bookId+\" size=\"25\">") ;and
    out.println("<input type=\"hidden\" name=\"bookId\" value=\""+bookId+"\" size=\"25\">") ;In the first you're handling the bookId variable as String, in the second it will use the actual value of bookId.

  • Java.lang.system and InputStream

    java.lang.system has 3 fields defined:
    static PrintStream err;
    static InputStream in;
    static PrintStream out;
    As InputStream is a abstract class, can it be used to declare a variable? If so, how to instantiate?
    Thanks

    java.lang.system has 3 fields defined:
    static PrintStream err;
    static InputStream in;
    static PrintStream out;
    As InputStream is a abstract class, can it be used to declare a variable? If so, how to instantiate?You cannot create an object from an abstract class; you can create an object from a sub class of
    that abstract class, and that's exactly what that Stystem.in is refering to, an object from a sub
    class of the abstract class InputStream. This sub class still IS-A Inputstream and all you have
    to know that it behaves exacty as an InputStream.
    Think of it this way -- 'birds' by themselves do not exist; sparrows exist and parrots and penguins exist.
    Still you can point to a penguin and say "hey! That's a bird". And so is the object refered to by the
    System.in variable an InputStream.
    kind regards,
    Jos

Maybe you are looking for

  • Recreating WD_RFC_METADATA_DEST JCo Destination

    Hi all! I'm trying to access some bapis from a webdypro application and when creating the JCo Connections i get the following error when i test them: "com.sap.mw.jco.JCO$Exception: (102) RFC_ERROR_COMMUNICATION: Connect to message server host failed

  • Sharepoint online multiline list colomn not rendering HTML out put

    Hi  I have list with multi line column with having multimedia options. my problem is i have created view and edited XSL  to format it. also i have added "escape out put =yes" for the column but no luck still column is rendering as HTML Tags witch is

  • Client sometimes shows 'In a Meeting' and other times just 'Busy'

    Client sometimes shows 'In a Meeting' and other times just 'Busy'. Any ideas what might be causing this?

  • Libreoffice upgrade error: /usr/share/icons/locolor/... already exists

    In trying to upgrate libreoffice today, I get a bunch of errors about files in /usr/share/icons already existing. I checked a bunch and they weren't owned, so I started removing them using `updatedb` followed by `locate libreoffice` to track down tho

  • Posting Depreciation

    I am able to run depreciation with AFAB in background processing in Ecc 6.0.But when i see awo1n i can see that a triangular yellow sign appears.I know it will turn into green only if we post it.But how to post depreciation.Can the the run date and s