Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > Servlets
| Search | Today's Posts | Mark Forums Read
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Servlets section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old June 28th, 2005, 04:55 AM
Registered User
Join Date: Jun 2005
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Servlet tag problem

Hi everyone,

I have a servlet which is supposed to execute a shell command and display the output. The shell command is as follows and this is the output at the command line:

localhost:~ # serctl ul show 2045

My servlet code (which I have included below) only prints ";q=1;expires=45678" to the screen. It leaves out the line in the "< >". I suspect this is a problem with the tags. Can anyone tell me how to rectify this?

My servlet code is as follows:

String[] command = { "serctl", "ul", "show", "2045" }; // Only change!

Runtime runtime = Runtime.getRuntime();
Process process = null;
try {
process = runtime.exec(command);
BufferedReader in =
new BufferedReader(new InputStreamReader(process.getInputStream()));

// Read and print the output
String line = null;
while ((line = in.readLine()) != null) {
catch (Exception e) {
out.println("Problem with finger: " +

Many thanks in advance for help.

Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with servlet developer.ibm Servlets 1 September 12th, 2007 11:22 PM
Servlet Problem cziaul Servlets 2 April 28th, 2007 09:39 AM
My servlet problem saeed Servlets 1 April 10th, 2007 07:12 AM
Can/How i use Java Bean & Tag Library in servlet nigam.anand Servlets 0 May 9th, 2006 09:40 PM
Servlet Tag Problem odriscolla ASP.NET 1.0 and 1.1 Professional 3 June 29th, 2005 05:02 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.