473,408 Members | 2,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 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 17701
> 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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.