472,777 Members | 2,767 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,777 software developers and data experts.

System.out.println("String") Where is the output?

This is from an application and not an Applet.

I believe it goes to stdout but when I do a test and write an abitrary
string and then do a search of the hard disk for the string, I can't find
it. So, I suspect one has to create the file manually before using it.

But I'll be damned if I can remember where.

Thanks to anyone who'll take a few minutes to let me know.
Jul 17 '05 #1
6 17661
> I believe it goes to stdout but when I do a test and write an abitrary
string and then do a search of the hard disk for the string, I can't find
it. So, I suspect one has to create the file manually before using it.


Yes, it goes to stdout. How are you executing this line of code? If
you execute from the command line in a terminal window, you should see
the string written to the terminal screen (unless you've redirected
stdout somehow).

--

Mel Roman
me*@melroman.net
Jul 17 '05 #2

"Mel Roman" <me*@melroman.net> wrote in message
news:1X*******************@news04.bloor.is.net.cab le.rogers.com...
I believe it goes to stdout but when I do a test and write an abitrary
string and then do a search of the hard disk for the string, I can't find it. So, I suspect one has to create the file manually before using it.


Yes, it goes to stdout. How are you executing this line of code? If
you execute from the command line in a terminal window, you should see
the string written to the terminal screen (unless you've redirected
stdout somehow).

--

Mel Roman
me*@melroman.net


It's being executed from a servlet, within a doPost method.

For those not familar with servlets, one enters a URL in a browser that
points to a small java program containing a (in this case doPost) method to
create an HTML page. The HTTP server (Apache) fowards the HTTP request to
the servlet container (Tomcat) which executes the java code that returns the
generated HTML page.
Jul 17 '05 #3
In article <EG********************@magma.ca>, Ron Brennan wrote:
It's being executed from a servlet, within a doPost method.


Hmmm... Sorry, I don't have enough experience with servlets to help any
further. Can anyone else here help out?

--

Mel Roman
me*@melroman.net
Jul 17 '05 #4

"dfdfd" <df**@aol.com> wrote in message
news:%SAUa.5142$5b7.2242@lakeread01...
The location for "System.out" depends on your servlet engine.
"Mel Roman" <me*@melroman.net> wrote in message
news:gF*******************@news01.bloor.is.net.cab le.rogers.com...
In article <EG********************@magma.ca>, Ron Brennan wrote:
It's being executed from a servlet, within a doPost method.


Hmmm... Sorry, I don't have enough experience with servlets to help any
further. Can anyone else here help out?

--

Mel Roman
me*@melroman.net

The servlet engine is Tomcat version 4.1.24, dfdfd.

The stdout file doesn't seem to exist yet anywhere, presumably because it
has to be manually created.
Jul 17 '05 #5
Originally I thought there'd be someone with a quick answer - I didn't mean
to take up anyone else's time doing research.

Tomcat is being started from Apache, so the command line idea won't work.
I'll just have to dig more through the Tomcat docs. I'll post here when I
find it. Thanks.
"dfdfd" <df**@aol.com> wrote in message
news:VAFUa.5252$5b7.951@lakeread01...

"Ron Brennan" <rb******@magma.ca> wrote in message
news:7M********************@magma.ca...

"dfdfd" <df**@aol.com> wrote in message
news:%SAUa.5142$5b7.2242@lakeread01...
The location for "System.out" depends on your servlet engine.
"Mel Roman" <me*@melroman.net> wrote in message
news:gF*******************@news01.bloor.is.net.cab le.rogers.com...
> In article <EG********************@magma.ca>, Ron Brennan wrote:
>
> > It's being executed from a servlet, within a doPost method.
>
> Hmmm... Sorry, I don't have enough experience with servlets to help any > further. Can anyone else here help out?
>
> --
>
> Mel Roman
> me*@melroman.net

The servlet engine is Tomcat version 4.1.24, dfdfd.

The stdout file doesn't seem to exist yet anywhere, presumably because it has to be manually created.


It looks like you need to start Tomcat with a command like this:

$JAVACMD $TOMCAT_OPTS -Dtomcat.home=${TOMCAT_HOME} $MAIN start $@
${TOMCAT_HOME}/logs/stdout.log 2>&1 &


I just saw that from a brief web search. there should be some docs
available for your distribution that explains where stdout goes
by default.

Jul 17 '05 #6
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ron Brennan wrote:
Originally I thought there'd be someone with a quick answer - I
didn't mean to take up anyone else's time doing research.

Tomcat is being started from Apache, so the command line idea won't
work. I'll just have to dig more through the Tomcat docs. I'll post
here when I find it. Thanks.


Hi,
I played with Tomcat a bit under Windows one time and, in all cases, I
started Tomcat with a console window. System.out.println() sent the
string to this console. If there's no console, and the string isn't
getting sent to a file, I suspect it's probably being blackholed. If
you really need System.out, you can try redirecting it to a file from
within your servlet itself, using System.setOut(), although I'm not
sure if the servlet security manager allows that or not. Otherwise,
try creating your own stream to a file and call it something like
"out". Then just use it instead of System.out.

- --
Chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQE/I83wwxczzJRavJYRAp1bAKC4+N6GvRBQX/vloBd1UnKlL1iT6QCgoaZZ
kz4K5PhbFGKFfG0K+PGGTrg=
=mzkM
-----END PGP SIGNATURE-----
Jul 17 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Andrew Burgher | last post by:
Feeding the following .xsd into the XsdObjectGen (v1.4.2.0) tool produces an invalid attribute: with DataType="System.String". Has anybody seen this behaviour before? Is this a bug in...
10
by: cppdev | last post by:
Hi All! I want to clear the string contents from sensitive information such as passwords, and etc. It's always a case that password will appear as string at some point or another. And i feel...
3
by: Andy Sutorius via DotNetMonster.com | last post by:
Hi, I have a Sorted List that has 9 key/value pairs. I am trying to take one of the key/value pairs and store the value of that key into a string variable. However, the value that actually gets...
21
by: Neel | last post by:
I am trying to "ping" a remote host in my C++/Redhat Linux code to check whether that host is connected or not. if (0 == system("ping -w 2 192.168.0.2)) But, in both cases...
10
by: R2d2Rabeau | last post by:
Hi, I'm new to C#, please be patient :-) I am trying to pass an Arraylist (myAL) to a jagged array (myAL2) . The problem I have is that when I write the values to a file i do not get the values...
6
by: =?Utf-8?B?SmVmZg==?= | last post by:
I thought this would already be covered here, but my search turned up nothing. In VS2005, if I use "String" to define a new variable/class, it colors it in the Aqua color as it does other...
4
by: archu007 | last post by:
hi i'm using the following statement in my application string strTArray = new string; strTArray = (string)(Session); when i run the application its giving the below error {"Unable to cast...
5
by: mvmashraf | last post by:
Hi to all.... I have spent some time browsing for a solution to the following error but have unfortunatly not found any solution yet ,Please any help would be much appreciated.......
21
by: Sami | last post by:
string = "" or string = string.Empty? should is the proper way? Sami
0
by: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.