Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Java Servlets n stuff

  • 03-05-2002 9:58am
    #1
    Closed Accounts Posts: 536 ✭✭✭


    I've a Java application which queries a HTTPServlet to get it's information.
    I've no problem getting huge chunks of data from the Servlet to the app but I'm stumped when I try to reverse it, i.e send chunks of data either in binary form or in String form, doesn't really matter to to the HTTPServlet.

    I've feck all experience when it comes to servlets either.
    (One of the other lads here wrote the servlet and I'm just trying to adjust it to what I want it to do)

    The following is what I do on the client side when I want to send an query How do I alter this to send data across also. And how do I handle it on the server side?


    URL myURL = new URL("http://localhost:8080/servlet1?query="+query+"");
    URLConnection con=myURL.openConnection();
    con.setDoOutput(true);
    con.setDoInput(true);
    PrintWriter out=new PrintWriter(con.getOutputStream());
    out.close();
    BufferedReader in=new BufferedReader(
    new InputStreamReader(con.getInputStream()));



    Any help here would be great.


Comments

  • Registered Users, Registered Users 2 Posts: 6,660 ✭✭✭Blitzkrieger


    Not sure I understand the problem. How are you retrieving the data from the query?

    String query = request.getParameter( "query" ); would put the contents of the query sent with the get/post request into the string.

    For sending large amounts of data wouldn't it be better to have the recieving servlet read it from a file instead?


Advertisement