Yes,
In a java client program, use URLConnection to connect to servlet passing
the URL with parameters.
You can get the parameters from a file, command line or hardcode it like the
example below

  URL url = null;
  URLConnection urlc = null;
  PrintWriter pw = null;


     url = new
URL("http://localhost:7001/servletName?name=value&name2=value2");
    urlc = url.openConnection();
   urlc.setDoOutput(true);
   urlc.setDoInput(true);
   urlc.setUseCaches(false);
   pw = new PrintWriter(new OutputStreamWriter(urlc.getOutputStream()),
true);
   pw.println("Here it comes");

   BufferedReader inStream = new BufferedReader(new
InputStreamReader(urlc.getInputStream()));
   System.out.println(inStream.readLine());
  }catch(Exception e) {
   System.out.println(e.toString());
  }

regards,
Aaron
----- Original Message -----
From: Aparna Neelgar <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 25, 2000 3:31 PM
Subject: Servlets question, Urgent!!!!


> Hi all,
> Is there a way to take the query string parameters to a servlet from
command
> line or from a file? Like instead of using a browser, cna the command line
> be used to send a query to a servlet which after processing displays a
> message in html, jsp or just as a out.println(). If so, please let me
know.
> Can it be done using the generic servlet?
> Thanks in advance.
> -Aparna
> ________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to