You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Luke Vanderfluit <lu...@chipcity.com.au> on 2003/08/19 05:37:34 UTC

tomcat console

Hi,

I'm using tomcat 4.1.27. on Redhat 9.
In some documentation it tells me to use the console window extensively
during development, 
how do I do that?

If I start tomcat from the console with startup.sh I don't get a lot of
feedback about what is happening.

Is the only way I can get that feedback by using System.out.println?

thanks,
kind regards,


-- 
====================================
"when my computer smiles, I'm happy"
====================================
Luke Vanderfluit 
Mobile: 0421 276 282


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: tomcat console

Posted by tomcat-list <ja...@iarad.com>.
Luke,

I am not sure exactly what you mean by this but I will give it a shot.  If
you are experiencing crashes or errors, I would check the logs.  You can
tell tomcat what "verbosity" you would like your logs reported to.  You
can do this in your server.xml file or within a specific application
context.

I think perhaps what you might be hitting on however is how do you do
basic design, test, develop lifecycle with your servlets.  My
recommendation would be to do the following.  Try to encapsulate as little
functionality as possible in your actual servlet.  Instead, create java
class files that you can test independent of the tomcat application and
then simply call these from the servlet.  This makes things much simpler
and is good programming practice.  You will also be ahead of the game if
you move to Jakarta Struts.

For example, if I need a servlet to look up and show information about a
user, I will break it into the following parts.  I will have the
GetUserInfoServlet, a User bean (java class), and a DisplayUser class.
Once I enter the GetUserInfoServlet, I immediately pass the userId that I
got from the get request and pass it ti the User bean to perform a lookup
from my database or flat file or whatever.  Once that returns, I call
DisplayUser to format the output and sned it to the client.  Then I am
done.  This way, I am able to write a small main function in User.java and
DisplayUser.java that lets me test the classes independent of Tomcat.  It
becomes easy to test database connections, etc. (Solving DB related
problems in Tomcat is not fun).

I hope I was barking up the right tree and that this was useful.  If not,
give me some more info and I will try to help you out.  If you nee any
additional info about the examples or would like to see something more
concrete, let me know.

Cheers,
Stuart

                   + Stuart A. MacKenzie + http://www.iarad.com +

On 19 Aug 2003, Luke Vanderfluit wrote:

> Hi,
> 
> I'm using tomcat 4.1.27. on Redhat 9.
> In some documentation it tells me to use the console window extensively
> during development, 
> how do I do that?
> 
> If I start tomcat from the console with startup.sh I don't get a lot of
> feedback about what is happening.
> 
> Is the only way I can get that feedback by using System.out.println?
> 
> thanks,
> kind regards,
> 
> 
> -- 
> ====================================
> "when my computer smiles, I'm happy"
> ====================================
> Luke Vanderfluit 
> Mobile: 0421 276 282
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 


Re: tomcat console

Posted by tomcat-list <ja...@iarad.com>.
Luke,

I am not sure exactly what you mean by this but I will give it a shot.  If
you are experiencing crashes or errors, I would check the logs.  You can
tell tomcat what "verbosity" you would like your logs reported to.  You
can do this in your server.xml file or within a specific application
context.

I think perhaps what you might be hitting on however is how do you do
basic design, test, develop lifecycle with your servlets.  My
recommendation would be to do the following.  Try to encapsulate as little
functionality as possible in your actual servlet.  Instead, create java
class files that you can test independent of the tomcat application and
then simply call these from the servlet.  This makes things much simpler
and is good programming practice.  You will also be ahead of the game if
you move to Jakarta Struts.

For example, if I need a servlet to look up and show information about a
user, I will break it into the following parts.  I will have the
GetUserInfoServlet, a User bean (java class), and a DisplayUser class.
Once I enter the GetUserInfoServlet, I immediately pass the userId that I
got from the get request and pass it ti the User bean to perform a lookup
from my database or flat file or whatever.  Once that returns, I call
DisplayUser to format the output and sned it to the client.  Then I am
done.  This way, I am able to write a small main function in User.java and
DisplayUser.java that lets me test the classes independent of Tomcat.  It
becomes easy to test database connections, etc. (Solving DB related
problems in Tomcat is not fun).

I hope I was barking up the right tree and that this was useful.  If not,
give me some more info and I will try to help you out.  If you nee any
additional info about the examples or would like to see something more
concrete, let me know.

Cheers,
Stuart

                   + Stuart A. MacKenzie + http://www.iarad.com +

On 19 Aug 2003, Luke Vanderfluit wrote:

> Hi,
> 
> I'm using tomcat 4.1.27. on Redhat 9.
> In some documentation it tells me to use the console window extensively
> during development, 
> how do I do that?
> 
> If I start tomcat from the console with startup.sh I don't get a lot of
> feedback about what is happening.
> 
> Is the only way I can get that feedback by using System.out.println?
> 
> thanks,
> kind regards,
> 
> 
> -- 
> ====================================
> "when my computer smiles, I'm happy"
> ====================================
> Luke Vanderfluit 
> Mobile: 0421 276 282
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org