Re: Encoding in Tomcat 6

2007-05-22 Thread hkml
Georg Sauer-Limbach wrote:
 I do not think it is very obvious, that the response class is writing
 the characters using the platform's default encoding in this case
 
 Yes. And this is true for many, many places in the
 Java library. Always watch out if you see some
 String being processed using a Stream.
Yes, in general I take care of that, but in this case:
The response (who knows what encoding I want) gives me a special stream
where I find a method println( String s ). Why on earth should they
guess a character encoding for character output then.
Nevertheless: they said what they did in the apidoc, so it must be okay.
Strange enough, that it worked correctly in older Tomcat versions.

 The ServletOutputStream shouldn't have all these
 print methods, at least not the one for String.
The word deprecated comes to my mind :-)

Cheers and thanks again,
Heinz

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JDBC

2007-05-22 Thread ben short

Have a look here..

http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html

On 5/22/07, Mohammed Zabin [EMAIL PROTECTED] wrote:

Hi All

Am new on this, i want to know how to configure Database Connection Pooling
to use Oracle Database?? anyhelp will be appreciated.

Jotnarta



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Encoding in Tomcat 6

2007-05-22 Thread uzi
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

i liked this article regarding encoding:
http://java.sun.com/developer/technicalArticles/Intl/HTTPCharset/index.html

i think, it sais all one have to know... (at least in the context of web
apps)

uzi



[EMAIL PROTECTED] wrote:
 Georg Sauer-Limbach wrote:
 I do not think it is very obvious, that the response class is writing
 the characters using the platform's default encoding in this case
 Yes. And this is true for many, many places in the
 Java library. Always watch out if you see some
 String being processed using a Stream.
 Yes, in general I take care of that, but in this case:
 The response (who knows what encoding I want) gives me a special stream
 where I find a method println( String s ). Why on earth should they
 guess a character encoding for character output then.
 Nevertheless: they said what they did in the apidoc, so it must be okay.
 Strange enough, that it worked correctly in older Tomcat versions.
 
 The ServletOutputStream shouldn't have all these
 print methods, at least not the one for String.
 The word deprecated comes to my mind :-)
 
 Cheers and thanks again,
   Heinz
 
 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGUqwLWksoyMRHEmMRAnssAJ9oY3odBMJW1A3W9kDQCvPTRwSgYQCeJqXP
GMCSqrewZymi3fcqiisYBDo=
=/bII
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Encoding in Tomcat 6

2007-05-22 Thread hkml
uzi wrote:
 i liked this article regarding encoding:
 http://java.sun.com/developer/technicalArticles/Intl/HTTPCharset/index.html
Thanks for the hint. Looks nice.

Cheers,
Heinz

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JDBC

2007-05-22 Thread Zdeněk Vráblík

Hi,

here is example of Resource configration. Put it in context.xml file.

Resource name=Name
 auth=Container
 type=oracle.jdbc.pool.OracleDataSource
 factory=oracle.jdbc.pool.OracleDataSourceFactory
 user=oraUserName
 password=oraUserPass
 driverClassName=oracle.jdbc.driver.OracleDriver
 url=jdbc:oracle:thin:@IPAddress:1521:orcl
 maxActive=20 maxIdle=10 maxwait=-1/


java code to get connection:

DataSource ds = (DataSource) ctxt.lookup(java:/comp/env/ + poolName);
OracleConnection   conn   = ds.getConnection();

There is used another datasource type in OC4J
http://www.oracle.com/technology/sample_code/tech/java/codesnippet/j2ee/jdbc/JDBC_in_J2EE.html

Regards,
Zdenek

On 5/22/07, Mohammed Zabin [EMAIL PROTECTED] wrote:

Hi All

Am new on this, i want to know how to configure Database Connection Pooling
to use Oracle Database?? anyhelp will be appreciated.

Jotnarta



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JDBC

2007-05-22 Thread Mohammed Zabin

Thank you buddy, I have another confusing question for me,
I have two web.xml files, one in conf/web.xml and one in my application
under WEB-INF,
When configuring connection pool, which one shall i use? or shall i put the
configuration parameters in both of them??

Thank you


On 5/22/07, ben short [EMAIL PROTECTED] wrote:


Have a look here..


http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html

On 5/22/07, Mohammed Zabin [EMAIL PROTECTED] wrote:
 Hi All

 Am new on this, i want to know how to configure Database Connection
Pooling
 to use Oracle Database?? anyhelp will be appreciated.

 Jotnarta


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: JDBC

2007-05-22 Thread Mohammed Zabin

with your example, i don't have to put extra parameters in web.xml or
servlet.xml? just in context.xml???

On 5/22/07, Zdeněk Vráblík [EMAIL PROTECTED] wrote:


Hi,

here is example of Resource configration. Put it in context.xml file.

Resource name=Name
 auth=Container
 type=oracle.jdbc.pool.OracleDataSource
 factory=oracle.jdbc.pool.OracleDataSourceFactory
 user=oraUserName
 password=oraUserPass
 driverClassName=oracle.jdbc.driver.OracleDriver
 url=jdbc:oracle:thin:@IPAddress:1521:orcl
 maxActive=20 maxIdle=10 maxwait=-1/


java code to get connection:

DataSource ds = (DataSource) ctxt.lookup(java:/comp/env/ + poolName);
OracleConnection   conn   = ds.getConnection();

There is used another datasource type in OC4J

http://www.oracle.com/technology/sample_code/tech/java/codesnippet/j2ee/jdbc/JDBC_in_J2EE.html

Regards,
Zdenek

On 5/22/07, Mohammed Zabin [EMAIL PROTECTED] wrote:
 Hi All

 Am new on this, i want to know how to configure Database Connection
Pooling
 to use Oracle Database?? anyhelp will be appreciated.

 Jotnarta


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: JDBC

2007-05-22 Thread Foo Shyn
Not both of them. It's context.xml if u're using Tomcat 5.0 or above, or 
server.xml if u're using Tomcat 4.1 or below, which is located in the 
conf folder in Tomcat root path.


check this link out :
http://forums.oracle.com/forums/thread.jspa?messageID=1489914

Hope that helps.
FooShyn

Mohammed Zabin wrote:

Thank you buddy, I have another confusing question for me,
I have two web.xml files, one in conf/web.xml and one in my application
under WEB-INF,
When configuring connection pool, which one shall i use? or shall i 
put the

configuration parameters in both of them??

Thank you


On 5/22/07, ben short [EMAIL PROTECTED] wrote:


Have a look here..


http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html 



On 5/22/07, Mohammed Zabin [EMAIL PROTECTED] wrote:
 Hi All

 Am new on this, i want to know how to configure Database Connection
Pooling
 to use Oracle Database?? anyhelp will be appreciated.

 Jotnarta


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.467 / Virus Database: 269.7.6/814 - Release Date: 5/21/2007 2:01 PM
  



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JDBC

2007-05-22 Thread Mohammed Zabin

Thank you Foo,
I but the following in the context.xml:

*Resource name=Name
auth=Container
type=oracle.jdbc.pool.OracleDataSource
factory=oracle.jdbc.pool.OracleDataSourceFactory
user=hr
password=hr
driverClassName=oracle.jdbc.driver.OracleDriver
url=jdbc:oracle:thin:@localhost:1521:orcldb
maxActive=20 maxIdle=10 maxwait=-1/*
**
and I have this jsp code:


*%@ page import=javax.sql.DataSource %*

*%
 Context initContext = new InitialContext();
 Context envContext  = (Context)initContext.lookup(java:/comp/env);
 DataSource ds = (DataSource)envContext.lookup(jdbc/myoracledb);
 Connection conn = ds.getConnection();

 out.println( Got the connection );
%*

but, i got the following error:

*org.apache.jasper.JasperException: Unable to compile class for JSP:

An error occurred at line: 4 in the jsp file: /jsp/testDBCP.jsp
Context cannot be resolved to a type
1: %@ page import=javax.sql.DataSource %
2:
3: %
4:   Context initContext = new InitialContext();
5:   Context envContext  = (Context)initContext.lookup(java:/comp/env);
6:   DataSource ds = (DataSource)envContext.lookup(jdbc/myoracledb);
7:   Connection conn = ds.getConnection();


An error occurred at line: 4 in the jsp file: /jsp/testDBCP.jsp
InitialContext cannot be resolved to a type
1: %@ page import=javax.sql.DataSource %
*

On 5/22/07, Foo Shyn [EMAIL PROTECTED] wrote:


Not both of them. It's context.xml if u're using Tomcat 5.0 or above, or
server.xml if u're using Tomcat 4.1 or below, which is located in the
conf folder in Tomcat root path.

check this link out :
http://forums.oracle.com/forums/thread.jspa?messageID=1489914

Hope that helps.
FooShyn

Mohammed Zabin wrote:
 Thank you buddy, I have another confusing question for me,
 I have two web.xml files, one in conf/web.xml and one in my application
 under WEB-INF,
 When configuring connection pool, which one shall i use? or shall i
 put the
 configuration parameters in both of them??

 Thank you


 On 5/22/07, ben short [EMAIL PROTECTED] wrote:

 Have a look here..



http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html


 On 5/22/07, Mohammed Zabin [EMAIL PROTECTED] wrote:
  Hi All
 
  Am new on this, i want to know how to configure Database Connection
 Pooling
  to use Oracle Database?? anyhelp will be appreciated.
 
  Jotnarta
 

 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



 

 No virus found in this incoming message.
 Checked by AVG Free Edition.
 Version: 7.5.467 / Virus Database: 269.7.6/814 - Release Date: 5/21/2007
2:01 PM



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: JDBC

2007-05-22 Thread Foo Shyn
The jsp doesn't import the class for Context and Initial Context. Put 
them in as how u inport the Datasource would do.


HTH
FooShyn

Mohammed Zabin wrote:

Thank you Foo,
I but the following in the context.xml:

*Resource name=Name
auth=Container
type=oracle.jdbc.pool.OracleDataSource
factory=oracle.jdbc.pool.OracleDataSourceFactory
user=hr
password=hr
driverClassName=oracle.jdbc.driver.OracleDriver
url=jdbc:oracle:thin:@localhost:1521:orcldb
maxActive=20 maxIdle=10 maxwait=-1/*
**
and I have this jsp code:


*%@ page import=javax.sql.DataSource %*

*%
 Context initContext = new InitialContext();
 Context envContext  = (Context)initContext.lookup(java:/comp/env);
 DataSource ds = (DataSource)envContext.lookup(jdbc/myoracledb);
 Connection conn = ds.getConnection();

 out.println( Got the connection );
%*

but, i got the following error:

*org.apache.jasper.JasperException: Unable to compile class for JSP:

An error occurred at line: 4 in the jsp file: /jsp/testDBCP.jsp
Context cannot be resolved to a type
1: %@ page import=javax.sql.DataSource %
2:
3: %
4:   Context initContext = new InitialContext();
5:   Context envContext  = (Context)initContext.lookup(java:/comp/env);
6:   DataSource ds = (DataSource)envContext.lookup(jdbc/myoracledb);
7:   Connection conn = ds.getConnection();


An error occurred at line: 4 in the jsp file: /jsp/testDBCP.jsp
InitialContext cannot be resolved to a type
1: %@ page import=javax.sql.DataSource %
*

On 5/22/07, Foo Shyn [EMAIL PROTECTED] wrote:


Not both of them. It's context.xml if u're using Tomcat 5.0 or above, or
server.xml if u're using Tomcat 4.1 or below, which is located in the
conf folder in Tomcat root path.

check this link out :
http://forums.oracle.com/forums/thread.jspa?messageID=1489914

Hope that helps.
FooShyn

Mohammed Zabin wrote:
 Thank you buddy, I have another confusing question for me,
 I have two web.xml files, one in conf/web.xml and one in my 
application

 under WEB-INF,
 When configuring connection pool, which one shall i use? or shall i
 put the
 configuration parameters in both of them??

 Thank you


 On 5/22/07, ben short [EMAIL PROTECTED] wrote:

 Have a look here..



http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html 




 On 5/22/07, Mohammed Zabin [EMAIL PROTECTED] wrote:
  Hi All
 
  Am new on this, i want to know how to configure Database Connection
 Pooling
  to use Oracle Database?? anyhelp will be appreciated.
 
  Jotnarta
 

 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



 



 No virus found in this incoming message.
 Checked by AVG Free Edition.
 Version: 7.5.467 / Virus Database: 269.7.6/814 - Release Date: 
5/21/2007

2:01 PM



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.467 / Virus Database: 269.7.6/814 - Release Date: 5/21/2007 2:01 PM
  



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Action methods stopped working

2007-05-22 Thread Michal Glowacki
 Hi,

 I have a very big problem, that I can't solve myself. Recently,
action
 methods from links and buttons has stopped working. And not only from one
 componenty family, but 2 (Sun Web UI and Ajax4JSF). I don't know what
caused
 the problem, I've only add an attribute URIEncoding=UTF-8 to Connector
 tag in server.xml. I've made another simple application from the scratch,
 the same problem so it must be something with web container.

 Has anybody had similar problem?

 Regards,
Michal



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JDBC

2007-05-22 Thread Mohammed Zabin

Thank you Foo for your patience with me,
I did imported all the needed classes, but i got the following exception:


*exception *

*org.apache.jasper.JasperException: An exception occurred processing
JSP page /jsp/testDBCP.jsp at line 7

4:   Context initContext = new InitialContext();
5:   Context envContext  = (Context)initContext.lookup(java:/comp/env);
6:   DataSource ds = (DataSource)envContext.lookup(jdbc/myoracledb);
7:   Connection conn = ds.getConnection();
8:
9:   out.println( The Connection Gotted Fine );
10: %


Stacktrace:

org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:515)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:408)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)*

**

*root cause *

*javax.servlet.ServletException:
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC
driver of class '' for connect URL 'null'

org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:855)

org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:784)
org.apache.jsp.jsp.testDBCP_jsp._jspService(testDBCP_jsp.java:73)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:384)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)*

**

*root cause*

org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC
driver of class '' for connect URL 'null'

org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:780)

org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)
org.apache.jsp.jsp.testDBCP_jsp._jspService(testDBCP_jsp.java:62)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:384)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

*root cause*

java.lang.NullPointerException
sun.jdbc.odbc.JdbcOdbcDriver.getProtocol(JdbcOdbcDriver.java:507)
sun.jdbc.odbc.JdbcOdbcDriver.knownURL(JdbcOdbcDriver.java:476)
sun.jdbc.odbc.JdbcOdbcDriver.acceptsURL(JdbcOdbcDriver.java:307)
java.sql.DriverManager.getDriver(DriverManager.java:253)

org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:773)

org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)
org.apache.jsp.jsp.testDBCP_jsp._jspService(testDBCP_jsp.java:62)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:384)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)




On 5/22/07, Foo Shyn [EMAIL PROTECTED] wrote:


The jsp doesn't import the class for Context and Initial Context. Put
them in as how u inport the Datasource would do.

HTH
FooShyn

Mohammed Zabin wrote:
 Thank you Foo,
 I but the following in the context.xml:

 *Resource name=Name
 auth=Container
 type=oracle.jdbc.pool.OracleDataSource
 factory=oracle.jdbc.pool.OracleDataSourceFactory
 user=hr
 password=hr
 driverClassName=oracle.jdbc.driver.OracleDriver
 url=jdbc:oracle:thin:@localhost:1521:orcldb
 maxActive=20 maxIdle=10 maxwait=-1/*
 **
 and I have this jsp code:


 *%@ page import=javax.sql.DataSource %*

 *%
  Context initContext = new InitialContext();
  Context envContext  = (Context)initContext.lookup(java:/comp/env);
  DataSource ds = (DataSource)envContext.lookup(jdbc/myoracledb);
  Connection conn = ds.getConnection();

  out.println( Got the connection );
 %*

 but, i got the following error:

 *org.apache.jasper.JasperException: Unable to compile class for JSP:

 An error occurred at line: 4 in the jsp file: /jsp/testDBCP.jsp
 Context cannot be resolved to a type
 1: %@ page import=javax.sql.DataSource %
 2:
 3: %
 4:   Context initContext = new 

Re: hi,wired problem? add 0 into alist but get 1 as a result!

2007-05-22 Thread David Delbecq
En l'instant précis du 22/05/07 05:21, Peter s'exprimait en ces termes:
 hi all;
 only get problem when put 0 into the list, put 1 or any number is ok, put
 new Integer(0) is ok as well;
Ide not recompiling or tomcat not reloading class, while you think you
are running the 0 case, you are in fact running the 1 case. did you try
successfully storing 3 then switch back to 0. If It does not compile at
0, your test case will still show 3.

 i think it may be a bug.
 does anyone has a idea?
 regards


 On 5/21/07, Peter [EMAIL PROTECTED] wrote:

 hi all,

 I have come into a very wired problem.

 here it is.
 my project using JBuilder 2006 and tomcat 5.5.20.
 when i put a 0 into a list and get 1 as a result.
 simple code for testing!

 List alist =new ArrayList();
 alist.add(0); put 0 into it
 alist.get(0); get 1 as result.

 it occurs when i using JBuilder2006 to complie it and run under tomcat
 5.5.20.
 i choose Jbuilder 2006 builder property: language features ( java 2 SDK
 V5.0 generic enable) ; target VM java 2 SDK V5.0 and later

 but if i choose target VM target VM java 2 SDK V1.4 and later it
 works fine, put 0 get 0.
 and if i donot run under the tomcat it still fine

 so i create another small project, in a jsp only doing List alist =new
 ArrayList();
 alist.add(0); alist.get(0);
 and it works fine as well under the same tomcat.


 i wonder what happens here?
 my project using many other jar file , i wonder if there is something
 wrong there.
 does anyone has a idea?

 thanks in advanced!







-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JDBC

2007-05-22 Thread Foo Shyn
Check out ur resource name, it is different from the one u use to get ur 
connection pooling. The resource name must be the same as your lookup name.


HTH
FooShyn

Mohammed Zabin wrote:

Thank you Foo for your patience with me,
I did imported all the needed classes, but i got the following exception:


*exception *

*org.apache.jasper.JasperException: An exception occurred processing
JSP page /jsp/testDBCP.jsp at line 7

4:   Context initContext = new InitialContext();
5:   Context envContext  = (Context)initContext.lookup(java:/comp/env);
6:   DataSource ds = (DataSource)envContext.lookup(jdbc/myoracledb);
7:   Connection conn = ds.getConnection();
8:
9:   out.println( The Connection Gotted Fine );
10: %


Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:515) 

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:408) 

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320) 


org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)*

**

*root cause *

*javax.servlet.ServletException:
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC
driver of class '' for connect URL 'null'
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:855) 

org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:784) 


org.apache.jsp.jsp.testDBCP_jsp._jspService(testDBCP_jsp.java:73)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:384) 

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320) 


org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)*

**

*root cause*

org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC
driver of class '' for connect URL 'null'
org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:780) 

org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540) 


org.apache.jsp.jsp.testDBCP_jsp._jspService(testDBCP_jsp.java:62)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:384) 

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320) 


org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

*root cause*

java.lang.NullPointerException
sun.jdbc.odbc.JdbcOdbcDriver.getProtocol(JdbcOdbcDriver.java:507)
sun.jdbc.odbc.JdbcOdbcDriver.knownURL(JdbcOdbcDriver.java:476)
sun.jdbc.odbc.JdbcOdbcDriver.acceptsURL(JdbcOdbcDriver.java:307)
java.sql.DriverManager.getDriver(DriverManager.java:253)
org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:773) 

org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540) 


org.apache.jsp.jsp.testDBCP_jsp._jspService(testDBCP_jsp.java:62)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:384) 

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320) 


org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)




On 5/22/07, Foo Shyn [EMAIL PROTECTED] wrote:


The jsp doesn't import the class for Context and Initial Context. Put
them in as how u inport the Datasource would do.

HTH
FooShyn

Mohammed Zabin wrote:
 Thank you Foo,
 I but the following in the context.xml:

 *Resource name=Name
 auth=Container
 type=oracle.jdbc.pool.OracleDataSource
 factory=oracle.jdbc.pool.OracleDataSourceFactory
 user=hr
 password=hr
 driverClassName=oracle.jdbc.driver.OracleDriver
 url=jdbc:oracle:thin:@localhost:1521:orcldb
 maxActive=20 maxIdle=10 maxwait=-1/*
 **
 and I have this jsp code:


 *%@ page import=javax.sql.DataSource %*

 *%
  Context initContext = new InitialContext();
  Context envContext  = (Context)initContext.lookup(java:/comp/env);
  DataSource ds = (DataSource)envContext.lookup(jdbc/myoracledb);
  Connection conn = ds.getConnection();

  out.println( Got the connection );
 %*

 but, i got the following error:

 *org.apache.jasper.JasperException: Unable to compile class for JSP:

 An error occurred at line: 4 in the jsp file: /jsp/testDBCP.jsp
 Context cannot be resolved to a type
 1: %@ page 

Re: JDBC

2007-05-22 Thread Mohammed Zabin

When searching on Tomcat documentation, i found that it uses both server.xmland
web.xml, again, I got the same error,

*org.apache.jasper.JasperException: An exception occurred processing
JSP page /jsp/testDBCP.jsp at line 7

4:   Context initContext = new InitialContext();
5:   Context envContext  = (Context)initContext.lookup(java:/comp/env);
6:   DataSource ds = (DataSource)envContext.lookup(jdbc/myoracledb);
7:   Connection conn = ds.getConnection();
8:
9:   out.println( The Connection Gotted Fine );
10: %


Stacktrace:

org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:515)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:408)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)*

**

*root cause *

*javax.servlet.ServletException:
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC
driver of class '' for connect URL 'null'

org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:855)

org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:784)
org.apache.jsp.jsp.testDBCP_jsp._jspService(testDBCP_jsp.java:73)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:384)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)*




On 5/22/07, Foo Shyn [EMAIL PROTECTED] wrote:


Check out ur resource name, it is different from the one u use to get ur
connection pooling. The resource name must be the same as your lookup
name.

HTH
FooShyn

Mohammed Zabin wrote:
 Thank you Foo for your patience with me,
 I did imported all the needed classes, but i got the following
exception:


 *exception *

 *org.apache.jasper.JasperException: An exception occurred processing
 JSP page /jsp/testDBCP.jsp at line 7

 4:   Context initContext = new InitialContext();
 5:   Context envContext  =
(Context)initContext.lookup(java:/comp/env);
 6:   DataSource ds = (DataSource)envContext.lookup(jdbc/myoracledb);
 7:   Connection conn = ds.getConnection();
 8:
 9:   out.println( The Connection Gotted Fine );
 10: %


 Stacktrace:
 org.apache.jasper.servlet.JspServletWrapper.handleJspException(
JspServletWrapper.java:515)

 org.apache.jasper.servlet.JspServletWrapper.service(
JspServletWrapper.java:408)

 org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java
:320)

 org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:803)*

 **

 *root cause *

 *javax.servlet.ServletException:
 org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC
 driver of class '' for connect URL 'null'
 org.apache.jasper.runtime.PageContextImpl.doHandlePageException(
PageContextImpl.java:855)

 org.apache.jasper.runtime.PageContextImpl.handlePageException(
PageContextImpl.java:784)

 org.apache.jsp.jsp.testDBCP_jsp._jspService(testDBCP_jsp.java:73)
 org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
 org.apache.jasper.servlet.JspServletWrapper.service(
JspServletWrapper.java:384)

 org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java
:320)

 org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:803)*

 **

 *root cause*

 org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC
 driver of class '' for connect URL 'null'
 org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(
BasicDataSource.java:780)

 org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(
BasicDataSource.java:540)

 org.apache.jsp.jsp.testDBCP_jsp._jspService(testDBCP_jsp.java:62)
 org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
 org.apache.jasper.servlet.JspServletWrapper.service(
JspServletWrapper.java:384)

 org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java
:320)

 org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

 *root cause*

 java.lang.NullPointerException
 sun.jdbc.odbc.JdbcOdbcDriver.getProtocol(JdbcOdbcDriver.java:507)
 sun.jdbc.odbc.JdbcOdbcDriver.knownURL(JdbcOdbcDriver.java:476)
 sun.jdbc.odbc.JdbcOdbcDriver.acceptsURL(JdbcOdbcDriver.java:307)
 

Oracle 10g with Tomcat 6

2007-05-22 Thread Mohammed Zabin

Hi All
I want to conigure DBCP to connect to Oracle 10g on my localhost on Tomcat6.
I did the following error, I don't know how to solve it, is there is a
third-party jar file that must be added to classpath???

*1. I put the following in server.xml*
*Resource name=jbdc/myoracledb auth=Container
 type=javax.sql.DataSource /

   ResourceParams name=jdbc/myoracledb
  parameter
 namefactory/name
 valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
  /parameter
  parameter
 namedriverClassName/name
 valueoracle.jdbc.OracleDriver/value
  /parameter
  parameter
 nameurl/name
 valuejdbc:oracle:thin:@127.0.0.1:1521:orcldb/value
  /parameter
  parameter
 nameusername/name
 valuehr/value
  /parameter
  parameter
 namepassword/name
 valuehr/value
  /parameter
  parameter
 namemaxActive/name
 value20/value
  /parameter
  parameter
 namemaxIdle/name
 value10/value
  /parameter
  parameter
 namemaxWait/name
 value-1/value
  /parameter
   /ResourceParams*

*2. The following in web.xml:*
*resource-ref
  descriptionOracle Datasource example/description
  res-ref-namejdbc/myoracledb/res-ref-name
  res-typejavax.sql.DataSource/res-type
  res-authContainer/res-auth
/resource-ref*

3. And here is my JSP Code:

%@ page import=javax.sql.*, javax.naming.*, java.sql.* %

%
 Context initContext = new InitialContext();
 Context envContext  = (Context)initContext.lookup(java:/comp/env);
 DataSource ds = (DataSource)envContext.lookup(jdbc/myoracledb);
 Connection conn = ds.getConnection();

 out.println( Connection Established );
%

When running the page, i got the following error:

*org.apache.jasper.JasperException: An exception occurred processing
JSP page /jsp/testDBCP.jsp at line 7

4:   Context initContext = new InitialContext();
5:   Context envContext  = (Context)initContext.lookup(java:/comp/env);
6:   DataSource ds = (DataSource)envContext.lookup(jdbc/myoracledb);
7:   Connection conn = ds.getConnection();
8:
9:   out.println( Connection Established );
10: %


Stacktrace:

org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:515)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:408)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)*

**

*root cause *

*javax.servlet.ServletException:
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC
driver of class '' for connect URL 'null'

org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:855)

org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:784)
org.apache.jsp.jsp.testDBCP_jsp._jspService(testDBCP_jsp.java:73)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:384)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)*


Re: JDBC

2007-05-22 Thread Pid
It sounds like you need to read up on both the Servlet Spec and basic 
Tomcat configuration.  There are plenty of tutorials to be found via 
basic Google searches.  This list is usually more able/inclined to help 
people with problems, rather than basic tutorials.



As the previous reply pointed out, your Resource is incorrectly named 
'Name' when it should be 'jdbc/myoracledb'.



FYI:

  conf/server.xml  - configures hosts  server
  conf/web.xml - configures application environment( more)
  conf/context.xml - configures default Context attributes

  your/WEB-INF/web.xml  - your application config
  your/META-INF/context.xml - your Context config


Each of the above files serves a different purpose, although there are 
some intentional overlaps.  At this stage I'd suggest that all of your 
testing should be done in the latter two files.


rgds


p



Mohammed Zabin wrote:
When searching on Tomcat documentation, i found that it uses both 
server.xmland

web.xml, again, I got the same error,

*org.apache.jasper.JasperException: An exception occurred processing
JSP page /jsp/testDBCP.jsp at line 7

4:   Context initContext = new InitialContext();
5:   Context envContext  = (Context)initContext.lookup(java:/comp/env);
6:   DataSource ds = (DataSource)envContext.lookup(jdbc/myoracledb);
7:   Connection conn = ds.getConnection();
8:
9:   out.println( The Connection Gotted Fine );
10: %


Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:515) 

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:408) 

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320) 


org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)*

**

*root cause *

*javax.servlet.ServletException:
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC
driver of class '' for connect URL 'null'
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:855) 

org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:784) 


org.apache.jsp.jsp.testDBCP_jsp._jspService(testDBCP_jsp.java:73)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:384) 

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320) 


org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)*




On 5/22/07, Foo Shyn [EMAIL PROTECTED] wrote:


Check out ur resource name, it is different from the one u use to get ur
connection pooling. The resource name must be the same as your lookup
name.

HTH
FooShyn

Mohammed Zabin wrote:
 Thank you Foo for your patience with me,
 I did imported all the needed classes, but i got the following
exception:


 *exception *

 *org.apache.jasper.JasperException: An exception occurred processing
 JSP page /jsp/testDBCP.jsp at line 7

 4:   Context initContext = new InitialContext();
 5:   Context envContext  =
(Context)initContext.lookup(java:/comp/env);
 6:   DataSource ds = (DataSource)envContext.lookup(jdbc/myoracledb);
 7:   Connection conn = ds.getConnection();
 8:
 9:   out.println( The Connection Gotted Fine );
 10: %


 Stacktrace:
 org.apache.jasper.servlet.JspServletWrapper.handleJspException(
JspServletWrapper.java:515)

 org.apache.jasper.servlet.JspServletWrapper.service(
JspServletWrapper.java:408)

 org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java
:320)

 org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:803)*

 **

 *root cause *

 *javax.servlet.ServletException:
 org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC
 driver of class '' for connect URL 'null'
 org.apache.jasper.runtime.PageContextImpl.doHandlePageException(
PageContextImpl.java:855)

 org.apache.jasper.runtime.PageContextImpl.handlePageException(
PageContextImpl.java:784)

 org.apache.jsp.jsp.testDBCP_jsp._jspService(testDBCP_jsp.java:73)
 org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
 org.apache.jasper.servlet.JspServletWrapper.service(
JspServletWrapper.java:384)

 org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java
:320)

 org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:803)*

 **

 *root cause*

 org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC
 driver of class '' for connect URL 'null'
 org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(
BasicDataSource.java:780)

 

BootStrap - Is in redundant?

2007-05-22 Thread Johnny Kewl
Please bear with me while I study and learn Tomcats src code...

My environment is a little different to the ant build, in that I am running the 
source directly from the netbeans IDE. It works by the way and once I've 
figured it all out, I'll post the project to a site so others can do it too. 
The biggest difference is that tomcat becomes one jar file... with just a few 
associated lib files like ant.jar

The other thing is that the mode of operation I'm working with, is not the 
typical embedded environment... its still XML config environment, with conf and 
webapps in the same folder as the jar file  it seems to work perfectly.

OK... questions... lots of em... guessing is allowed ;)

=BOOTSTRAP=
Bootstrap seems to classload files in the SERVER folder (old tomcat 5.5 style) 
and then it calls into Catalina which does the digest XML stuff and this in 
turn calls into Embedded.  Other than for legacy support, does this mean 
Bootstrap is redundant?  If I bypass Bootstrap and call (start) directly into 
Catalina... it seems to work perfectly... but I'm just wondering if theres a 
surprize somewhere if one bypasses that server class loader.

=Start Stop Mechanism=
I see that START goes into a wait loop... and it will pop out of this when STOP 
is called.  I understand how this works from a single program (process), but I 
cant understand how this works from start and stop bat files... or in two calls 
from 2 separate processes. To me that will launch an instance and start it... 
and launch a separate instance and stop it... never shall the 2 meet??? How 
does that work?

=EJB and Annotations=
I see stuff like javax.ejb and javax.annotation in the source what is that 
stuff for?

=org.apache.tomcat.util.net.puretls seems broken=
To make this thing work... one ends up with external libs... like cryptix, 
puretls... its a mission!  Can I remove this... is it experimental??

=org.eclipse.jdt.core_3.2.3.v_686_R32x.jar=
Why?  Is this for compiling? What does Tomcat compile at runtime? Why is this 
lib needed?

Thanks in advance hopefully one day I'll be able to contribute.



Johnny Kewl 
  eMail: JohnNo Spamkewlstuff.co.za  -- replace No Spam with @ --
  Cell: +027-72- 473-9331
Java Developer (Tomcat Aficionado)
  Free Tomcat software at  http://coolese.100free.com/


Re: Action methods stopped working

2007-05-22 Thread Mark Thomas
Michal Glowacki wrote:
  I don't know what caused
  the problem, I've only add an attribute URIEncoding=UTF-8 to Connector
Does removing this fix the problem?

Mark

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: BootStrap - Is in redundant?

2007-05-22 Thread Mark Deneen

It opens up a listening socket on the loopback address.  The second
process connects to this socket and sends a message telling tomcat to
shut down.

Mark

On 5/22/07, Johnny Kewl [EMAIL PROTECTED] wrote:

=Start Stop Mechanism=
I see that START goes into a wait loop... and it will pop out of this when STOP 
is called.  I understand how this works from a single program (process), but I 
cant understand how this works from start and stop bat files... or in two calls 
from 2 separate processes. To me that will launch an instance and start it... 
and launch a separate instance and stop it... never shall the 2 meet??? How 
does that work?


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Tomcat and Static file Caching ( 304 headers )

2007-05-22 Thread [EMAIL PROTECTED]

I am using Tomcat 5.5 together with Eclipse 3.2.2 for development
of a web application.

But when i use FireBug in Firefox to track network traffic is
see that tomcat never returns a 304 NOT MODIFIED header
if a file is requested twice.

For example when requesting a JavaScript file:
http://localhost:8080/XDataSystem/standard/js/standard.js
you see the following headers:

*Response Headers*
Server  Apache-Coyote/1.1
EtagW/10823-1179768573406
Last-Modified   Mon, 21 May 2007 17:29:33 GMT
Content-Typetext/javascript
Content-Encodinggzip
VaryAccept-Encoding
DateTue, 22 May 2007 11:52:27 GMT
*Request Headers*
Hostlocalhost:8080
User-Agent 	Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.3) 
Gecko/20070309 Firefox/2.0.0.3

Accept  */*
Accept-Language nl,en-us;q=0.7,en;q=0.3
Accept-Encoding gzip,deflate
Accept-Charset  ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive  300
Connection  keep-alive
Referer http://localhost:8080/XDataSystem/rainbow/home.page



As you can see in the response filter i have turned GZIP compressoin on.

But when i request the page again ( by typing the url in the url-bar, 
NOT using F5 )

I get the exact same response back.. But i expect a 304 response.

I think it has something to do with the Vary response field.
I have read this:
http://localhost:8080/XDataSystem/standard/js/standard.js

But i do not understand it fully.

can anybody help me??
This really makes my application ( using dojo ) slow.

Thanks in advance.

Tjerk Wolterink



Re: Tomcat and Static file Caching ( 304 headers )

2007-05-22 Thread [EMAIL PROTECTED]

There is one typo:

--
I have read this:
http://localhost:8080/XDataSystem/standard/js/standard.js
--

Must be replaces by:

--
I have read this:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.44
--

( Sorry, Copy-Paste error )

[EMAIL PROTECTED] schreef:

I am using Tomcat 5.5 together with Eclipse 3.2.2 for development
of a web application.

But when i use FireBug in Firefox to track network traffic is
see that tomcat never returns a 304 NOT MODIFIED header
if a file is requested twice.

For example when requesting a JavaScript file:
http://localhost:8080/XDataSystem/standard/js/standard.js
you see the following headers:

*Response Headers*
Server Apache-Coyote/1.1
Etag W/10823-1179768573406
Last-Modified Mon, 21 May 2007 17:29:33 GMT
Content-Type text/javascript
Content-Encoding gzip
Vary Accept-Encoding
Date Tue, 22 May 2007 11:52:27 GMT
*Request Headers*
Host localhost:8080
User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; 
rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3

Accept */*
Accept-Language nl,en-us;q=0.7,en;q=0.3
Accept-Encoding gzip,deflate
Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive 300
Connection keep-alive
Referer http://localhost:8080/XDataSystem/rainbow/home.page



As you can see in the response filter i have turned GZIP compressoin on.

But when i request the page again ( by typing the url in the url-bar, 
NOT using F5 )

I get the exact same response back.. But i expect a 304 response.

I think it has something to do with the Vary response field.
I have read this:
http://localhost:8080/XDataSystem/standard/js/standard.js

But i do not understand it fully.

can anybody help me??
This really makes my application ( using dojo ) slow.

Thanks in advance.

Tjerk Wolterink





-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Oracle 10g with Tomcat 6

2007-05-22 Thread David Smith
You are using an old syntax for defining resource parameters.  
Parameters of a resource are defined as attributes of the Resource   / 
element since tomcat 5.5.  See the following docs for the correct method:


http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html

--David

Mohammed Zabin wrote:


Hi All
I want to conigure DBCP to connect to Oracle 10g on my localhost on 
Tomcat6.

I did the following error, I don't know how to solve it, is there is a
third-party jar file that must be added to classpath???

*1. I put the following in server.xml*
*Resource name=jbdc/myoracledb auth=Container
 type=javax.sql.DataSource /

   ResourceParams name=jdbc/myoracledb
  parameter
 namefactory/name
 valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
  /parameter
  parameter
 namedriverClassName/name
 valueoracle.jdbc.OracleDriver/value
  /parameter
  parameter
 nameurl/name
 valuejdbc:oracle:thin:@127.0.0.1:1521:orcldb/value
  /parameter
  parameter
 nameusername/name
 valuehr/value
  /parameter
  parameter
 namepassword/name
 valuehr/value
  /parameter
  parameter
 namemaxActive/name
 value20/value
  /parameter
  parameter
 namemaxIdle/name
 value10/value
  /parameter
  parameter
 namemaxWait/name
 value-1/value
  /parameter
   /ResourceParams*

*2. The following in web.xml:*
*resource-ref
  descriptionOracle Datasource example/description
  res-ref-namejdbc/myoracledb/res-ref-name
  res-typejavax.sql.DataSource/res-type
  res-authContainer/res-auth
/resource-ref*

3. And here is my JSP Code:

%@ page import=javax.sql.*, javax.naming.*, java.sql.* %

%
 Context initContext = new InitialContext();
 Context envContext  = (Context)initContext.lookup(java:/comp/env);
 DataSource ds = (DataSource)envContext.lookup(jdbc/myoracledb);
 Connection conn = ds.getConnection();

 out.println( Connection Established );
%

When running the page, i got the following error:

*org.apache.jasper.JasperException: An exception occurred processing
JSP page /jsp/testDBCP.jsp at line 7

4:   Context initContext = new InitialContext();
5:   Context envContext  = (Context)initContext.lookup(java:/comp/env);
6:   DataSource ds = (DataSource)envContext.lookup(jdbc/myoracledb);
7:   Connection conn = ds.getConnection();
8:
9:   out.println( Connection Established );
10: %


Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:515) 

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:408) 

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320) 


org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)*

**

*root cause *

*javax.servlet.ServletException:
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC
driver of class '' for connect URL 'null'
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:855) 

org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:784) 


org.apache.jsp.jsp.testDBCP_jsp._jspService(testDBCP_jsp.java:73)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:384) 

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320) 


org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)*




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Session IDs XMLHttpRequests

2007-05-22 Thread Williams, Allen
Thanks for the hint.  I had come to the conclusion I was going to have
to do something like that.  It is not a JS framework- it's Javascript 
Java in a Tomcat container, all built in-house.

Again, I looked at the XMLHttpRequest with Firebug, but saw no reference
to the cookies.

Once you get the session ID (using your method below) into your servlet,
how do you tell the servlet to use it?  The only API I found for that is
deprecated with no replacement.


  Thanks, Dave  Frank.
  
  I've followed both your suggestions.  The very first
  lines in the servlet print out the various parameter, attributes, 
  cookies.
  Here's what I get:
 
 Have you used a standard JS framework of some sort, or is it in-house 
 code?  Testing with Firebug is, as has been stated, the way 
 to find out 
 what's being sent by your browser  therefore what the JS code you're 
 using is actually doing.
 
 I concur with the chaps who've already posted - in that your AJAX is 
 probably not sending the cookie data.
 
 
 You could manually attach the session id in your JS. We use the 
 following snippet to provide access to that data in JS, for 
 some parts 
 of one of our apps.
 
 script type=text/javascript
 var Session = {
id : '${pageContext.session.id}',
user : '${pageContext.request.remoteUser}'
 }
 /script
 
 var url = path + ;jsessionid= + Session.id + ? + queryParams;
 
 
 p
 
 
 
 
  -- QUOTE --
  **
  doPost entering
  May 21 16:16:23: Session Attributes
  
  Session Attributes
  May 21 16:16:23: Session isNew()= true
  May 21 16:16:23: No attributes in this scope
  
  May 21 16:16:23: Request Attributes
  
  Request Attributes
  May 21 16:16:23: No attributes in this scope
  
  May 21 16:16:23: Parameters
  
  Request Parameters
  owner = 6
  ajaxreq = getfora
  type = 0
  
  
  May 21 16:16:23: Cookies
  May 21 16:16:23: 'JSESSIONID'='97E2CA20966390CCBC851738E71F3053'
  May 21 16:16:23: Found 1 cookies
  -- END QUOTE --
  
  As I said in my earlier post, the session being returned by 
 getSession()
  is a new one;
  when I call it like getSession(false) it return a null session.
  Therefore, it contains
  no attributes.  The parameters are, of course, exactly what 
 I expected.
  As you can see,
  there is the JSESSIONID cookie, but, for some reason, the 
 servlet isn't
  using it, or it
  is not valid.
  
  Again, according to Sun, everyone one of the API functions 
 to manipulate
  session IDs are
  deprecated, so I can't even kludge it up.  I have no idea 
 if that is a
  valid session ID or
  not.
  
  Also, I used Firebug to examine the XMLHttpRequest.  I'm 
 not too sure
  what I'm looking for.
  There was no reference to cookies, and all the stuff that I 
 set was OK.
  Anyway, it seems to
  be getting the cookie.
  
  Any ideas as to why the session wouldn't use this cookie, 
 or why this
  cookie might be invalid?
  In the process of this debugging, I have seen two 
 JSESSIONIDs come over,
  one valid, one not.
  
  Thanks again for the help.
  
  
  -Original Message-
  From: Frank W. Zammetti [mailto:[EMAIL PROTECTED] 
  Sent: Monday, May 21, 2007 3:29 PM
  To: Tomcat Users List
  Cc: users@tomcat.apache.org; [EMAIL PROTECTED]
  Subject: Re: Session IDs  XMLHttpRequests
 
  I can say with 100% certainty that a servlet invoked with 
  XMLHttpRequest
  **DOES** have the same access to server-side objects as a non-AJAX
  request.  I say this based on two applications in production 
  that do this
  all day long, one Struts-based, one not.  I also say it based 
  on a number
  of other applications, some using other frameworks, some 
 using plain
  servlets, all that do this as well, with no problems.
 
  Now, the two production apps, which are very much 
 AJAX-based, not just
  using it here and there, are running on Websphere, so that 
 leaves the
  possibility that there's something going on with Tomcat.  
 However, I
  generally develop under Tomcat, including most of those 
 other apps I
  mentioned, and never observed this problem.
 
  This isn't to say what your seeing isn't truly an issue, I 
  have no doubt
  it is... but, the only difference I can conceive of, based 
 on all this
  experience, between an AJAX request and a normal POST/GET, is 
  the session
  cookie not being passed in with the AJAX request.  I could 
  believe that
  might happen, and I could also believe it may be different 
  from browser to
  browser (don't misunderstand, I have no knowledge of this 
  being the case,
  but it wouldn't shock me).
 
  As another poster suggested, I would begin by monitoring 
 the requests
  going across in Firefox with Firebug, and perhaps 
  TamperData... you should
  be able to see every detail of the request and response 
 with those...
  compare an AJAX request with a plain form sumission or link 
  click and see
  if you notice any difference... I'd bet dollars to donuts 
  you'll find some
  header missing, or something along those lines.
 
  But, unless there's 

RE: Session IDs XMLHttpRequests

2007-05-22 Thread Williams, Allen
I'll work on that today.


 -Original Message-
 From: Hassan Schroeder [mailto:[EMAIL PROTECTED] 
 Sent: Monday, May 21, 2007 5:32 PM
 To: Tomcat Users List
 Subject: Re: Session IDs  XMLHttpRequests
 
 On 5/21/07, Williams, Allen [EMAIL PROTECTED] wrote:
 
  As I said in my earlier post, the session being returned by 
 getSession()
  is a new one;
 
 Can you create a simple test case WAR to demonstrate the failure?
 I have seen no such problems using Prototype, YUI, or DWR, which
 I'm currently incorporating into an app.
 
 To test your contention, I've printed the sessionId in a JSP page and
 made an XHR request via DWR to another simple JSP which logs the
 sessionId; it's the same, and that second controller page can access
 the same session attributes as the original page.
 
 So I have to suspect there's something odd about your setup -- the
 test case would be useful...
 
 FWIW,
 -- 
 Hassan Schroeder  [EMAIL PROTECTED]
 
 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JDBC

2007-05-22 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Pid,

Pid wrote:
 As the previous reply pointed out, your Resource is incorrectly named
 'Name' when it should be 'jdbc/myoracledb'.

Unfortunately, someone gave him a bad example, so he didn't have a chance :(

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGUueX9CaO5/Lv0PARAh88AJ97v32XO4g0TjsJo4HF5LghYkLscgCeJlqo
DOlmBrCDCdNCrcCzedgv8wI=
=D82P
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: BootStrap - Is in redundant?

2007-05-22 Thread Johnny Kewl
Ha... thank u kind sir... I see it now, the mystery of StandardServer is 
unraveled ;)


- Original Message - 
From: Mark Deneen [EMAIL PROTECTED]

To: Tomcat Users List users@tomcat.apache.org
Sent: Tuesday, May 22, 2007 2:12 PM
Subject: Re: BootStrap - Is in redundant?



It opens up a listening socket on the loopback address.  The second
process connects to this socket and sends a message telling tomcat to
shut down.

Mark

On 5/22/07, Johnny Kewl [EMAIL PROTECTED] wrote:

=Start Stop Mechanism=
I see that START goes into a wait loop... and it will pop out of this 
when STOP is called.  I understand how this works from a single program 
(process), but I cant understand how this works from start and stop bat 
files... or in two calls from 2 separate processes. To me that will 
launch an instance and start it... and launch a separate instance and 
stop it... never shall the 2 meet??? How does that work?



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Session IDs XMLHttpRequests

2007-05-22 Thread David Smith
As long as it's encoded on the url as shown in the example below (and 
defined in the servlet spec), tomcat will just pick it  up and use it.  
No additional APIs required.


--David

Williams, Allen wrote:


Thanks for the hint.  I had come to the conclusion I was going to have
to do something like that.  It is not a JS framework- it's Javascript 
Java in a Tomcat container, all built in-house.

Again, I looked at the XMLHttpRequest with Firebug, but saw no reference
to the cookies.

Once you get the session ID (using your method below) into your servlet,
how do you tell the servlet to use it?  The only API I found for that is
deprecated with no replacement.


 


Thanks, Dave  Frank.

I've followed both your suggestions.  The very first
lines in the servlet print out the various parameter, attributes, 
cookies.
Here's what I get:
 

Have you used a standard JS framework of some sort, or is it in-house 
code?  Testing with Firebug is, as has been stated, the way 
to find out 
what's being sent by your browser  therefore what the JS code you're 
using is actually doing.


I concur with the chaps who've already posted - in that your AJAX is 
probably not sending the cookie data.



You could manually attach the session id in your JS. We use the 
following snippet to provide access to that data in JS, for 
some parts 
of one of our apps.


script type=text/javascript
var Session = {
  id : '${pageContext.session.id}',
  user : '${pageContext.request.remoteUser}'
}
/script

var url = path + ;jsessionid= + Session.id + ? + queryParams;


p




   


-- QUOTE --
**
doPost entering
May 21 16:16:23: Session Attributes

Session Attributes
May 21 16:16:23: Session isNew()= true
May 21 16:16:23: No attributes in this scope

May 21 16:16:23: Request Attributes

Request Attributes
May 21 16:16:23: No attributes in this scope

May 21 16:16:23: Parameters

Request Parameters
owner = 6
ajaxreq = getfora
type = 0


May 21 16:16:23: Cookies
May 21 16:16:23: 'JSESSIONID'='97E2CA20966390CCBC851738E71F3053'
May 21 16:16:23: Found 1 cookies
-- END QUOTE --

As I said in my earlier post, the session being returned by 
 


getSession()
   


is a new one;
when I call it like getSession(false) it return a null session.
Therefore, it contains
no attributes.  The parameters are, of course, exactly what 
 


I expected.
   


As you can see,
there is the JSESSIONID cookie, but, for some reason, the 
 


servlet isn't
   


using it, or it
is not valid.

Again, according to Sun, everyone one of the API functions 
 


to manipulate
   


session IDs are
deprecated, so I can't even kludge it up.  I have no idea 
 


if that is a
   


valid session ID or
not.

Also, I used Firebug to examine the XMLHttpRequest.  I'm 
 


not too sure
   


what I'm looking for.
There was no reference to cookies, and all the stuff that I 
 


set was OK.
   


Anyway, it seems to
be getting the cookie.

Any ideas as to why the session wouldn't use this cookie, 
 


or why this
   


cookie might be invalid?
In the process of this debugging, I have seen two 
 


JSESSIONIDs come over,
   


one valid, one not.

Thanks again for the help.


 


-Original Message-
From: Frank W. Zammetti [mailto:[EMAIL PROTECTED] 
Sent: Monday, May 21, 2007 3:29 PM

To: Tomcat Users List
Cc: users@tomcat.apache.org; [EMAIL PROTECTED]
Subject: Re: Session IDs  XMLHttpRequests

I can say with 100% certainty that a servlet invoked with 
XMLHttpRequest

**DOES** have the same access to server-side objects as a non-AJAX
request.  I say this based on two applications in production 
that do this
all day long, one Struts-based, one not.  I also say it based 
on a number
of other applications, some using other frameworks, some 
   


using plain
   


servlets, all that do this as well, with no problems.

Now, the two production apps, which are very much 
   


AJAX-based, not just
   

using it here and there, are running on Websphere, so that 
   


leaves the
   

possibility that there's something going on with Tomcat.  
   


However, I
   

generally develop under Tomcat, including most of those 
   


other apps I
   


mentioned, and never observed this problem.

This isn't to say what your seeing isn't truly an issue, I 
have no doubt
it is... but, the only difference I can conceive of, based 
   


on all this
   

experience, between an AJAX request and a normal POST/GET, is 
the session
cookie not being passed in with the AJAX request.  I could 
believe that
might happen, and I could also believe it may be different 
from browser to
browser (don't misunderstand, I have no knowledge of this 
being the case,

but it wouldn't shock me).

As another poster suggested, I would begin by monitoring 
   


the requests
   

going across in Firefox with Firebug, and perhaps 
TamperData... you should
be able to see every detail of the request and response 
   


with those...
   


ant deployment

2007-05-22 Thread Zdeněk Vráblík

Hi all,

I need keep directory structure and deploy application into Tomcat
5.5.23 into subdirectory.

Is it possible with tomcat ant deployment?

This failed:

target name=deploy2 description=Deploy web application from
existing war file
 deploy url=http://localhost:8080/manager; username=tomcat
password=tomcat
 path=/main/other-place war=./myApp.war update=true /
/target

I get error during deployment:

[deploy] FAIL - Encountered exception java.io.FileNotFoundException:
C:\app\T55\webapps\main\other-place\main.war (The system cannot find
the path specified)


When I created directories main/other-place I got this error:

FAIL - Failed to deploy application at context path /main/other-place/main

Do I have any possibility except unpack and copy war file into right directory?

Thanks.

Regards,
Zdenek Vrablik

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Session IDs XMLHttpRequests

2007-05-22 Thread Williams, Allen
Excellent!  Thanks.  I'm temporarily sidetracked for a couple of hours,
but then will go back to work on this.

Thanks, and Regards,

Allen Williams
[EMAIL PROTECTED]
Office: (321)309-7931
Mobile: (321)258-1272
FAX: (321)727-9607
 

 -Original Message-
 From: Frank W. Zammetti [mailto:[EMAIL PROTECTED] 
 Sent: Monday, May 21, 2007 11:29 PM
 To: Tomcat Users List
 Subject: Re: Session IDs  XMLHttpRequests
 
 Let's start with this:
 
 http://www.omnytex.com/test.zip
 
 Just unzip into ${Tomcat}/webapps and try it... the first 
 time you click 
 the button you should see an alert saying testAttribute is null, the 
 second time it should say Test attribute has been set.  
 Now, do this 
 in Firefox and check each request that results from clicking 
 the button 
 with Firebug... specifically, expand the requests in the 
 Console view, 
 click the Headers tab, and look for JSESSIONID in the request headers 
 (that's how cookies are sent)... you should always see the 
 same value, 
 if you don't then something funky is going on.  FYI, if you don't see 
 the requests, make sure you check the option in Firebug to record 
 XMLHttpRequest traffic (it may be off by default).
 
 If you take this app and it works, modify it to the point where it 
 doesn't work and post it for us and we'll see if (a) we get the same 
 results, and (b) try to figure out why... if it doesn't work 
 as-is, then 
 there's definitely something wrong in your environment.
 
 Frank
 
 --
 Frank W. Zammetti
 Founder and Chief Software Architect
 Omnytex Technologies
 http://www.omnytex.com
 AIM/Yahoo: fzammetti
 MSN: [EMAIL PROTECTED]
 Author of Practical Ajax Projects With Java Technology
   (2006, Apress, ISBN 1-59059-695-1)
 and JavaScript, DOM Scripting and Ajax Projects
   (2007, Apress, ISBN 1-59059-816-4)
 Java Web Parts - http://javawebparts.sourceforge.net
   Supplying the wheel, so you don't have to reinvent it!
 
 Hassan Schroeder wrote:
  On 5/21/07, Williams, Allen [EMAIL PROTECTED] wrote:
  
  As I said in my earlier post, the session being returned 
 by getSession()
  is a new one;
  
  Can you create a simple test case WAR to demonstrate the failure?
  I have seen no such problems using Prototype, YUI, or DWR, which
  I'm currently incorporating into an app.
  
  To test your contention, I've printed the sessionId in a 
 JSP page and
  made an XHR request via DWR to another simple JSP which logs the
  sessionId; it's the same, and that second controller page can access
  the same session attributes as the original page.
  
  So I have to suspect there's something odd about your setup -- the
  test case would be useful...
  
  FWIW,
 
 
 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Joakim T Monstad is out of the office.

2007-05-22 Thread JMonstad
I will be out of the office starting  05/22/2007 and will not return until
05/23/2007.

I will respond to your message when I return, but can be reached at 952 836
4385 (send a txt if possible, since I won't be able to answer many calls)

how to deploy cgi files on tomcat

2007-05-22 Thread deepakthinks

i want to know how to execute cgi files on tomcat
-- 
View this message in context: 
http://www.nabble.com/how-to-deploy-cgi-files-on-tomcat-tf3796433.html#a10738182
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: ant deployment

2007-05-22 Thread Jiang, Jane (NIH/NCI) [C]
I found that path to the war file can only be absolute path. 

-Original Message-
From: Zdeněk Vráblík [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, May 22, 2007 9:22 AM
To: Tomcat Users List
Subject: ant deployment

Hi all,

I need keep directory structure and deploy application into Tomcat
5.5.23 into subdirectory.

Is it possible with tomcat ant deployment?

This failed:

target name=deploy2 description=Deploy web application from
existing war file
  deploy url=http://localhost:8080/manager; username=tomcat
password=tomcat
  path=/main/other-place war=./myApp.war update=true /
/target

I get error during deployment:

[deploy] FAIL - Encountered exception java.io.FileNotFoundException:
C:\app\T55\webapps\main\other-place\main.war (The system cannot find
the path specified)


When I created directories main/other-place I got this error:

FAIL - Failed to deploy application at context path /main/other-place/main

Do I have any possibility except unpack and copy war file into right directory?

Thanks.

Regards,
Zdenek Vrablik

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Session IDs XMLHttpRequests

2007-05-22 Thread Williams, Allen
Will it work with POST as well as GET?  Although I guess I'll soon find
out;-)

Thanks, and Regards,

Allen Williams
[EMAIL PROTECTED]
Office: (321)309-7931
Mobile: (321)258-1272
FAX: (321)727-9607
 

 -Original Message-
 From: David Smith [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, May 22, 2007 9:17 AM
 To: Tomcat Users List
 Subject: Re: Session IDs  XMLHttpRequests
 
 As long as it's encoded on the url as shown in the example below (and 
 defined in the servlet spec), tomcat will just pick it  up 
 and use it.  
 No additional APIs required.
 
 --David
 
 Williams, Allen wrote:
 
 Thanks for the hint.  I had come to the conclusion I was 
 going to have
 to do something like that.  It is not a JS framework- it's 
 Javascript 
 Java in a Tomcat container, all built in-house.
 
 Again, I looked at the XMLHttpRequest with Firebug, but saw 
 no reference
 to the cookies.
 
 Once you get the session ID (using your method below) into 
 your servlet,
 how do you tell the servlet to use it?  The only API I found 
 for that is
 deprecated with no replacement.
 
 
   
 
 Thanks, Dave  Frank.
 
 I've followed both your suggestions.  The very first
 lines in the servlet print out the various parameter, attributes, 
 cookies.
 Here's what I get:
   
 
 Have you used a standard JS framework of some sort, or is 
 it in-house 
 code?  Testing with Firebug is, as has been stated, the way 
 to find out 
 what's being sent by your browser  therefore what the JS 
 code you're 
 using is actually doing.
 
 I concur with the chaps who've already posted - in that 
 your AJAX is 
 probably not sending the cookie data.
 
 
 You could manually attach the session id in your JS. We use the 
 following snippet to provide access to that data in JS, for 
 some parts 
 of one of our apps.
 
 script type=text/javascript
 var Session = {
id : '${pageContext.session.id}',
user : '${pageContext.request.remoteUser}'
 }
 /script
 
 var url = path + ;jsessionid= + Session.id + ? + queryParams;
 
 
 p
 
 
 
 
 
 
 -- QUOTE --
 **
 doPost entering
 May 21 16:16:23: Session Attributes
 
 Session Attributes
 May 21 16:16:23: Session isNew()= true
 May 21 16:16:23: No attributes in this scope
 
 May 21 16:16:23: Request Attributes
 
 Request Attributes
 May 21 16:16:23: No attributes in this scope
 
 May 21 16:16:23: Parameters
 
 Request Parameters
 owner = 6
 ajaxreq = getfora
 type = 0
 
 
 May 21 16:16:23: Cookies
 May 21 16:16:23: 'JSESSIONID'='97E2CA20966390CCBC851738E71F3053'
 May 21 16:16:23: Found 1 cookies
 -- END QUOTE --
 
 As I said in my earlier post, the session being returned by 
   
 
 getSession()
 
 
 is a new one;
 when I call it like getSession(false) it return a null session.
 Therefore, it contains
 no attributes.  The parameters are, of course, exactly what 
   
 
 I expected.
 
 
 As you can see,
 there is the JSESSIONID cookie, but, for some reason, the 
   
 
 servlet isn't
 
 
 using it, or it
 is not valid.
 
 Again, according to Sun, everyone one of the API functions 
   
 
 to manipulate
 
 
 session IDs are
 deprecated, so I can't even kludge it up.  I have no idea 
   
 
 if that is a
 
 
 valid session ID or
 not.
 
 Also, I used Firebug to examine the XMLHttpRequest.  I'm 
   
 
 not too sure
 
 
 what I'm looking for.
 There was no reference to cookies, and all the stuff that I 
   
 
 set was OK.
 
 
 Anyway, it seems to
 be getting the cookie.
 
 Any ideas as to why the session wouldn't use this cookie, 
   
 
 or why this
 
 
 cookie might be invalid?
 In the process of this debugging, I have seen two 
   
 
 JSESSIONIDs come over,
 
 
 one valid, one not.
 
 Thanks again for the help.
 
 
   
 
 -Original Message-
 From: Frank W. Zammetti [mailto:[EMAIL PROTECTED] 
 Sent: Monday, May 21, 2007 3:29 PM
 To: Tomcat Users List
 Cc: users@tomcat.apache.org; [EMAIL PROTECTED]
 Subject: Re: Session IDs  XMLHttpRequests
 
 I can say with 100% certainty that a servlet invoked with 
 XMLHttpRequest
 **DOES** have the same access to server-side objects as a non-AJAX
 request.  I say this based on two applications in production 
 that do this
 all day long, one Struts-based, one not.  I also say it based 
 on a number
 of other applications, some using other frameworks, some 
 
 
 using plain
 
 
 servlets, all that do this as well, with no problems.
 
 Now, the two production apps, which are very much 
 
 
 AJAX-based, not just
 
 
 using it here and there, are running on Websphere, so that 
 
 
 leaves the
 
 
 possibility that there's something going on with Tomcat.  
 
 
 However, I
 
 
 generally develop under Tomcat, including most of those 
 
 
 other apps I
 
 
 mentioned, and never observed this problem.
 
 This isn't to say what your seeing isn't truly an issue, I 
 have no doubt
 it is... but, the only 

Re: Tomcat and Static file Caching ( 304 headers )

2007-05-22 Thread Johnny Kewl
Hi... I dont know much about this, never had a chance to play with it... 
dont even
know how much Tomcat does for you and how much is manual header 
manipulation.
But just from below... there seems to be nothing in the browser response 
telling the server

that it understands feed caching... ie one would expect to see
Last-Modified:  or Etag... so just guessing but I dont think the browser 
understands it..

maybe you should try Last-Modified

I found a fairly decent article maybe will help... 
http://rakaz.nl/item/reducing_the_bandwidth_used_by_feeds


- Original Message - 
From: [EMAIL PROTECTED] [EMAIL PROTECTED]

To: users@tomcat.apache.org
Sent: Tuesday, May 22, 2007 2:17 PM
Subject: Tomcat and Static file Caching ( 304 headers )



I am using Tomcat 5.5 together with Eclipse 3.2.2 for development
of a web application.

But when i use FireBug in Firefox to track network traffic is
see that tomcat never returns a 304 NOT MODIFIED header
if a file is requested twice.

For example when requesting a JavaScript file:
http://localhost:8080/XDataSystem/standard/js/standard.js
you see the following headers:

*Response Headers*
Server Apache-Coyote/1.1
Etag W/10823-1179768573406
Last-Modified Mon, 21 May 2007 17:29:33 GMT
Content-Type text/javascript
Content-Encoding gzip
Vary Accept-Encoding
Date Tue, 22 May 2007 11:52:27 GMT



*Request Headers*
Host localhost:8080
User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.3)
Gecko/20070309 Firefox/2.0.0.3
Accept */*
Accept-Language nl,en-us;q=0.7,en;q=0.3
Accept-Encoding gzip,deflate
Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive 300
Connection keep-alive
Referer http://localhost:8080/XDataSystem/rainbow/home.page



As you can see in the response filter i have turned GZIP compressoin on.

But when i request the page again ( by typing the url in the url-bar,
NOT using F5 )
I get the exact same response back.. But i expect a 304 response.

I think it has something to do with the Vary response field.
I have read this:
http://localhost:8080/XDataSystem/standard/js/standard.js

But i do not understand it fully.

can anybody help me??
This really makes my application ( using dojo ) slow.

Thanks in advance.

Tjerk Wolterink





-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: ant deployment

2007-05-22 Thread Zdeněk Vráblík

Hi,
thanks for reply.

It didn't help.

I have Windows XP and ANT 1.6.5.
I have changed directory separators from \ to /, but the error is same.

Do I have to setup anything in Tomcat configuration to be able to
deploy into subdirectory in webapps directory?

This works fine:

target name=deploy2 description=Deploy web application from
existing war file
  deploy url=http://localhost:8080/manager; username=tomcat
password=tomcat
  path=/main war=./myApp.war update=true /
/target


Regards,
Zdenek

On 5/22/07, Jiang, Jane (NIH/NCI) [C] [EMAIL PROTECTED] wrote:

I found that path to the war file can only be absolute path.

-Original Message-
From: Zdeněk Vráblík [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 22, 2007 9:22 AM
To: Tomcat Users List
Subject: ant deployment

Hi all,

I need keep directory structure and deploy application into Tomcat
5.5.23 into subdirectory.

Is it possible with tomcat ant deployment?

This failed:

target name=deploy2 description=Deploy web application from
existing war file
  deploy url=http://localhost:8080/manager; username=tomcat
password=tomcat
  path=/main/other-place war=./myApp.war update=true /
/target

I get error during deployment:

[deploy] FAIL - Encountered exception java.io.FileNotFoundException:
C:\app\T55\webapps\main\other-place\main.war (The system cannot find
the path specified)


When I created directories main/other-place I got this error:

FAIL - Failed to deploy application at context path /main/other-place/main

Do I have any possibility except unpack and copy war file into right directory?

Thanks.

Regards,
Zdenek Vrablik

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: how to deploy cgi files on tomcat

2007-05-22 Thread Caldarale, Charles R
 From: deepakthinks [mailto:[EMAIL PROTECTED] 
 Subject: how to deploy cgi files on tomcat
 
 i want to know how to execute cgi files on tomcat

Is it too hard to read the doc?
http://tomcat.apache.org/tomcat-5.5-doc/cgi-howto.html
http://tomcat.apache.org/tomcat-6.0-doc/cgi-howto.html

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Configure Tomcat 6 for php 5.2.2

2007-05-22 Thread Oliver Block
Hi,

please refer to the documentation:

http://tomcat.apache.org/tomcat-6.0-doc/cgi-howto.html

Don't forget to compile php as cgi.

Regards,

Oliver


Am Montag, 21. Mai 2007 19:56 schrieb Pierluigi Fabbris:
  Hi,
 I've problem to configuring Tomcat 6. The problem is:
 I use saxon b, java and php how can I configure the last one? In Tomcat 5
 and php 5.0 is possible. Is possible in Tomcat 6 and php 5.2.2, too?
 Hoping in a reply.
 Sincerally yours,
 Fabbris Pierluigi

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Session IDs XMLHttpRequests

2007-05-22 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Allen,

Williams, Allen wrote:
 Will it work with POST as well as GET?  Although I guess I'll soon find
 out;-)

It should work equally well with GET and POST. The browser should send
cookies with every type of request (not just GET and POST).

I strongly encourage you to make arrangements for non-cookie-using
people. When you emit the HTML (and javascript) to make your
XMLHttpRequest, try making the URL dynamic and running it through
HttpServletResponse.encodeURL to add the jsessionid to the URL if necessary.

This will make your application a little more friendly to those who
either don't have cookies available (usually an IT policy in an office
or something) or who choose to turn them off. I find this to be
courteous to your users.

Just my .02.

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGUvhK9CaO5/Lv0PARAtq0AKCfANKRxmb3ljBRiDLsb6gghTZHBgCcCdxW
tUbl8cpKi44F53BrbHBmRjA=
=zz//
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



if don't work?!?!?

2007-05-22 Thread Massimiliano PASQUALONI
Hi guy!
 
Wat's happen??
 
If i read an checkrequest post

String Pippo = request.getParameter(abilitato);

out.print(Pippo);

return me= on

If I try to make a condition whit if:

 

   if (Pippo == on) {



}

these don't work
 
And is'nt the first time, 
 
if I try
 
Pippo =  request.getParameter(abilitato);
Pluto =  request.getParameter(abilitato);
 
the if (Pippo == Pluto )  don't work!
 
 
 
:-(
 
please, help me!

Massimiliano PASQUALONI

Data Processing S.r.l.
Reparto EDP
S.S. 100 BA-TA Km 18
c/o IL BARICENTRO 
torre D
70010 CASAMASSIMA (BA)


Re: if don't work?!?!?

2007-05-22 Thread Edoardo Panfili

Massimiliano PASQUALONI ha scritto:

Hi guy!
 
Wat's happen??
 
If i read an checkrequest post


String Pippo = request.getParameter(abilitato);

out.print(Pippo);

return me= on

If I try to make a condition whit if:

 


   if (Pippo == on) {




}


Maybe possible that I don't understand...

String pippo = request.getParameter(abilitato);
if (pippo.equals(on)) {
// ...
}


Edoardo

--
[EMAIL PROTECTED]
AIM: edoardopn
Jabber: [EMAIL PROTECTED]
tel:075 9142766

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: [OT] if don't work?!?!?

2007-05-22 Thread Caldarale, Charles R
 From: Massimiliano PASQUALONI 
 [mailto:[EMAIL PROTECTED] 
 Subject: if don't work?!?!?
 
if (Pippo == on) {

Guaranteed to be false.

 Pippo =  request.getParameter(abilitato);
 Pluto =  request.getParameter(abilitato);
  
 the if (Pippo == Pluto )  don't work!

Also guaranteed to be false.

You need to learn Java before embarking on writing webapps for any
container.  The test you're making is one for object equality, not
content equality.  Your expression should be something like:

if (Pippo.equals(on))

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat and Static file Caching ( 304 headers )

2007-05-22 Thread Johnny Kewl

I just had an after thought... happens often ; )
I think because you using feed type technology the assumption is that is wot 
you really want,
but if this js file never changes... then wot about trying normal caching 
constructs like


please check the actual format...
Cache-control: public, max-age=3600
I think that will cache the js page for one hour alot easier than 
hashing pages and all the other fancy stuff in feeds maybe.


- Original Message - 
From: Johnny Kewl [EMAIL PROTECTED]

To: Tomcat Users List users@tomcat.apache.org
Sent: Tuesday, May 22, 2007 3:55 PM
Subject: Re: Tomcat and Static file Caching ( 304 headers )


Hi... I dont know much about this, never had a chance to play with it... 
dont even
know how much Tomcat does for you and how much is manual header 
manipulation.
But just from below... there seems to be nothing in the browser response 
telling the server

that it understands feed caching... ie one would expect to see
Last-Modified:  or Etag... so just guessing but I dont think the browser 
understands it..

maybe you should try Last-Modified

I found a fairly decent article maybe will help... 
http://rakaz.nl/item/reducing_the_bandwidth_used_by_feeds


- Original Message - 
From: [EMAIL PROTECTED] [EMAIL PROTECTED]

To: users@tomcat.apache.org
Sent: Tuesday, May 22, 2007 2:17 PM
Subject: Tomcat and Static file Caching ( 304 headers )



I am using Tomcat 5.5 together with Eclipse 3.2.2 for development
of a web application.

But when i use FireBug in Firefox to track network traffic is
see that tomcat never returns a 304 NOT MODIFIED header
if a file is requested twice.

For example when requesting a JavaScript file:
http://localhost:8080/XDataSystem/standard/js/standard.js
you see the following headers:

*Response Headers*
Server Apache-Coyote/1.1
Etag W/10823-1179768573406
Last-Modified Mon, 21 May 2007 17:29:33 GMT
Content-Type text/javascript
Content-Encoding gzip
Vary Accept-Encoding
Date Tue, 22 May 2007 11:52:27 GMT



*Request Headers*
Host localhost:8080
User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.3)
Gecko/20070309 Firefox/2.0.0.3
Accept */*
Accept-Language nl,en-us;q=0.7,en;q=0.3
Accept-Encoding gzip,deflate
Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive 300
Connection keep-alive
Referer http://localhost:8080/XDataSystem/rainbow/home.page



As you can see in the response filter i have turned GZIP compressoin on.

But when i request the page again ( by typing the url in the url-bar,
NOT using F5 )
I get the exact same response back.. But i expect a 304 response.

I think it has something to do with the Vary response field.
I have read this:
http://localhost:8080/XDataSystem/standard/js/standard.js

But i do not understand it fully.

can anybody help me??
This really makes my application ( using dojo ) slow.

Thanks in advance.

Tjerk Wolterink





-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: if don't work?!?!?

2007-05-22 Thread David Delbecq
Basics of java programming: == operator compare objet instances, not
their content.
To check if 2 differences instance are the same, use the equals() method.
Eg:

if (Pippo.equals(on)) {
...
}

You should probably start by learning java language (J2SE) before you
start learning java enterprise (J2EE).

En l'instant précis du 22/05/07 16:39, Massimiliano PASQUALONI
s'exprimait en ces termes:
 Hi guy!
  
 Wat's happen??
  
 If i read an checkrequest post

 String Pippo = request.getParameter(abilitato);

 out.print(Pippo);

 return me= on

 If I try to make a condition whit if:

  

if (Pippo == on) {

 

 }

 these don't work
  
 And is'nt the first time, 
  
 if I try
  
 Pippo =  request.getParameter(abilitato);
 Pluto =  request.getParameter(abilitato);
  
 the if (Pippo == Pluto )  don't work!
  
  
  
 :-(
  
 please, help me!

 Massimiliano PASQUALONI

 Data Processing S.r.l.
 Reparto EDP
 S.S. 100 BA-TA Km 18
 c/o IL BARICENTRO 
 torre D
 70010 CASAMASSIMA (BA)

   


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [OT] if don't work?!?!?

2007-05-22 Thread Jost Richstein

No, that is not guaranteed to be false.
For example

  Pippo.intern() == Pluto.intern()

should be true.

Caldarale, Charles R schrieb:
From: Massimiliano PASQUALONI 
[mailto:[EMAIL PROTECTED] 
Subject: if don't work?!?!?


   if (Pippo == on) {



Guaranteed to be false.

  

Pippo =  request.getParameter(abilitato);
Pluto =  request.getParameter(abilitato);
 
the if (Pippo == Pluto )  don't work!



Also guaranteed to be false.

You need to learn Java before embarking on writing webapps for any
container.  The test you're making is one for object equality, not
content equality.  Your expression should be something like:

if (Pippo.equals(on))

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




  


--
Jost Richstein
SoftDeCC Software GmbH
Email: [EMAIL PROTECTED]
Tel.: +49 89 89 06 78 47
Fax.: +49 89 89 06 78 33

SoftDeCC Software GmbH; Gesellschaft mit beschränkter Haftung; Sitz der 
Gesellschaft: München; Registergericht: München, HRB 123667; Geschäftsführer: 
Ralf Malis, Georg Nüssel, Jost Richstein, Gerd Wilts



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat and Static file Caching ( 304 headers )

2007-05-22 Thread [EMAIL PROTECTED]

Well we are talking about static js files that do not change often.
If was thinking about writing my own filter that created the
correect header fields... But i think it is really a responsibility of the
application server to support client caching for static files..

It looks like tomcat does not do that.. at least not for javasdcript files..
Or the firebug firefox util is f*cked up...
I will investigate this case.. because i think Tomcat DOES support
cahcing ( at least if i look at the code of DefaultServlet that handles
the static files in tomcat )..
But strangely enough it does not work for me..


Johnny Kewl schreef:

I just had an after thought... happens often ; )
I think because you using feed type technology the assumption is that 
is wot you really want,
but if this js file never changes... then wot about trying normal 
caching constructs like


please check the actual format...
Cache-control: public, max-age=3600
I think that will cache the js page for one hour alot easier than 
hashing pages and all the other fancy stuff in feeds maybe.


- Original Message - From: Johnny Kewl [EMAIL PROTECTED]
To: Tomcat Users List users@tomcat.apache.org
Sent: Tuesday, May 22, 2007 3:55 PM
Subject: Re: Tomcat and Static file Caching ( 304 headers )


Hi... I dont know much about this, never had a chance to play with 
it... dont even
know how much Tomcat does for you and how much is manual header 
manipulation.
But just from below... there seems to be nothing in the browser 
response telling the server

that it understands feed caching... ie one would expect to see
Last-Modified:  or Etag... so just guessing but I dont think the 
browser understands it..

maybe you should try Last-Modified

I found a fairly decent article maybe will help... 
http://rakaz.nl/item/reducing_the_bandwidth_used_by_feeds


- Original Message - From: [EMAIL PROTECTED] 
[EMAIL PROTECTED]

To: users@tomcat.apache.org
Sent: Tuesday, May 22, 2007 2:17 PM
Subject: Tomcat and Static file Caching ( 304 headers )



I am using Tomcat 5.5 together with Eclipse 3.2.2 for development
of a web application.

But when i use FireBug in Firefox to track network traffic is
see that tomcat never returns a 304 NOT MODIFIED header
if a file is requested twice.

For example when requesting a JavaScript file:
http://localhost:8080/XDataSystem/standard/js/standard.js
you see the following headers:

*Response Headers*
Server Apache-Coyote/1.1
Etag W/10823-1179768573406
Last-Modified Mon, 21 May 2007 17:29:33 GMT
Content-Type text/javascript
Content-Encoding gzip
Vary Accept-Encoding
Date Tue, 22 May 2007 11:52:27 GMT



*Request Headers*
Host localhost:8080
User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.3)
Gecko/20070309 Firefox/2.0.0.3
Accept */*
Accept-Language nl,en-us;q=0.7,en;q=0.3
Accept-Encoding gzip,deflate
Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive 300
Connection keep-alive
Referer http://localhost:8080/XDataSystem/rainbow/home.page



As you can see in the response filter i have turned GZIP compressoin 
on.


But when i request the page again ( by typing the url in the url-bar,
NOT using F5 )
I get the exact same response back.. But i expect a 304 response.

I think it has something to do with the Vary response field.
I have read this:
http://localhost:8080/XDataSystem/standard/js/standard.js

But i do not understand it fully.

can anybody help me??
This really makes my application ( using dojo ) slow.

Thanks in advance.

Tjerk Wolterink





-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: OT: if don't work?!?!?

2007-05-22 Thread DJohnson
This is not really a Tomcat question, but a matter of Java language 
understanding.
Comparators like ==, , =, etc. should only be used with java language 
primitive types, such as int, byte, boolean, and NOT with Objects, like 
String, as you are, UNLESS you actually wish to test whether the two 
things you are comparing are the same object instance.  To test whether 
two distinct objects represent the same value or entity, use the equals 
method.  So in your case, you should use:

if (Pippo.equals(on)) { ... }

or 

if (Pippo.equals(Pluto)) { ... }



Please respond to Tomcat Users List users@tomcat.apache.org

To: 'Tomcat Users List' users@tomcat.apache.org
cc:  
Subject:if don't work?!?!?


Hi guy!

Wat's happen??

If i read an checkrequest post

String Pippo = request.getParameter(abilitato);

out.print(Pippo);

return me= on

If I try to make a condition whit if:



if (Pippo == on) {



}

these don't work

And is'nt the first time,

if I try

Pippo =  request.getParameter(abilitato);
Pluto =  request.getParameter(abilitato);

the if (Pippo == Pluto )  don't work!



:-(

please, help me!

Massimiliano PASQUALONI

Data Processing S.r.l.
Reparto EDP
S.S. 100 BA-TA Km 18
c/o IL BARICENTRO
torre D
70010 CASAMASSIMA (BA)




Re: if don't work?!?!?

2007-05-22 Thread Jost Richstein

Have you tried

  if(on.equals(Pippo)) {
  
  }

Massimiliano PASQUALONI schrieb:

Hi guy!
 
Wat's happen??
 
If i read an checkrequest post


String Pippo = request.getParameter(abilitato);

out.print(Pippo);

return me= on

If I try to make a condition whit if:

 


   if (Pippo == on) {




}

these don't work
 
And is'nt the first time, 
 
if I try
 
Pippo =  request.getParameter(abilitato);

Pluto =  request.getParameter(abilitato);
 
the if (Pippo == Pluto )  don't work!
 
 
 
:-(
 
please, help me!


Massimiliano PASQUALONI

Data Processing S.r.l.
Reparto EDP
S.S. 100 BA-TA Km 18
c/o IL BARICENTRO 
torre D

70010 CASAMASSIMA (BA)

  


--
Jost Richstein
SoftDeCC Software GmbH
Email: [EMAIL PROTECTED]
Tel.: +49 89 89 06 78 47
Fax.: +49 89 89 06 78 33

SoftDeCC Software GmbH; Gesellschaft mit beschränkter Haftung; Sitz der 
Gesellschaft: München; Registergericht: München, HRB 123667; Geschäftsführer: 
Ralf Malis, Georg Nüssel, Jost Richstein, Gerd Wilts



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: [OT] if don't work?!?!?

2007-05-22 Thread Caldarale, Charles R
 From: Jost Richstein [mailto:[EMAIL PROTECTED] 
 Subject: Re: [OT] if don't work?!?!?
 
 No, that is not guaranteed to be false.
 For example
Pippo.intern() == Pluto.intern()
 should be true.

The above certainly is correct, but is not what the OP coded.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



R: if don't work?!?!?

2007-05-22 Thread Massimiliano PASQUALONI
No, don't work!

Im try a simple function in my javabean that convert from string to
boolean:

JSP:
String Prova = request.getParameter(abilitato);
 // where abilitato is a checkbox in a form





Javabean:

public boolean StringToBoolean(String StrBool)
 {
boolean convertito=false;

if ((StrBool == 1) || (StrBool == On) || (StrBool ==
on) || (StrBool == Yes) || (StrBool == yes) || (StrBool == Si) ||
(StrBool == si) || (StrBool == True) || (StrBool == true))
{
convertito = true;
}

if ((StrBool == 0) || (StrBool == Off) || (StrBool ==
off) || (StrBool ==   No) || (StrBool == no) || (StrBool == False)
|| (StrBool == false))
{
convertito = false;
}

return convertito;
 }
 







If I try 

if (on.equals(request.getParameter(abilitato))){
Abilitato = true;
}



Or 

 if (request.getParameter(abilitato).equals(on)){
Abilitato = true;
}

Or

if (request.getParameter(abilitato) == on){
Abilitato = true;
}

Or 
Boolean Abilitato = bean.StringToBoolean(Prova);


I have the same result: don't work..


Yesterday I've try also

Referer = request.getHeader(Referer) 
AltroReferer = request.getHeader(Referer) 

if (Referer == AltroReferer ){...}

And don't work.


:-O




-Messaggio originale-
Da: Edoardo Panfili [mailto:[EMAIL PROTECTED] 
Inviato: martedì 22 maggio 2007 16.44
A: Tomcat Users List
Oggetto: Re: if don't work?!?!?

Massimiliano PASQUALONI ha scritto:
 Hi guy!
  
 Wat's happen??
  
 If i read an checkrequest post
 
 String Pippo = request.getParameter(abilitato);
 
 out.print(Pippo);
 
 return me= on
 
 If I try to make a condition whit if:
 
  
 
if (Pippo == on) {
 
 
 
 }

Maybe possible that I don't understand...

String pippo = request.getParameter(abilitato);
if (pippo.equals(on)) {
// ...
}


Edoardo

--
[EMAIL PROTECTED]
AIM: edoardopn
Jabber: [EMAIL PROTECTED]
tel:075 9142766

-
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Scanned with Copfilter Version 0.83beta3a (ProxSMTP 1.4)
AntiVirus: ClamAV 0.88.4/3281 - Tue May 22 10:50:43 2007
by Markus Madlener @ http://www.copfilter.org

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: if don't work?!?!?

2007-05-22 Thread Propes, Barry L
 if (Pippo.equals(Pluto)) maybe?

-Original Message-
From: Massimiliano PASQUALONI
[mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 22, 2007 9:40 AM
To: 'Tomcat Users List'
Subject: if don't work?!?!?


Hi guy!
 
Wat's happen??
 
If i read an checkrequest post

String Pippo = request.getParameter(abilitato);

out.print(Pippo);

return me= on

If I try to make a condition whit if:

 

   if (Pippo == on) {



}

these don't work
 
And is'nt the first time, 
 
if I try
 
Pippo =  request.getParameter(abilitato);
Pluto =  request.getParameter(abilitato);
 
the if (Pippo == Pluto )  don't work!
 
 
 
:-(
 
please, help me!

Massimiliano PASQUALONI

Data Processing S.r.l.
Reparto EDP
S.S. 100 BA-TA Km 18
c/o IL BARICENTRO 
torre D
70010 CASAMASSIMA (BA)

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: R: if don't work?!?!?

2007-05-22 Thread Edoardo Panfili

Massimiliano PASQUALONI ha scritto:

No, don't work!

Im try a simple function in my javabean that convert from string to
boolean:

JSP:
String Prova = request.getParameter(abilitato);
 // where abilitato is a checkbox in a form

can you post the HTML fragment of the form?
Do you have somethinkg like
input name=abilitato value=si type=checkbox
?
check the value of value attribute of input element

Edoardo







Javabean:

public boolean StringToBoolean(String StrBool)
 {
boolean convertito=false;

if ((StrBool == 1) || (StrBool == On) || (StrBool ==
on) || (StrBool == Yes) || (StrBool == yes) || (StrBool == Si) ||
(StrBool == si) || (StrBool == True) || (StrBool == true))
{
convertito = true;
}

if ((StrBool == 0) || (StrBool == Off) || (StrBool ==
off) || (StrBool == No) || (StrBool == no) || (StrBool == False)
|| (StrBool == false))
{
convertito = false;
}

return convertito;
 }
 








If I try 


if (on.equals(request.getParameter(abilitato))){
Abilitato = true;
}



Or 


 if (request.getParameter(abilitato).equals(on)){
Abilitato = true;
}

Or

if (request.getParameter(abilitato) == on){
Abilitato = true;
}

Or 
	Boolean Abilitato = bean.StringToBoolean(Prova);



I have the same result: don't work..


Yesterday I've try also

	Referer = request.getHeader(Referer) 
	AltroReferer = request.getHeader(Referer) 


if (Referer == AltroReferer ){...}

And don't work.


:-O




-Messaggio originale-
Da: Edoardo Panfili [mailto:[EMAIL PROTECTED] 
Inviato: martedì 22 maggio 2007 16.44

A: Tomcat Users List
Oggetto: Re: if don't work?!?!?

Massimiliano PASQUALONI ha scritto:

Hi guy!
 
Wat's happen??
 
If i read an checkrequest post


String Pippo = request.getParameter(abilitato);

out.print(Pippo);

return me= on

If I try to make a condition whit if:

 


   if (Pippo == on) {




}


Maybe possible that I don't understand...

String pippo = request.getParameter(abilitato);
if (pippo.equals(on)) {
// ...
}


Edoardo




--
[EMAIL PROTECTED]
AIM: edoardopn
Jabber: [EMAIL PROTECTED]
tel:075 9142766

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



R: if don't work?!?!?

2007-05-22 Thread Massimiliano PASQUALONI
counter-order!!!


The equals method don't work if I put the request in his parameter, but if a
read the request and I set a String, if i put this string in the parameters,
it work!



 

-Messaggio originale-
Da: Propes, Barry L [mailto:[EMAIL PROTECTED] 
Inviato: martedì 22 maggio 2007 17.04
A: Tomcat Users List
Oggetto: RE: if don't work?!?!?

 if (Pippo.equals(Pluto)) maybe?

-Original Message-
From: Massimiliano PASQUALONI
[mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 22, 2007 9:40 AM
To: 'Tomcat Users List'
Subject: if don't work?!?!?


Hi guy!
 
Wat's happen??
 
If i read an checkrequest post

String Pippo = request.getParameter(abilitato);

out.print(Pippo);

return me= on

If I try to make a condition whit if:

 

   if (Pippo == on) {



}

these don't work
 
And is'nt the first time, 
 
if I try
 
Pippo =  request.getParameter(abilitato);
Pluto =  request.getParameter(abilitato);
 
the if (Pippo == Pluto )  don't work!
 
 
 
:-(
 
please, help me!

Massimiliano PASQUALONI

Data Processing S.r.l.
Reparto EDP
S.S. 100 BA-TA Km 18
c/o IL BARICENTRO 
torre D
70010 CASAMASSIMA (BA)

-
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Scanned with Copfilter Version 0.83beta3a (ProxSMTP 1.4)
AntiVirus: ClamAV 0.88.4/3281 - Tue May 22 10:50:43 2007
by Markus Madlener @ http://www.copfilter.org

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Action methods stopped working

2007-05-22 Thread Michal Glowacki
No... I forgot to add that the problem is only in IE, anyway I've no
validation or javascript errors.

Michal

- Original Message -
From: Mark Thomas [EMAIL PROTECTED]
To: Tomcat Users List users@tomcat.apache.org
Sent: Tuesday, May 22, 2007 1:44 PM
Subject: Re: Action methods stopped working


 Michal Glowacki wrote:
   I don't know what caused
   the problem, I've only add an attribute URIEncoding=UTF-8 to
Connector
 Does removing this fix the problem?

 Mark

 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



R: R: if don't work?!?!?

2007-05-22 Thread Massimiliano PASQUALONI
No, I don't have set any value ont the checkbox, is a boolean choise, I use
the default value.


I think i've fixed my page whit the equals method...


I'm sorry for the nuisance, heartfelt thanks to every Tomcat Users, bye!



Massimiliano


-Messaggio originale-
Da: Edoardo Panfili [mailto:[EMAIL PROTECTED] 
Inviato: martedì 22 maggio 2007 17.06
A: Tomcat Users List
Oggetto: Re: R: if don't work?!?!?

Massimiliano PASQUALONI ha scritto:
 No, don't work!
 
 Im try a simple function in my javabean that convert from string to
 boolean:
 
 JSP:
 String Prova = request.getParameter(abilitato);
  // where abilitato is a checkbox in a form
can you post the HTML fragment of the form?
Do you have somethinkg like
input name=abilitato value=si type=checkbox ?
check the value of value attribute of input element

Edoardo

 
 
 
 
 
 Javabean:
 
 public boolean StringToBoolean(String StrBool)
{
   boolean convertito=false;
 
   if ((StrBool == 1) || (StrBool == On) || (StrBool ==
 on) || (StrBool == Yes) || (StrBool == yes) || (StrBool == Si) 
 || (StrBool == si) || (StrBool == True) || (StrBool == true))
   {
   convertito = true;
   }
 
   if ((StrBool == 0) || (StrBool == Off) || (StrBool ==
 off) || (StrBool == No) || (StrBool == no) || (StrBool == False)
 || (StrBool == false))
   {
   convertito = false;
   }
 
   return convertito;
}
  
 
 
 
 
 
 
 
 If I try
 
   if (on.equals(request.getParameter(abilitato))){
   Abilitato = true;
   }
 
 
 
 Or
 
if (request.getParameter(abilitato).equals(on)){
   Abilitato = true;
   }
 
 Or
 
   if (request.getParameter(abilitato) == on){
   Abilitato = true;
   }
 
 Or 
   Boolean Abilitato = bean.StringToBoolean(Prova);
 
 
 I have the same result: don't work..
 
 
 Yesterday I've try also
 
   Referer = request.getHeader(Referer) 
   AltroReferer = request.getHeader(Referer)
 
   if (Referer == AltroReferer ){...}
 
 And don't work.
 
 
 :-O
 
 
 
 
 -Messaggio originale-
 Da: Edoardo Panfili [mailto:[EMAIL PROTECTED]
 Inviato: martedì 22 maggio 2007 16.44
 A: Tomcat Users List
 Oggetto: Re: if don't work?!?!?
 
 Massimiliano PASQUALONI ha scritto:
 Hi guy!
  
 Wat's happen??
  
 If i read an checkrequest post

 String Pippo = request.getParameter(abilitato);

 out.print(Pippo);

 return me= on

 If I try to make a condition whit if:

  

if (Pippo == on) {

 

 }
 
 Maybe possible that I don't understand...
 
 String pippo = request.getParameter(abilitato);
 if (pippo.equals(on)) {
   // ...
 }
 
 
 Edoardo
 


--
[EMAIL PROTECTED]
AIM: edoardopn
Jabber: [EMAIL PROTECTED]
tel:075 9142766

-
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Scanned with Copfilter Version 0.83beta3a (ProxSMTP 1.4)
AntiVirus: ClamAV 0.88.4/3281 - Tue May 22 10:50:43 2007
by Markus Madlener @ http://www.copfilter.org

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Problem debugging tomcat 5.5

2007-05-22 Thread Raymond Gupta

Hi all,

I am trying to debug tomcat 5.5 using Eclipse + the Sysdeo plugin. I can
debug my webapps just fine, however, when trying to look at the tomcat
sources on the stack, I am running into issues.

Here is what I have done so far (Windows XP SP2)
- Downloaded Tomcat 5.5 sources
- Downloaded Ant 1.7
- Built Tomcat
- Pointed Eclipse Sysdeo to the tomcat-src\build\build directory for running
tomcat
- Ran my webapp with a breakpoint which breaks fine.
- When I try and load one of the tomcat methods on the stack trace, eclipse
asks me to point it to the catalina.jar file. I do that, but Eclipse still
cannot load the sources. It gives me the following message:
The source attachment does not contain the source for the file
StandardWrapper.class. You can change the source attachment by clicking
Change Attached Source below:

- When I click on the button, it brings up a dialog box that is looking for
a .jar or .zip file. I tried pointing it to the catalina.jar file again, the
folder where the jar file is, the actual StandardWrapper.java file, the
folder where the java source is, but neither of those work.

Anyone run into this and have any ideas on how to fix this?

Thanks.


Re: Cannot get SingleonLoader (from jar) to find classes outside JAR

2007-05-22 Thread Filip Hanik - Dev Lists
that work around is probably not what you want. You've just disabled the 
ability to reload your app correctly.

Try using another classloader, maybe the
Thread.currentThread().getContextClassLoader()

where are you storing the class that is trying to load the singleton? it 
should be in your webapp as well.


Filip

Mike Peremsky wrote:

I have resolved this issue, but am wondering if the way I did it is the 
correct way to resolve this issue.
   
  I modified the catalina.properties file entry common.loader by adding the path to the applications WEB-INF/classes directory, this seems to have resolved the issue with finding the class.
   
   
  common.loader=${catalina.home}/common/classes,snip,${catalina.home}/webapps/myExternalApp/WEB-INF/classes
   
   
   
  I also had to fix a bug in the retrieval of the method (I read the API docs incorrectly)
   
 private static final Object OBJECT_ARG_LIST[] = new Object[0];

   private static final Class CLASS_ARG_LIST[] = new Class[0];

 Method method = 
singletonClassObj.getMethod(GET_INSTANCE_METHOD,
 CLASS_ARG_LIST);
   method.invoke(null, OBJECT_ARG_LIST);

   
   
  Mike Peremsky [EMAIL PROTECTED] wrote:

  I tried the modification you suggested (with the correct method name on the 
end) but still with the same results. I also printed out a debug message just 
to see what class loader was being used (not that I know what to do with it :-P 
)

log.debug(this class loader:  + 
this.getClass().getClassLoader().getClass().getName());
Class singletongClassObj = 
this.getClass().getClassLoader().loadClass(singletonClassName); 


The class loader for the SingletonLoader is: 
org.apache.catalina.loader.StandardClassLoader.

The classes that it is looking for are located in the 


/apache-tomcat-5.5.23/webapps/myExternalApp/WEB-INF/classes directory.




Filip Hanik - Dev Lists wrote:
did you try

Class singletongClassObj = this.getClass().getClassLoader().loadName(singletonClassName); 


Filip


Mike Peremsky wrote:
  
I think this may be a class loader issue, but am not sure as I have never really worked with them before. I am putting together a JAR file that contains a set of classes to be used throughout a suite of applications. I have a class called SingletonLoader that was working when it was within the main application, but when I broke out the reusable classes into a separate jar file and modified the contextInitialized() method to dynamically load the classes it is failing to fid the classes. The contextInitialized() method is properly reading the class names from the property file (e.g. SINGLETON_LOADER_CLASSES=com.externalApp.singleton.Countries,com.externalApp.singleton.SecurityQuestions) and looping through them, but I always get the following error message when the line 

Class singletongClassObj = Class.forName(singletonClassName); 


is executed:

Unable to load singleton: com.externalApp.singleton.Countries
java.lang.ClassNotFoundException: com.externalApp.singleton.Countries

ALL of the singleton classes to be loaded implement the Singleton interface (which has 
nothing in it, it is just used to denote a class that MUST specify a public static 
anyReturnVal getInstance() method.

public class SingletonLoader implements ServletContextListener, SystemConsts {
/**
* Logger for this class
*/
private static final Logger log = Logger.getLogger(SingletonLoader.class);
private static final String SINGLETON_LOADER_CLASSES
= SINGLETON_LOADER_CLASSES;
private static final String DELIMITER = ,;
// This is the method defined
private static final String GET_INSTANCE_METHOD = getInstance;
private static final Object ARG_LIST[] = new Object[0];

/**
* Constructs a new SingletonLoader object.
*/
public SingletonLoader() {
}

/**
* Notification that the web application is ready to process requests.
* 
* Initializes all of the singletons so they are ready for immediate use

* after the containet server starts.
* 
* @param sce This is the event object for notifications about changes to the

* servlet context of a web application.
* 
*/

public void contextInitialized(ServletContextEvent sce) {

log.debug(contextInitialized: BEGIN);
String singletons = ExtProperties.getProperty(SYS_PROPS, 
SINGLETON_LOADER_CLASSES);

if (!StringUtils.isNullOrZeroLen(singletons)) {
DelimitedString ds = new DelimitedString(singletons, DELIMITER);
int max = ds.size();
String singletonClassName = null;

for (int ndx=0; ndx  max; ndx++) {
try {
singletonClassName = ds.getEntry(ndx);
log.debug(Get singletonClassName:  + singletonClassName);
// Get the singleton class to load
Class singletongClassObj = Class.forName(singletonClassName);
log.debug(singletongClassObj:  + singletongClassObj);
Method method = singletongClassObj.getMethod(GET_INSTANCE_METHOD,
singletongClassObj);
method.invoke(null, ARG_LIST);

} catch (Exception e) {
log.error(Unable to load singleton:  + singletonClassName, e);
}
}
}
log.debug(contextInitialized: END);
}

/**
* 

Re: R: if don't work?!?!?

2007-05-22 Thread Mike Peremsky
As previously mentioned your examples should work as modified below:
   
   
  String Pippo = request.getParameter(abilitato);


if (Pippo.equals(on)) {

}

 
Pippo =  request.getParameter(abilitato);
Pluto =  request.getParameter(abilitato);
 
if (Pippo.quals(Pluto))  
   
  Pippo == Pluto will never be true unless you possibly set Pippo = Pluto first.
  

Massimiliano PASQUALONI [EMAIL PROTECTED] wrote:
  counter-order!!!


The equals method don't work if I put the request in his parameter, but if a
read the request and I set a String, if i put this string in the parameters,
it work!





-Messaggio originale-
Da: Propes, Barry L [mailto:[EMAIL PROTECTED] 
Inviato: martedì 22 maggio 2007 17.04
A: Tomcat Users List
Oggetto: RE: if don't work?!?!?

if (Pippo.equals(Pluto)) maybe?

-Original Message-
From: Massimiliano PASQUALONI
[mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 22, 2007 9:40 AM
To: 'Tomcat Users List'
Subject: if don't work?!?!?


Hi guy!

Wat's happen??

If i read an checkrequest post

String Pippo = request.getParameter(abilitato);

out.print(Pippo);

return me= on

If I try to make a condition whit if:



if (Pippo == on) {

 

}

these don't work

And is'nt the first time, 

if I try

Pippo = request.getParameter(abilitato);
Pluto = request.getParameter(abilitato);

the if (Pippo == Pluto ) don't work!



:-(

please, help me!

Massimiliano PASQUALONI

Data Processing S.r.l.
Reparto EDP
S.S. 100 BA-TA Km 18
c/o IL BARICENTRO 
torre D
70010 CASAMASSIMA (BA)

-
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Scanned with Copfilter Version 0.83beta3a (ProxSMTP 1.4)
AntiVirus: ClamAV 0.88.4/3281 - Tue May 22 10:50:43 2007
by Markus Madlener @ http://www.copfilter.org

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



   
-
Ready for the edge of your seat? Check out tonight's top picks on Yahoo! TV. 

RE: if don't work?!?!?

2007-05-22 Thread Bryce Burgess \(bburgess\)

Would this work for you?
( http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html#toLowerCase() )

Javabean:

public boolean StringToBoolean(String StrBool)
 {
 boolean convertito=false;
   // since the default is false, only need to check the true... 
   // If any of these are true, return true, else return false (on any 
string of characters...)

if ((contentEquals(toLowerCase(StrBool) 1))|| 
(contentEquals(toLowerCase(StrBool) on))   || 
(contentEquals(toLowerCase(StrBool) yes))  || 
(contentEquals(toLowerCase(StrBool) si))   || 
(contentEquals(toLowerCase(StrBool) true)) )
{
convertito = true;
}

 return convertito;
 }



-Original Message-
From: Massimiliano PASQUALONI [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, May 22, 2007 9:58 AM
To: 'Tomcat Users List'
Subject: R: if don't work?!?!?

No, don't work!

Im try a simple function in my javabean that convert from string to
boolean:

JSP:
String Prova = request.getParameter(abilitato);
 // where abilitato is a checkbox in a form





Javabean:

public boolean StringToBoolean(String StrBool)
 {
boolean convertito=false;



if ((StrBool == 0) || (StrBool == Off) || (StrBool ==
off) || (StrBool ==   No) || (StrBool == no) || (StrBool == False)
|| (StrBool == false))
{
convertito = false;
}

return convertito;
 }
 







If I try 

if (on.equals(request.getParameter(abilitato))){
Abilitato = true;
}



Or 

 if (request.getParameter(abilitato).equals(on)){
Abilitato = true;
}

Or

if (request.getParameter(abilitato) == on){
Abilitato = true;
}

Or 
Boolean Abilitato = bean.StringToBoolean(Prova);


I have the same result: don't work..


Yesterday I've try also

Referer = request.getHeader(Referer) 
AltroReferer = request.getHeader(Referer) 

if (Referer == AltroReferer ){...}

And don't work.


:-O




-Messaggio originale-
Da: Edoardo Panfili [mailto:[EMAIL PROTECTED]
Inviato: martedì 22 maggio 2007 16.44
A: Tomcat Users List
Oggetto: Re: if don't work?!?!?

Massimiliano PASQUALONI ha scritto:
 Hi guy!
  
 Wat's happen??
  
 If i read an checkrequest post
 
 String Pippo = request.getParameter(abilitato);
 
 out.print(Pippo);
 
 return me= on
 
 If I try to make a condition whit if:
 
  
 
if (Pippo == on) {
 
 
 
 }

Maybe possible that I don't understand...

String pippo = request.getParameter(abilitato);
if (pippo.equals(on)) {
// ...
}


Edoardo

--
[EMAIL PROTECTED]
AIM: edoardopn
Jabber: [EMAIL PROTECTED]
tel:075 9142766

-
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Scanned with Copfilter Version 0.83beta3a (ProxSMTP 1.4)
AntiVirus: ClamAV 0.88.4/3281 - Tue May 22 10:50:43 2007 by Markus Madlener @ 
http://www.copfilter.org

-
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: 
[EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



JNDI Connector Problem

2007-05-22 Thread John Morris
For the past few weeks I have attempted to get the Shibboleth Internet2 
Middleware servlet running under Tomcat. I have been able to get
the servelet to run and respond however I am stuck on the very last part. That 
is passing the username and password attributes from my login
form (login.jsp) to Active Directory for authentication. I have setup a JNDI 
relm in accordance to what my research told me; however, I am not
completely convinced that this is the correct setup for the JNDI connector. On 
the surface everything appears to be functioning but no matter
what I enter into my login.jsp it returns incorrect password or username. Any 
assistance would be helpful.
 
 Realm
 ResourceName=AD
 className=org.apache.catalina.realm.JNDIRealm
 connectionURL=ldap://127.0.0.1:389/;
 connectionName=[EMAIL PROTECTED]
 connectionPassword=password
 userPattern=uid={0},ou=Users,dc=test,dc=network,dc=com
 userBase=OU=Users,DC=test,DC=network,DC=com
 userSubtree=true
 userRoleName=objectclass
 referrals=follow
 roleBase=OU=Users,dc=test,DC=network,DC=com
 roleSubtree=true
 roleName=Users
 roleSearch=(uniqueMember={0})
 debug=99/
 

My login.jsp is fairly simple but is relevant in the current situation. 

http://rafb.net/p/7RW13A34.html

The web.xml is also incredibly simplistic but here it is.

http://rafb.net/p/yGfieS69.html

And my server.xml

http://rafb.net/p/xCByJo42.html

and my logs.

http://rafb.net/p/l2IiVu86.html








  
Shape
 Yahoo! in your own image.  Join our Network Research Panel today!   
http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 



AW: AW: AW: logging log4j of my application

2007-05-22 Thread Marc Rameder
First of all thanks for your help!!! But I didn't find a solution until now.
After revising the source code if found the main problem. I am using commons
logging and not log4j. By using log4j all works fine.

import org.apache.log4j.Logger;
import org.apache.log4j.BasicConfigurator;

private static final Logger LOG = Logger.getLogger(User.class);

However with commons logging it doesn't. 

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

private static final Log LOG = LogFactory.getLog(User.class);

May somebody have an idea to solve the problem at the bottom with this new
aspect?

Regards
marc


-Ursprüngliche Nachricht-
Von: Rainer Jung [mailto:[EMAIL PROTECTED] 
Gesendet: Montag, 21. Mai 2007 16:59
An: Tomcat Users List
Betreff: Re: AW: AW: logging log4j of my application

Your config looks OK to me.

Sometimes such a thing happens, if one starts the process unintended as 
root, who then owns the log file and after starting again as non-root, 
the process user can not write to the file...

You can add -Dlog4j.debug to the startup options of your Tomcat. Then 
catalina.out will contain information about log4j parsing its config, like

log4j: Using URL [file:.../conf/log4j.properties] for automatic log4j 
configuration.
log4j: Reading configuration from URL file:.../conf/log4j.properties
log4j: Parsing for [root] with value=[DEBUG,FILE].
...
log4j: End of parsing for FILE.
log4j: Setting property [file] to [/home/jung/.../logs/RPSSERVER.log].
log4j: setFile called: /home/jung/.../logs/RPSSERVER.log, true
...

Maybe you will detect something strange in this output.

Regards,

Rainer

Marc Rameder wrote:
 The output of the log file should be information about hibernate, spring
and
 my development in the net.thefource package. 
 I have used this log4j.properties for a GUI application where it is
working
 fine and also by testing the server with JUnit all debug information are
 displayed.
 I am starting the tomcat with the startup.bat. Hence it is not a service.
 
 A example for the GUI application would be:
 14:07:25,500 () [INFO ] CollectionFactory (clinit) - JDK 1.4+
collections
 available 
 
 marc
 
 log4j.rootLogger=DEBUG,FILE
 #ConsoleAppender
 log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
 log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
 log4j.appender.CONSOLE.layout.ConversionPattern=%d{HH:mm:ss,SSS} (%x)
[%-5p]
 %c{1} (%M) - %m%n
 #FileAppender
 log4j.appender.FILE=org.apache.log4j.FileAppender
 log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
 log4j.appender.FILE.layout.ConversionPattern=%d{HH:mm:ss,SSS} (%x) [%-5p]
 %c{1} (%M) - %m%n
 log4j.appender.FILE.File=${catalina.home}/logs/RPSSERVER.log
 log4j.appender.FILE.File.MaxFileSize=1MB
 # Keep one backup file
 log4j.appender.FileApp.MaxBackupIndex=1
 log4j.appender.FileApp.layout=org.apache.log4j.PatternLayout
 log4j.appender.FileApp.layout.ConversionPattern=%d{HH:mm:ss,SSS} (%x)
[%-5p]
 %c{1} (%M) - %m%n

 log4j.logger.org.apache.catalina=WARN, CONSOLE
 log4j.logger.org.apache.catalina.core=WARN, CONSOLE
 log4j.logger.org.apache.catalina.session=WARN, CONSOLE
 
 log4j.logger.net.thefource=DEBUG ,CONSOLE
 
 log4j.logger.org.apache.commons=WARN, CONSOLE
 log4j.logger.org.hibernate=INFO, CONSOLE
 log4j.logger.org.hibernate.type=INFO, CONSOLE
 log4j.logger.org.springframework=INFO, CONSOLE
 
 -Ursprüngliche Nachricht-
 Von: Rainer Jung [mailto:[EMAIL PROTECTED] 
 Gesendet: Montag, 21. Mai 2007 13:55
 An: Tomcat Users List
 Betreff: Re: AW: logging log4j of my application
 
 All right, so we assume, there are no log4j things lying around in your 
 Tomcat apart from your webapp. Also please check, that the running 
 Tomcat process has no -Dlog4j.configuration  in its commandline.
 
 It could be, that you have a servlet initialization, that configures 
 log4j via its API, but let's assume this is not the case.
 
 Then even without the context-param, the log4j.properties in your 
 WEB-INF/classes should be found as the default configuration. Maybe the 
 context-param is an indicator, that there is explicit log4j 
 initialization code in your webapp and you are not using
autoconfiguration.
 
 In both cases we assume it really picks up the 
 WEB-INF/classes/log4j.properties.
 
 So if a file gets created but nothing gets logged into it, we should 
 have a look at the contents of the log4j.properties file. You should 
 post it.
 
 Also: which messages would you expect there?
 
 Regards,
 
 Rainer
 
 
 Marc Rameder wrote:
 I deploy a war file with the following content.
 WEB-INF:
  classes:
 contains the log4j.properties file in the root directory. Only
 one exists.
  lib:
 contains the log4j-1.2.9.jar not in any other directory

 my web.xml contains

 context-param
 param-namelog4jConfigLocation/param-name
 param-valueclasspath:log4j.properties/param-value
   /context-param

 I hope that's the information you ask for!
 thanks
 marc

 

AW: AW: AW: logging log4j of my application

2007-05-22 Thread Marc Rameder
Sorry for spaming but solution is found! 
Jar file was corrupted.

Thanks @ all
marc

-Ursprüngliche Nachricht-
Von: Marc Rameder [mailto:[EMAIL PROTECTED] 
Gesendet: Dienstag, 22. Mai 2007 16:38
An: 'Tomcat Users List'
Betreff: AW: AW: AW: logging log4j of my application

First of all thanks for your help!!! But I didn't find a solution until now.
After revising the source code if found the main problem. I am using commons
logging and not log4j. By using log4j all works fine.

import org.apache.log4j.Logger;
import org.apache.log4j.BasicConfigurator;

private static final Logger LOG = Logger.getLogger(User.class);

However with commons logging it doesn't. 

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

private static final Log LOG = LogFactory.getLog(User.class);

May somebody have an idea to solve the problem at the bottom with this new
aspect?

Regards
marc


-Ursprüngliche Nachricht-
Von: Rainer Jung [mailto:[EMAIL PROTECTED] 
Gesendet: Montag, 21. Mai 2007 16:59
An: Tomcat Users List
Betreff: Re: AW: AW: logging log4j of my application

Your config looks OK to me.

Sometimes such a thing happens, if one starts the process unintended as 
root, who then owns the log file and after starting again as non-root, 
the process user can not write to the file...

You can add -Dlog4j.debug to the startup options of your Tomcat. Then 
catalina.out will contain information about log4j parsing its config, like

log4j: Using URL [file:.../conf/log4j.properties] for automatic log4j 
configuration.
log4j: Reading configuration from URL file:.../conf/log4j.properties
log4j: Parsing for [root] with value=[DEBUG,FILE].
...
log4j: End of parsing for FILE.
log4j: Setting property [file] to [/home/jung/.../logs/RPSSERVER.log].
log4j: setFile called: /home/jung/.../logs/RPSSERVER.log, true
...

Maybe you will detect something strange in this output.

Regards,

Rainer

Marc Rameder wrote:
 The output of the log file should be information about hibernate, spring
and
 my development in the net.thefource package. 
 I have used this log4j.properties for a GUI application where it is
working
 fine and also by testing the server with JUnit all debug information are
 displayed.
 I am starting the tomcat with the startup.bat. Hence it is not a service.
 
 A example for the GUI application would be:
 14:07:25,500 () [INFO ] CollectionFactory (clinit) - JDK 1.4+
collections
 available 
 
 marc
 
 log4j.rootLogger=DEBUG,FILE
 #ConsoleAppender
 log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
 log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
 log4j.appender.CONSOLE.layout.ConversionPattern=%d{HH:mm:ss,SSS} (%x)
[%-5p]
 %c{1} (%M) - %m%n
 #FileAppender
 log4j.appender.FILE=org.apache.log4j.FileAppender
 log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
 log4j.appender.FILE.layout.ConversionPattern=%d{HH:mm:ss,SSS} (%x) [%-5p]
 %c{1} (%M) - %m%n
 log4j.appender.FILE.File=${catalina.home}/logs/RPSSERVER.log
 log4j.appender.FILE.File.MaxFileSize=1MB
 # Keep one backup file
 log4j.appender.FileApp.MaxBackupIndex=1
 log4j.appender.FileApp.layout=org.apache.log4j.PatternLayout
 log4j.appender.FileApp.layout.ConversionPattern=%d{HH:mm:ss,SSS} (%x)
[%-5p]
 %c{1} (%M) - %m%n

 log4j.logger.org.apache.catalina=WARN, CONSOLE
 log4j.logger.org.apache.catalina.core=WARN, CONSOLE
 log4j.logger.org.apache.catalina.session=WARN, CONSOLE
 
 log4j.logger.net.thefource=DEBUG ,CONSOLE
 
 log4j.logger.org.apache.commons=WARN, CONSOLE
 log4j.logger.org.hibernate=INFO, CONSOLE
 log4j.logger.org.hibernate.type=INFO, CONSOLE
 log4j.logger.org.springframework=INFO, CONSOLE
 
 -Ursprüngliche Nachricht-
 Von: Rainer Jung [mailto:[EMAIL PROTECTED] 
 Gesendet: Montag, 21. Mai 2007 13:55
 An: Tomcat Users List
 Betreff: Re: AW: logging log4j of my application
 
 All right, so we assume, there are no log4j things lying around in your 
 Tomcat apart from your webapp. Also please check, that the running 
 Tomcat process has no -Dlog4j.configuration  in its commandline.
 
 It could be, that you have a servlet initialization, that configures 
 log4j via its API, but let's assume this is not the case.
 
 Then even without the context-param, the log4j.properties in your 
 WEB-INF/classes should be found as the default configuration. Maybe the 
 context-param is an indicator, that there is explicit log4j 
 initialization code in your webapp and you are not using
autoconfiguration.
 
 In both cases we assume it really picks up the 
 WEB-INF/classes/log4j.properties.
 
 So if a file gets created but nothing gets logged into it, we should 
 have a look at the contents of the log4j.properties file. You should 
 post it.
 
 Also: which messages would you expect there?
 
 Regards,
 
 Rainer
 
 
 Marc Rameder wrote:
 I deploy a war file with the following content.
 WEB-INF:
  classes:
 contains the log4j.properties file in the root directory. Only
 one exists.
  lib:
   

RE:[SOLVED] Tomcat 5.5, IPv6, APR, HTTP and HTTPS

2007-05-22 Thread Lakshmi Venkataraman
 My application has to work on both Unix and Windows over both IPv4 and
IPv6 transport
using Http or Https.

I am documenting my experience for a newbie.

Here is a summary of what works on what platform.

Windows:  (See apache bug 41973 for additional comments)
  tcnative-1.1.8-ipv4.dll works only for IPv4
  {tcnative-1.1.7-ipv6, tcnative-1.1.8-ipv6, tcnative-1.1.9.dll} works
for both IPv4 and IPv6
  providing you define two HTTP connectors both listening to port 80
(whatever port) with
  address=0.0.0.0 and address=::
  Likewise, you have to define two HTTPS connectors both listening to
port 443.
  tcnative-1.1.10  - I got an error Error starting EndPoint.No Such
host. I did not 
  pursue this because of the above working options.

Solaris:
 Compiled APR 1.2.8, tcnative-1.1.8, openssl-0.9.8b to produce
libtcnative-1.1.8.so
 In addition to libc.so, this also needed libgcc.so. Once this was
included in the path,
 HTTP and HTTPS transport over IPv4 and IPv6 worked like a charm without
any additional 
 configuration changes like Windows.

Linux RH4:
 Compiled APR 1.2.8, tcnative-1.1.8. It already had openSSL-0.9.8b.
Produced libtcnative-1.1.8.so.
 Again both HTTP and HTTPS worked over both IPV4 and IPv6 transport.


Regards
Lakshmi
-Original Message-
From: Lakshmi Venkataraman [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 02, 2007 8:03 PM
To: Tomcat Users List
Subject: RE: Tomcat 5.5, IPv6, APR, HTTP and HTTPS

Corrections:
Here is a summary of what works and what does not.
Tomcat 5.5.23, WinXP, JDK 1.5, OpenSSL-0.9.8b is the base configuration.

 tcnative-1-ipv4.dll (ver 1.1.7) works for both HTTP and HTTPS.
 tcnative-1-ipv6.dll (ver 1.1.7) works for HTTP and HTTPS only with ipv6
transport
  between client and server.   It DOES NOT support ipv4 transport.

Questins 1)  Should not an ipv6 library support both ipv4 and ipv6
transport?

tcnative-1.dll (version 1.1.9) DOES not work at all for both HTTP and
HTTPS in ipv4 or ipv6 mode.

tcnative-1.dll (version 1.1.10) works for HTTP and HTTPS with ipv4
transport between client and server.

Both 1.1.9 and 1.1.0 do not have a separate ipv6 versions.

In all cases above, Tomcat 5.5 server and my application services come
up.

DOES NOT WORK means the following:
When I try to bring my web app in my browser, I see
ClassNotFoundException caused by java.net.ConnectionException:Connection
Refused in the Java Console.

Question 2) Is this a bug in tcnative-1-ipv6.dll  or am I missing
something?

Question 3) Why do versions 1.1.9 and 1.1.10 do not have a separate ipv6
library?
Ideally you want to have the same library for both ipv4 and
ipv6.


Thanks
Lakshmi
 

-Original Message-
From: Lakshmi Venkataraman [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 02, 2007 4:57 PM
To: Tomcat Users List
Subject: Tomcat 5.5, IPv6, APR, HTTP and HTTPS

 

My setup: Tomcat 5.5.23, JDK 1.5, WIN XP I am also using tcnative-1.dll
and OpenSSL 0.9.8b Client browser: IE6, Firefox 1.5 for IPv4
IE7 for IPv6.
I successfully tested Tomcat 5.5.23 by enabling ipV6 without using APR.

SUCCESS:
If I use tcnative-ipv4.dll (version 1.1.8) I find that I am able to
start Tomcat and other service in the backend.
And my web application comes up in both HTTP and HTTPS mode.

However, if I use tcnative-ipv6.dll (version 1.1.8), Tomcat and other
backend services start successfully. 
FAILURE:  
My web application  does not come up either in HTTP or HTTPS using ipv4
or ipv6.
Java console shows ClassNotFoundException  caused by
java.net.ConnectionException:Connection Refused.

Anybody has any clue as to why I am getting the above exception for both
http://localhost and https://localhost using ipv4?
Also http://[3000::211] or https://[3000::211] does not work either in
IE 7.


I also tried tcnative-1.dll (version) 1.1.9. Same problem as
tcnative-ipv6.dll (ver 1.1.8).

I feel there is something missing in my configuration. 

Thanks in advance for your help,
Lakshmi

-
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Finding isapi_redirector2.dll

2007-05-22 Thread Propes, Barry L
try this, Al.

I think it may have it.

http://www.reynir.net/tomcat/tomcat_IIS_service_jk2.html

-Original Message-
From: Al Sparks [mailto:[EMAIL PROTECTED]
Sent: Monday, May 21, 2007 5:25 PM
To: Tomcat Users List
Subject: Finding isapi_redirector2.dll


I'm new to Tomcat.

I successfully installed version 6.0 on a Windows 2000 server also
running IIS.

Now I'm trying to install the Jakarta redirector plugin.  Everything
I've read says that I'm supposed to download isapi_redirector2.dll, or
build it.  I've been trying to find a download, and can't really find
it.  I've been googling for jakarta-tomcat-connectors, I've been
googling for isapi_redirector2.dll.  Lots of hits, but no joy for an
actual download (beyond the first page, anyway).  What's really
strange is a site search of apache.org doesn't find me a download.

What am I missing?

Also, since this is my first install of the redirector, any gotchas
that veterans know of would be appreciated.

   === Al




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: JDBC

2007-05-22 Thread Propes, Barry L
Mohammed, for driver value, try the following:

 valueoracle.jdbc.OracleDriver/value

-Original Message-
From: Mohammed Zabin [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 22, 2007 4:33 AM
To: Tomcat Users List
Subject: Re: JDBC


Thank you Foo for your patience with me,
I did imported all the needed classes, but i got the following exception:


*exception *

*org.apache.jasper.JasperException: An exception occurred processing
JSP page /jsp/testDBCP.jsp at line 7

4:   Context initContext = new InitialContext();
5:   Context envContext  = (Context)initContext.lookup(java:/comp/env);
6:   DataSource ds = (DataSource)envContext.lookup(jdbc/myoracledb);
7:   Connection conn = ds.getConnection();
8:
9:   out.println( The Connection Gotted Fine );
10: %


Stacktrace:

org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:515)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:408)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)*

**

*root cause *

*javax.servlet.ServletException:
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC
driver of class '' for connect URL 'null'

org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:855)

org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:784)
org.apache.jsp.jsp.testDBCP_jsp._jspService(testDBCP_jsp.java:73)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:384)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)*

**

*root cause*

org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC
driver of class '' for connect URL 'null'

org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:780)

org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)
org.apache.jsp.jsp.testDBCP_jsp._jspService(testDBCP_jsp.java:62)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:384)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

 *root cause*

java.lang.NullPointerException
sun.jdbc.odbc.JdbcOdbcDriver.getProtocol(JdbcOdbcDriver.java:507)
sun.jdbc.odbc.JdbcOdbcDriver.knownURL(JdbcOdbcDriver.java:476)
sun.jdbc.odbc.JdbcOdbcDriver.acceptsURL(JdbcOdbcDriver.java:307)
java.sql.DriverManager.getDriver(DriverManager.java:253)

org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:773)

org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)
org.apache.jsp.jsp.testDBCP_jsp._jspService(testDBCP_jsp.java:62)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:384)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)




On 5/22/07, Foo Shyn [EMAIL PROTECTED] wrote:

 The jsp doesn't import the class for Context and Initial Context. Put
 them in as how u inport the Datasource would do.

 HTH
 FooShyn

 Mohammed Zabin wrote:
  Thank you Foo,
  I but the following in the context.xml:
 
  *Resource name=Name
  auth=Container
  type=oracle.jdbc.pool.OracleDataSource
  factory=oracle.jdbc.pool.OracleDataSourceFactory
  user=hr
  password=hr
  driverClassName=oracle.jdbc.driver.OracleDriver
  url=jdbc:oracle:thin:@localhost:1521:orcldb
  maxActive=20 maxIdle=10 maxwait=-1/*
  **
  and I have this jsp code:
 
 
  *%@ page import=javax.sql.DataSource %*
 
  *%
   Context initContext = new InitialContext();
   Context envContext  = (Context)initContext.lookup(java:/comp/env);
   DataSource ds = (DataSource)envContext.lookup(jdbc/myoracledb);
   Connection conn = ds.getConnection();
 
   out.println( Got the connection );
  %*
 
  but, i got the following 

RE: Re: hi,wired problem? add 0 into alist but get 1 as a result!

2007-05-22 Thread David Short
Do a clean and build in your IDE.  Run the test case in the IDE if possible.


-Original Message-
From: David Delbecq [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, May 22, 2007 2:35 AM
To: Tomcat Users List
Subject: [Norton AntiSpam] Re: hi,wired problem? add 0 into alist but get 1
as a result!

En l'instant précis du 22/05/07 05:21, Peter s'exprimait en ces termes:
 hi all;
 only get problem when put 0 into the list, put 1 or any number is ok, 
 put new Integer(0) is ok as well;
Ide not recompiling or tomcat not reloading class, while you think you are
running the 0 case, you are in fact running the 1 case. did you try
successfully storing 3 then switch back to 0. If It does not compile at 0,
your test case will still show 3.

 i think it may be a bug.
 does anyone has a idea?
 regards


 On 5/21/07, Peter [EMAIL PROTECTED] wrote:

 hi all,

 I have come into a very wired problem.

 here it is.
 my project using JBuilder 2006 and tomcat 5.5.20.
 when i put a 0 into a list and get 1 as a result.
 simple code for testing!

 List alist =new ArrayList();
 alist.add(0); put 0 into it
 alist.get(0); get 1 as result.

 it occurs when i using JBuilder2006 to complie it and run under 
 tomcat 5.5.20.
 i choose Jbuilder 2006 builder property: language features ( java 2 
 SDK V5.0 generic enable) ; target VM java 2 SDK V5.0 and later

 but if i choose target VM target VM java 2 SDK V1.4 and later it 
 works fine, put 0 get 0.
 and if i donot run under the tomcat it still fine

 so i create another small project, in a jsp only doing List alist 
 =new ArrayList(); alist.add(0); alist.get(0); and it works fine as 
 well under the same tomcat.


 i wonder what happens here?
 my project using many other jar file , i wonder if there is something 
 wrong there.
 does anyone has a idea?

 thanks in advanced!







-
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: [SOLVED] Tomcat 5.5, IPv6, APR, HTTP and HTTPS

2007-05-22 Thread Lakshmi Venkataraman
Correction to Linux section.

-Original Message-
From: Lakshmi Venkataraman [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, May 22, 2007 8:59 AM
To: Tomcat Users List
Subject: RE:[SOLVED] Tomcat 5.5, IPv6, APR, HTTP and HTTPS

 My application has to work on both Unix and Windows over both IPv4 and
IPv6 transport
using Http or Https.

I am documenting my experience for a newbie.

Here is a summary of what works on what platform.

Windows:  (See apache bug 41973 for additional comments)
  tcnative-1.1.8-ipv4.dll works only for IPv4
  {tcnative-1.1.7-ipv6, tcnative-1.1.8-ipv6, tcnative-1.1.9.dll} works
for both IPv4 and IPv6
  providing you define two HTTP connectors both listening to port 80
(whatever port) with
  address=0.0.0.0 and address=::
  Likewise, you have to define two HTTPS connectors both listening to
port 443.
  tcnative-1.1.10  - I got an error Error starting EndPoint.No Such
host. I did not
  pursue this because of the above working options.

Solaris 9:
 Compiled APR 1.2.8, tcnative-1.1.8, openssl-0.9.8b to produce
libtcnative-1.1.8.so  In addition to libc.so, this also needed
libgcc.so. Once this was included in the path,  HTTP and HTTPS transport
over IPv4 and IPv6 worked like a charm without any additional
configuration changes like Windows.

Linux RH4:
 Compiled APR 1.2.8, tcnative-1.1.8. The server that I was working on
already had openSSL-0.9.8b.
 So did not have to compile this. While compiling tcnative, used --with
ssl option and gave its location.
 Produced libtcnative-1.1.8.so.
 Again both HTTP and HTTPS worked over both IPV4 and IPv6 transport.


Regards
Lakshmi
-Original Message-
From: Lakshmi Venkataraman [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 02, 2007 8:03 PM
To: Tomcat Users List
Subject: RE: Tomcat 5.5, IPv6, APR, HTTP and HTTPS

Corrections:
Here is a summary of what works and what does not.
Tomcat 5.5.23, WinXP, JDK 1.5, OpenSSL-0.9.8b is the base configuration.

 tcnative-1-ipv4.dll (ver 1.1.7) works for both HTTP and HTTPS.
 tcnative-1-ipv6.dll (ver 1.1.7) works for HTTP and HTTPS only with ipv6
transport
  between client and server.   It DOES NOT support ipv4 transport.

Questins 1)  Should not an ipv6 library support both ipv4 and ipv6
transport?

tcnative-1.dll (version 1.1.9) DOES not work at all for both HTTP and
HTTPS in ipv4 or ipv6 mode.

tcnative-1.dll (version 1.1.10) works for HTTP and HTTPS with ipv4
transport between client and server.

Both 1.1.9 and 1.1.0 do not have a separate ipv6 versions.

In all cases above, Tomcat 5.5 server and my application services come
up.

DOES NOT WORK means the following:
When I try to bring my web app in my browser, I see
ClassNotFoundException caused by java.net.ConnectionException:Connection
Refused in the Java Console.

Question 2) Is this a bug in tcnative-1-ipv6.dll  or am I missing
something?

Question 3) Why do versions 1.1.9 and 1.1.10 do not have a separate ipv6
library?
Ideally you want to have the same library for both ipv4 and
ipv6.


Thanks
Lakshmi
 

-Original Message-
From: Lakshmi Venkataraman [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 02, 2007 4:57 PM
To: Tomcat Users List
Subject: Tomcat 5.5, IPv6, APR, HTTP and HTTPS

 

My setup: Tomcat 5.5.23, JDK 1.5, WIN XP I am also using tcnative-1.dll
and OpenSSL 0.9.8b Client browser: IE6, Firefox 1.5 for IPv4
IE7 for IPv6.
I successfully tested Tomcat 5.5.23 by enabling ipV6 without using APR.

SUCCESS:
If I use tcnative-ipv4.dll (version 1.1.8) I find that I am able to
start Tomcat and other service in the backend.
And my web application comes up in both HTTP and HTTPS mode.

However, if I use tcnative-ipv6.dll (version 1.1.8), Tomcat and other
backend services start successfully. 
FAILURE:  
My web application  does not come up either in HTTP or HTTPS using ipv4
or ipv6.
Java console shows ClassNotFoundException  caused by
java.net.ConnectionException:Connection Refused.

Anybody has any clue as to why I am getting the above exception for both
http://localhost and https://localhost using ipv4?
Also http://[3000::211] or https://[3000::211] does not work either in
IE 7.


I also tried tcnative-1.dll (version) 1.1.9. Same problem as
tcnative-ipv6.dll (ver 1.1.8).

I feel there is something missing in my configuration. 

Thanks in advance for your help,
Lakshmi

-
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Oracle 10g with Tomcat 6

2007-05-22 Thread Propes, Barry L
Mohammed,

Maybe on import try the following:

%@ page 
import=javax.naming.Context,javax.naming.InitialContext,javax.naming.NamingException,javax.sql.DataSource
 %

even though what you have should cover it, theoretically.

And regarding below, YES!!!

C:\tomcat\common\lib\ojdbc14_g.jar
-

Hi All
I want to conigure DBCP to connect to Oracle 10g on my localhost on Tomcat6.
I did the following error, I don't know how to solve it, is there is a
third-party jar file that must be added to classpath???


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [solved] Tomcat and Static file Caching ( 304 headers )

2007-05-22 Thread [EMAIL PROTECTED]

Sorry to your all.. Tomcat does do correct caching..
The way that firebug displays this is a bit strange..

My fault

[EMAIL PROTECTED] schreef:

Well we are talking about static js files that do not change often.
If was thinking about writing my own filter that created the
correect header fields... But i think it is really a responsibility of 
the

application server to support client caching for static files..

It looks like tomcat does not do that.. at least not for javasdcript 
files..

Or the firebug firefox util is f*cked up...
I will investigate this case.. because i think Tomcat DOES support
cahcing ( at least if i look at the code of DefaultServlet that handles
the static files in tomcat )..
But strangely enough it does not work for me..


Johnny Kewl schreef:

I just had an after thought... happens often ; )
I think because you using feed type technology the assumption is that 
is wot you really want,
but if this js file never changes... then wot about trying normal 
caching constructs like


please check the actual format...
Cache-control: public, max-age=3600
I think that will cache the js page for one hour alot easier than 
hashing pages and all the other fancy stuff in feeds maybe.


- Original Message - From: Johnny Kewl [EMAIL PROTECTED]
To: Tomcat Users List users@tomcat.apache.org
Sent: Tuesday, May 22, 2007 3:55 PM
Subject: Re: Tomcat and Static file Caching ( 304 headers )


Hi... I dont know much about this, never had a chance to play with 
it... dont even
know how much Tomcat does for you and how much is manual header 
manipulation.
But just from below... there seems to be nothing in the browser 
response telling the server

that it understands feed caching... ie one would expect to see
Last-Modified:  or Etag... so just guessing but I dont think the 
browser understands it..

maybe you should try Last-Modified

I found a fairly decent article maybe will help... 
http://rakaz.nl/item/reducing_the_bandwidth_used_by_feeds


- Original Message - From: [EMAIL PROTECTED] 
[EMAIL PROTECTED]

To: users@tomcat.apache.org
Sent: Tuesday, May 22, 2007 2:17 PM
Subject: Tomcat and Static file Caching ( 304 headers )



I am using Tomcat 5.5 together with Eclipse 3.2.2 for development
of a web application.

But when i use FireBug in Firefox to track network traffic is
see that tomcat never returns a 304 NOT MODIFIED header
if a file is requested twice.

For example when requesting a JavaScript file:
http://localhost:8080/XDataSystem/standard/js/standard.js
you see the following headers:

*Response Headers*
Server Apache-Coyote/1.1
Etag W/10823-1179768573406
Last-Modified Mon, 21 May 2007 17:29:33 GMT
Content-Type text/javascript
Content-Encoding gzip
Vary Accept-Encoding
Date Tue, 22 May 2007 11:52:27 GMT



*Request Headers*
Host localhost:8080
User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.3)
Gecko/20070309 Firefox/2.0.0.3
Accept */*
Accept-Language nl,en-us;q=0.7,en;q=0.3
Accept-Encoding gzip,deflate
Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive 300
Connection keep-alive
Referer http://localhost:8080/XDataSystem/rainbow/home.page



As you can see in the response filter i have turned GZIP 
compressoin on.


But when i request the page again ( by typing the url in the url-bar,
NOT using F5 )
I get the exact same response back.. But i expect a 304 response.

I think it has something to do with the Vary response field.
I have read this:
http://localhost:8080/XDataSystem/standard/js/standard.js

But i do not understand it fully.

can anybody help me??
This really makes my application ( using dojo ) slow.

Thanks in advance.

Tjerk Wolterink





-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



comet read event

2007-05-22 Thread Peter Warren
The following client code generates a comet BEGIN event on the server
but not a subsequent READ event, as I was expecting.  How come?  Is my
code wrong?  Are my expectations wrong?  See sequence of events
commented in code below.

// client test method that sends messages to server and listens for
responses
public void test() throws IOException {
out.println(test 1);
out.flush();

// server receives client's message, generates a BEGIN event,
and sends response to client

in = new BufferedReader(new
InputStreamReader(urlConn.getInputStream()));
System.out.println(in.readLine());

// client receives server's response and prints it

out.println(test 2);
out.flush();

System.out.println(in.readLine());

// client code blocks here waiting for server response.
// server never generates a READ event.  How come?
// Does the HttpURLConnection (see full code below) need to be
set up differently?
// Am I using the PrintWriter incorrectly when sending to the
comet servlet?

out.close();
urlConn.disconnect();
}

Thanks for any help,
Peter

-- system --

using:
tomcat 6.0.13 on windows xp sp 2
java 1.6.0_01

-- test client  comet servlet source below --

## begin test client ##

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.HttpURLConnection;
import java.net.URL;

public class CometTestClient {

private HttpURLConnection urlConn;

private PrintWriter out;

private BufferedReader in;

public static void main(String[] args) throws Exception {
CometTestClient test = new CometTestClient();
test.test();
}

public CometTestClient() throws IOException {
initConnection();
}

private void initConnection() throws IOException {
URL url = new URL(http://127.0.0.1/CometTest;);
urlConn = (HttpURLConnection) url.openConnection();
urlConn.setDoInput(true);
urlConn.setDoOutput(true);
urlConn.connect();
out = new PrintWriter(urlConn.getOutputStream());
}

public void test() throws IOException {
out.println(test 1);
out.flush();

in = new BufferedReader(new
InputStreamReader(urlConn.getInputStream()));
System.out.println(in.readLine());

out.println(test 2);
out.flush();

System.out.println(in.readLine());

out.close();
urlConn.disconnect();
}
}

## end test client ##

## begin comet servlet ##

import java.io.BufferedReader;
import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;

import org.apache.catalina.CometEvent;
import org.apache.catalina.CometProcessor;

public class CometTestServlet extends HttpServlet implements
CometProcessor {
private static final long serialVersionUID = 5472498184127924791L;

public void event(CometEvent cometEvent) throws IOException,
ServletException {
HttpServletRequest request = cometEvent.getHttpServletRequest();
// don't want timeout events
cometEvent.setTimeout(100);
if (cometEvent.getEventType() == CometEvent.EventType.BEGIN) {
log(Begin for session:  + request.getSession(true).getId());
BufferedReader reader =
cometEvent.getHttpServletRequest().getReader();
String line = reader.readLine();
if (line != null) {
log(servlet received:  + line);
   
cometEvent.getHttpServletResponse().getWriter().println(servlet
received:  + line);
cometEvent.getHttpServletResponse().getWriter().flush();
} else {
cometEvent.close();
}
} else if (cometEvent.getEventType() ==
CometEvent.EventType.ERROR) {
log(Error for session:  + request.getSession(true).getId()
+ ,  + cometEvent.getEventSubType());
cometEvent.close();
} else if (cometEvent.getEventType() == CometEvent.EventType.END) {
log(End for session:  + request.getSession(true).getId());
cometEvent.close();
} else if (cometEvent.getEventType() == CometEvent.EventType.READ) {
log(Read for session:  + request.getSession(true).getId());
BufferedReader reader =
cometEvent.getHttpServletRequest().getReader();
String line = reader.readLine();
if (line != null) {
   
cometEvent.getHttpServletResponse().getWriter().println(servlet
received:  + line);
} else {
cometEvent.close();
}
}
}
}

## end comet servlet ##

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL 

Re: Tomcat and Static file Caching ( 304 headers )

2007-05-22 Thread Johnny Kewl


Yes, you right... defaultServlet definitely supports it... in fact here is 
the section in the code

thats relevent

   long headerValue = request.getDateHeader(If-Modified-Since);
   long lastModified = resourceAttributes.getLastModified();
   if (headerValue != -1) {

   // If an If-None-Match header has been specified, if 
modified since

   // is ignored.
   if ((request.getHeader(If-None-Match) == null)
(lastModified  headerValue + 1000)) {
   // The entity has not been modified since the date
   // specified by the client. This is not an error case.
   response.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
   return false;
   }
   }

So initial impression is right... its looking for a
If-Modified-Since
or a
If-None-Match

from the browser clearly its not there...
Is that default servlet something else... beginning to wonder why I never 
use it ;)... anyway tomcat does it... and the browser is not responding.


Found another article 
http://lists.evolt.org/archive/Week-of-Mon-20060306/180529.html  guy seems 
to have same hassle you have... and in searching
I saw another article where guy has opposite problem with IE... he doesnt 
want it to cache ;)
This article got some tricks you may have to use 
http://betterexplained.com/articles/speed-up-your-javascript-load-time/


Also... if you need a reference browser... get Opera... now thats a browser.

Just a last thought from reading this other stuff... se wot happens if 
you change the file name... and maybe the extension to txt...


Good luck

- Original Message - 
From: [EMAIL PROTECTED] [EMAIL PROTECTED]

To: Tomcat Users List users@tomcat.apache.org
Sent: Tuesday, May 22, 2007 4:57 PM
Subject: Re: Tomcat and Static file Caching ( 304 headers )



Well we are talking about static js files that do not change often.
If was thinking about writing my own filter that created the
correect header fields... But i think it is really a responsibility of the
application server to support client caching for static files..

It looks like tomcat does not do that.. at least not for javasdcript 
files..

Or the firebug firefox util is f*cked up...
I will investigate this case.. because i think Tomcat DOES support
cahcing ( at least if i look at the code of DefaultServlet that handles
the static files in tomcat )..
But strangely enough it does not work for me..


Johnny Kewl schreef:

I just had an after thought... happens often ; )
I think because you using feed type technology the assumption is that is 
wot you really want,
but if this js file never changes... then wot about trying normal caching 
constructs like


please check the actual format...
Cache-control: public, max-age=3600
I think that will cache the js page for one hour alot easier than 
hashing pages and all the other fancy stuff in feeds maybe.


- Original Message - From: Johnny Kewl [EMAIL PROTECTED]
To: Tomcat Users List users@tomcat.apache.org
Sent: Tuesday, May 22, 2007 3:55 PM
Subject: Re: Tomcat and Static file Caching ( 304 headers )


Hi... I dont know much about this, never had a chance to play with it... 
dont even
know how much Tomcat does for you and how much is manual header 
manipulation.
But just from below... there seems to be nothing in the browser response 
telling the server

that it understands feed caching... ie one would expect to see
Last-Modified:  or Etag... so just guessing but I dont think the browser 
understands it..

maybe you should try Last-Modified

I found a fairly decent article maybe will help... 
http://rakaz.nl/item/reducing_the_bandwidth_used_by_feeds


- Original Message - From: [EMAIL PROTECTED] 
[EMAIL PROTECTED]

To: users@tomcat.apache.org
Sent: Tuesday, May 22, 2007 2:17 PM
Subject: Tomcat and Static file Caching ( 304 headers )



I am using Tomcat 5.5 together with Eclipse 3.2.2 for development
of a web application.

But when i use FireBug in Firefox to track network traffic is
see that tomcat never returns a 304 NOT MODIFIED header
if a file is requested twice.

For example when requesting a JavaScript file:
http://localhost:8080/XDataSystem/standard/js/standard.js
you see the following headers:

*Response Headers*
Server Apache-Coyote/1.1
Etag W/10823-1179768573406
Last-Modified Mon, 21 May 2007 17:29:33 GMT
Content-Type text/javascript
Content-Encoding gzip
Vary Accept-Encoding
Date Tue, 22 May 2007 11:52:27 GMT



*Request Headers*
Host localhost:8080
User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.3)
Gecko/20070309 Firefox/2.0.0.3
Accept */*
Accept-Language nl,en-us;q=0.7,en;q=0.3
Accept-Encoding gzip,deflate
Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive 300
Connection keep-alive
Referer http://localhost:8080/XDataSystem/rainbow/home.page



As you can see in the response filter i have turned GZIP 

Re: R: if don't work?!?!?

2007-05-22 Thread David Delbecq
Massimiliano PASQUALONI a écrit :
 public boolean StringToBoolean(String StrBool)
{
   boolean convertito=false;

   if ((StrBool == 1) || (StrBool == On) || (StrBool ==
 on) || (StrBool == Yes) || (StrBool == yes) || (StrBool == Si) ||
 (StrBool == si) || (StrBool == True) || (StrBool == true))
   {
   convertito = true;
   }

   if ((StrBool == 0) || (StrBool == Off) || (StrBool ==
 off) || (StrBool == No) || (StrBool == no) || (StrBool == False)
 || (StrBool == false))
   {
   convertito = false;
   }

   return convertito;
}
   
OMG :)
 If I try 

   if (on.equals(request.getParameter(abilitato))){
   Abilitato = true;
   }


   
Works if parameter abilitato is 'on' (not 'On' or 'checked' or whatever
other browser is using)
 Or 

if (request.getParameter(abilitato).equals(on)){
   Abilitato = true;
   }
   
same as above. Also if checkbox is not checked, most browser don't send
parameter an you will end up with a NullPointerException. Check
parameter is not null before calling equals()
 Or

   if (request.getParameter(abilitato) == on){
   Abilitato = true;
   }
   
Omg² :)
   Referer = request.getHeader(Referer) 
   AltroReferer = request.getHeader(Referer) 

   if (Referer == AltroReferer ){...}

   
As already said, not garanteed to work


I recommend you read this:
http://jamesthornton.com/eckel/TIJ-3rd-edition4.0/TIJ303.htm

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Cannot get SingleonLoader (from jar) to find classes outside JAR

2007-05-22 Thread Mike Peremsky
The class that is trying to load the singleton (SingletonLoader) is in a common 
JAR located at /common/lib/mvpservlet.jar
   
  The Singletons that I am trying to load can be from ANY app and are in the 
WEB-INF/classes folder of whichever application is trying to use the 
SingletonLoader.
  

Filip Hanik - Dev Lists [EMAIL PROTECTED] wrote:
  that work around is probably not what you want. You've just disabled the 
ability to reload your app correctly.
Try using another classloader, maybe the
Thread.currentThread().getContextClassLoader()

where are you storing the class that is trying to load the singleton? it 
should be in your webapp as well.

Filip

Mike Peremsky wrote:
 I have resolved this issue, but am wondering if the way I did it is the 
 correct way to resolve this issue.
 
 I modified the catalina.properties file entry common.loader by adding the 
 path to the applications WEB-INF/classes directory, this seems to have 
 resolved the issue with finding the class.
 
 
 common.loader=${catalina.home}/common/classes,,${catalina.home}/webapps/myExternalApp/WEB-INF/classes
 
 
 
 I also had to fix a bug in the retrieval of the method (I read the API docs 
 incorrectly)
 
 private static final Object OBJECT_ARG_LIST[] = new Object[0];
 private static final Class CLASS_ARG_LIST[] = new Class[0];

 Method method = singletonClassObj.getMethod(GET_INSTANCE_METHOD,
 CLASS_ARG_LIST);
 method.invoke(null, OBJECT_ARG_LIST);

 
 
 Mike Peremsky wrote:
 I tried the modification you suggested (with the correct method name on the 
 end) but still with the same results. I also printed out a debug message just 
 to see what class loader was being used (not that I know what to do with it 
 :-P )

 log.debug(this class loader:  + 
 this.getClass().getClassLoader().getClass().getName());
 Class singletongClassObj = 
 this.getClass().getClassLoader().loadClass(singletonClassName); 

 The class loader for the SingletonLoader is: 
 org.apache.catalina.loader.StandardClassLoader.

 The classes that it is looking for are located in the 

 /apache-tomcat-5.5.23/webapps/myExternalApp/WEB-INF/classes directory.




 Filip Hanik - Dev Lists wrote:
 did you try

 Class singletongClassObj = 
 this.getClass().getClassLoader().loadName(singletonClassName); 

 Filip


 Mike Peremsky wrote:
 
 I think this may be a class loader issue, but am not sure as I have never 
 really worked with them before. I am putting together a JAR file that 
 contains a set of classes to be used throughout a suite of applications. I 
 have a class called SingletonLoader that was working when it was within the 
 main application, but when I broke out the reusable classes into a separate 
 jar file and modified the contextInitialized() method to dynamically load 
 the classes it is failing to fid the classes. The contextInitialized() 
 method is properly reading the class names from the property file (e.g. 
 SINGLETON_LOADER_CLASSES=com.externalApp.singleton.Countries,com.externalApp.singleton.SecurityQuestions)
  and looping through them, but I always get the following error message when 
 the line 

 Class singletongClassObj = Class.forName(singletonClassName); 

 is executed:

 Unable to load singleton: com.externalApp.singleton.Countries
 java.lang.ClassNotFoundException: com.externalApp.singleton.Countries

 ALL of the singleton classes to be loaded implement the Singleton interface 
 (which has nothing in it, it is just used to denote a class that MUST 
 specify a public static anyReturnVal getInstance() method.

 public class SingletonLoader implements ServletContextListener, SystemConsts 
 {
 /**
 * Logger for this class
 */
 private static final Logger log = Logger.getLogger(SingletonLoader.class);
 private static final String SINGLETON_LOADER_CLASSES
 = SINGLETON_LOADER_CLASSES;
 private static final String DELIMITER = ,;
 // This is the method defined
 private static final String GET_INSTANCE_METHOD = getInstance;
 private static final Object ARG_LIST[] = new Object[0];

 /**
 * Constructs a new SingletonLoader object.
 */
 public SingletonLoader() {
 }

 /**
 * Notification that the web application is ready to process requests.
 * 
 * Initializes all of the singletons so they are ready for immediate use
 * after the containet server starts.
 * 
 * @param sce This is the event object for notifications about changes to the
 * servlet context of a web application.
 * 
 */
 public void contextInitialized(ServletContextEvent sce) {

 log.debug(contextInitialized: BEGIN);
 String singletons = ExtProperties.getProperty(SYS_PROPS, 
 SINGLETON_LOADER_CLASSES);

 if (!StringUtils.isNullOrZeroLen(singletons)) {
 DelimitedString ds = new DelimitedString(singletons, DELIMITER);
 int max = ds.size();
 String singletonClassName = null;

 for (int ndx=0; ndx  max; ndx++) {
 try {
 singletonClassName = ds.getEntry(ndx);
 log.debug(Get singletonClassName:  + singletonClassName);
 // Get the singleton class to load
 Class singletongClassObj = 

Re: comet read event

2007-05-22 Thread Filip Hanik - Dev Lists
it could be because the data from the request already came in with the 
request.
when the BEGIN happens, perform the actions as if there was a READ as 
well, ie, empty out the buffer.


Filip

Peter Warren wrote:

The following client code generates a comet BEGIN event on the server
but not a subsequent READ event, as I was expecting.  How come?  Is my
code wrong?  Are my expectations wrong?  See sequence of events
commented in code below.

// client test method that sends messages to server and listens for
responses
public void test() throws IOException {
out.println(test 1);
out.flush();

// server receives client's message, generates a BEGIN event,
and sends response to client

in = new BufferedReader(new
InputStreamReader(urlConn.getInputStream()));
System.out.println(in.readLine());

// client receives server's response and prints it

out.println(test 2);
out.flush();

System.out.println(in.readLine());

// client code blocks here waiting for server response.
// server never generates a READ event.  How come?
// Does the HttpURLConnection (see full code below) need to be
set up differently?
// Am I using the PrintWriter incorrectly when sending to the
comet servlet?

out.close();
urlConn.disconnect();
}

Thanks for any help,
Peter

-- system --

using:
tomcat 6.0.13 on windows xp sp 2
java 1.6.0_01

-- test client  comet servlet source below --

## begin test client ##

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.HttpURLConnection;
import java.net.URL;

public class CometTestClient {

private HttpURLConnection urlConn;

private PrintWriter out;

private BufferedReader in;

public static void main(String[] args) throws Exception {
CometTestClient test = new CometTestClient();
test.test();
}

public CometTestClient() throws IOException {
initConnection();
}

private void initConnection() throws IOException {
URL url = new URL(http://127.0.0.1/CometTest;);
urlConn = (HttpURLConnection) url.openConnection();
urlConn.setDoInput(true);
urlConn.setDoOutput(true);
urlConn.connect();
out = new PrintWriter(urlConn.getOutputStream());
}

public void test() throws IOException {
out.println(test 1);
out.flush();

in = new BufferedReader(new
InputStreamReader(urlConn.getInputStream()));
System.out.println(in.readLine());

out.println(test 2);
out.flush();

System.out.println(in.readLine());

out.close();
urlConn.disconnect();
}
}

## end test client ##

## begin comet servlet ##

import java.io.BufferedReader;
import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;

import org.apache.catalina.CometEvent;
import org.apache.catalina.CometProcessor;

public class CometTestServlet extends HttpServlet implements
CometProcessor {
private static final long serialVersionUID = 5472498184127924791L;

public void event(CometEvent cometEvent) throws IOException,
ServletException {
HttpServletRequest request = cometEvent.getHttpServletRequest();
// don't want timeout events
cometEvent.setTimeout(100);
if (cometEvent.getEventType() == CometEvent.EventType.BEGIN) {
log(Begin for session:  + request.getSession(true).getId());
BufferedReader reader =
cometEvent.getHttpServletRequest().getReader();
String line = reader.readLine();
if (line != null) {
log(servlet received:  + line);
   
cometEvent.getHttpServletResponse().getWriter().println(servlet

received:  + line);
cometEvent.getHttpServletResponse().getWriter().flush();
} else {
cometEvent.close();
}
} else if (cometEvent.getEventType() ==
CometEvent.EventType.ERROR) {
log(Error for session:  + request.getSession(true).getId()
+ ,  + cometEvent.getEventSubType());
cometEvent.close();
} else if (cometEvent.getEventType() == CometEvent.EventType.END) {
log(End for session:  + request.getSession(true).getId());
cometEvent.close();
} else if (cometEvent.getEventType() == CometEvent.EventType.READ) {
log(Read for session:  + request.getSession(true).getId());
BufferedReader reader =
cometEvent.getHttpServletRequest().getReader();
String line = reader.readLine();
if (line != null) {
   
cometEvent.getHttpServletResponse().getWriter().println(servlet

received:  + line);
} else {
cometEvent.close();
}
}
}
}

## end comet servlet 

How to programatically undeploy an application (war)?

2007-05-22 Thread SiSi'mon

When tomcat is starting up I want to undeploy a war if there there is any
exception of any kind thrown in the war.  For example if there is a
hibernate exception, spring exception or an exception I throw, then I want
to not continue and either shut down tomcat (System.exit) or undeploy the
war.

I have noticed that if a MyFaces jsf exception is thrown, it will continue
to deploy the war.  I want to stop at the first failure.

thanks
-- 
View this message in context: 
http://www.nabble.com/How-to-programatically-undeploy-an-application-%28war%29--tf3798261.html#a10744453
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Cannot get SingleonLoader (from jar) to find classes outside JAR

2007-05-22 Thread Filip Hanik - Dev Lists

well there you go, that wont work,
http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html

take a look at the hierarchy of the tomcat class loaders, and a class 
can only load up in the tree, not down.

so mvpservlet is unable to load your web-inf/classes directory

from your description, you got it backwards.
the singleton classes should be in common/lib or common/classes, or if 
you want it clean, shared/lib or shared/classes


then the class loading the singleton, would be in WEB-INF/lib or 
WEB-INF/classes,


not the other way around

Filip


Mike Peremsky wrote:

The class that is trying to load the singleton (SingletonLoader) is in a common 
JAR located at /common/lib/mvpservlet.jar
   
  The Singletons that I am trying to load can be from ANY app and are in the WEB-INF/classes folder of whichever application is trying to use the SingletonLoader.
  


Filip Hanik - Dev Lists [EMAIL PROTECTED] wrote:
  that work around is probably not what you want. You've just disabled the 
ability to reload your app correctly.

Try using another classloader, maybe the
Thread.currentThread().getContextClassLoader()

where are you storing the class that is trying to load the singleton? it 
should be in your webapp as well.


Filip

Mike Peremsky wrote:
  

I have resolved this issue, but am wondering if the way I did it is the 
correct way to resolve this issue.

I modified the catalina.properties file entry common.loader by adding the path 
to the applications WEB-INF/classes directory, this seems to have resolved the 
issue with finding the class.


common.loader=${catalina.home}/common/classes,,${catalina.home}/webapps/myExternalApp/WEB-INF/classes



I also had to fix a bug in the retrieval of the method (I read the API docs 
incorrectly)

private static final Object OBJECT_ARG_LIST[] = new Object[0];
private static final Class CLASS_ARG_LIST[] = new Class[0];

Method method = singletonClassObj.getMethod(GET_INSTANCE_METHOD,
CLASS_ARG_LIST);
method.invoke(null, OBJECT_ARG_LIST);



Mike Peremsky wrote:
I tried the modification you suggested (with the correct method name on the 
end) but still with the same results. I also printed out a debug message just 
to see what class loader was being used (not that I know what to do with it :-P 
)

log.debug(this class loader:  + 
this.getClass().getClassLoader().getClass().getName());
Class singletongClassObj = 
this.getClass().getClassLoader().loadClass(singletonClassName); 


The class loader for the SingletonLoader is: 
org.apache.catalina.loader.StandardClassLoader.

The classes that it is looking for are located in the 


/apache-tomcat-5.5.23/webapps/myExternalApp/WEB-INF/classes directory.




Filip Hanik - Dev Lists wrote:
did you try

Class singletongClassObj = this.getClass().getClassLoader().loadName(singletonClassName); 


Filip


Mike Peremsky wrote:


I think this may be a class loader issue, but am not sure as I have never really worked with them before. I am putting together a JAR file that contains a set of classes to be used throughout a suite of applications. I have a class called SingletonLoader that was working when it was within the main application, but when I broke out the reusable classes into a separate jar file and modified the contextInitialized() method to dynamically load the classes it is failing to fid the classes. The contextInitialized() method is properly reading the class names from the property file (e.g. SINGLETON_LOADER_CLASSES=com.externalApp.singleton.Countries,com.externalApp.singleton.SecurityQuestions) and looping through them, but I always get the following error message when the line 

Class singletongClassObj = Class.forName(singletonClassName); 


is executed:

Unable to load singleton: com.externalApp.singleton.Countries
java.lang.ClassNotFoundException: com.externalApp.singleton.Countries

ALL of the singleton classes to be loaded implement the Singleton interface (which has 
nothing in it, it is just used to denote a class that MUST specify a public static 
anyReturnVal getInstance() method.

public class SingletonLoader implements ServletContextListener, SystemConsts {
/**
* Logger for this class
*/
private static final Logger log = Logger.getLogger(SingletonLoader.class);
private static final String SINGLETON_LOADER_CLASSES
= SINGLETON_LOADER_CLASSES;
private static final String DELIMITER = ,;
// This is the method defined
private static final String GET_INSTANCE_METHOD = getInstance;
private static final Object ARG_LIST[] = new Object[0];

/**
* Constructs a new SingletonLoader object.
*/
public SingletonLoader() {
}

/**
* Notification that the web application is ready to process requests.
* 
* Initializes all of the singletons so they are ready for immediate use

* after the containet server starts.
* 
* @param sce This is the event object for notifications about changes to the

* servlet context of a web application.
* 
*/

public void contextInitialized(ServletContextEvent sce) {


Re: Cannot get SingleonLoader (from jar) to find classes outside JAR

2007-05-22 Thread David Delbecq
THAT is really *not* recommended.

Short answer,

you go the wrong way in your design. And adding your web-inf/classes to
your common classloader will completly break the tomcat behaviour
(presence of same classes at 2 levels, some instances are done at one
level, some other at another level, and you will have codes like
'instanceof' fail even if class names  packages are same, because 2
sides of check use a different classloader)

Long answer,

from tomcat docs, about classloader:

  Bootstrap
  |
   System
  |
   Common
  /  \
 Catalina   Shared
 /   \
Webapp1  Webapp2

(Other servlet engine have probably similar structure, separing server
level from webapp level and isolating webapps)
Webapp2 classloader can load class from webapp2, Shared, Common, System,
Bootstrap. This does not go 2 ways, it's a one way road.

What you are trying to do is, from Common classloader to load a class
inside Webapp2 classloader.
Question, how do you expect you singleton loader in common to be able to
know which webapp to use and locate it's classloader?

1) Mixing common and webapp level is really *not* a recommended design,
i suggest you put your singleton loader inside your webapp's
WEB-INF/classes folder.
2) If it's not possible, your singleton classes themselves should be
also within common/lib so your singleton loader can see them.

3) If (and only if) what you want to do is actually a factory that
reside in common/lib and create instances of object in WEB-INF/lib, and,
more over, if and only if, you do this in a Thread that process a client
request, you can use Thread.currentThread().getContextClassLoader()
because early in the client Http request tomcat set it to classloader of
webapp that will process request.

One important thing to know in this later scenario is that your
singletonloader must *not* keep references to those created instances
(that why i spoke about factory not singleton). This is because keeping
at common level a reference to an object loaded at webapp level will
prevent this webapp's classloader to be garbage collected at redeployed
and with it all static instances, which end quickly to visible memory
leaks (out of permgen)

You scenario, looking at your code, seems to me could be (2),
considering you load singletons during context listener event, and that
you use server wide constant to tell what to load. It's not webapp
specific and as such should not concern webapps.

Last but not least, it seems your aimed architecture it to load a set of
'called at initialization' classes in each webapp you deploy. This is
strange, as deciding we need a specific service at webapp startup,
loaded from classes in webapp, is generally a webapp specific job. It
should be done at webapp level, probably using a ServletContextListener
configured in web.xml.
(http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/ServletContextListener.html)

Mike Peremsky a écrit :
 The class that is trying to load the singleton (SingletonLoader) is in a 
 common JAR located at /common/lib/mvpservlet.jar

   The Singletons that I am trying to load can be from ANY app and are in the 
 WEB-INF/classes folder of whichever application is trying to use the 
 SingletonLoader.
   

 Filip Hanik - Dev Lists [EMAIL PROTECTED] wrote:
   that work around is probably not what you want. You've just disabled the 
 ability to reload your app correctly.
 Try using another classloader, maybe the
 Thread.currentThread().getContextClassLoader()

 where are you storing the class that is trying to load the singleton? it 
 should be in your webapp as well.

 Filip

 Mike Peremsky wrote:
   
 I have resolved this issue, but am wondering if the way I did it is the 
 correct way to resolve this issue.

 I modified the catalina.properties file entry common.loader by adding the 
 path to the applications WEB-INF/classes directory, this seems to have 
 resolved the issue with finding the class.


 common.loader=${catalina.home}/common/classes,,${catalina.home}/webapps/myExternalApp/WEB-INF/classes



 I also had to fix a bug in the retrieval of the method (I read the API docs 
 incorrectly)

 private static final Object OBJECT_ARG_LIST[] = new Object[0];
 private static final Class CLASS_ARG_LIST[] = new Class[0];

 Method method = singletonClassObj.getMethod(GET_INSTANCE_METHOD,
 CLASS_ARG_LIST);
 method.invoke(null, OBJECT_ARG_LIST);



 Mike Peremsky wrote:
 I tried the modification you suggested (with the correct method name on the 
 end) but still with the same results. I also printed out a debug message 
 just to see what class loader was being used (not that I know what to do 
 with it :-P )

 log.debug(this class loader:  + 
 this.getClass().getClassLoader().getClass().getName());
 Class singletongClassObj = 
 this.getClass().getClassLoader().loadClass(singletonClassName); 

 The class loader for the SingletonLoader is: 
 org.apache.catalina.loader.StandardClassLoader.

 The classes 

Re: FindClass - Bootstrap failing

2007-05-22 Thread Hassan Schroeder

On 5/22/07, John Cabral [EMAIL PROTECTED] wrote:


apache-tomcat-6.0.13 Windows installer.



I'm running on Windows XP Professional, version 2002.  The java
version is 1.4.2_14.


TC6 requires Java 5 -- http://tomcat.apache.org/migration.html

HTH,
--
Hassan Schroeder  [EMAIL PROTECTED]

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: R: if don't work?!?!?

2007-05-22 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Massimiliano,

Massimiliano PASQUALONI wrote:

String Paula = Brilliant;

You can replace all the code below with this gem:

boolean myBoolean = Boolean.valueOf(yourString).booleanValue();

Don't try to re-invent the wheel. Most of the things like this have
already been done by someone else, and probably better. So, learn from
and take advantage of the work others have done before you.

 public boolean StringToBoolean(String StrBool)
{
   boolean convertito=false;
 
   if ((StrBool == 1) || (StrBool == On) || (StrBool ==
 on) || (StrBool == Yes) || (StrBool == yes) || (StrBool == Si) ||
 (StrBool == si) || (StrBool == True) || (StrBool == true))
   {
   convertito = true;
   }
 
   if ((StrBool == 0) || (StrBool == Off) || (StrBool ==
 off) || (StrBool == No) || (StrBool == no) || (StrBool == False)
 || (StrBool == false))
   {
   convertito = false;
   }
 
   return convertito;
}

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGUzgE9CaO5/Lv0PARAlJJAJ9XdavG7OXesi3bTaqMVdrJe3nUqwCgwuNU
2K2hHPrMKDH8NLAHvKcR8ek=
=fK6t
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: if don't work?!?!?

2007-05-22 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Bryce,

Bryce Burgess (bburgess) wrote:
 Would this work for you?
 ( http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html#toLowerCase() 
 )

String.equalsIgnoreCase is much better.

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGUzhA9CaO5/Lv0PARAov3AJwJ1Pb0vyNKuBhdcKiobNLWfTntZwCgumW8
7HZczna2SiSQ1sGZ3d2ZtRs=
=08+U
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: [OT] if don't work?!?!?

2007-05-22 Thread Caldarale, Charles R
 From: Christopher Schultz [mailto:[EMAIL PROTECTED] 
 Subject: Re: [OT] if don't work?!?!?
 
 String Pippo = on;
 
 if(Pippo == on)
System.err.println(Pippo is on, man!);

Again, that's not what the OP coded; Pippo was retrieved from the
request, not set to a constant.  Changing the context of the if
statement can certainly changes the result.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Session IDs XMLHttpRequests

2007-05-22 Thread Williams, Allen
Yeah, I'm already sending some stuff over by URL anyway, but there seems
to be some concern floating around the net regarding session hijacking
if the session ID is readily available.  However, although I wouldn't
pretend to be an expert.

Anyway, I took Christopher's advice, and deleted all the cookies, even
restarted my browser (it's been running for several days), and did some
testing.  I now have two (2!) JSESSIONID's in my browser, as well as
userid and password cookies, but on the server side, it says no cookies
were sent.

And, I finally found the Headers section under Net in Firebug.  As
near as I can decipher this, all my requests are sending a JSESSIONID
cookie *except* the one for the XMLHttpRequest.  The first time running
after deleting all the cookies, that request doesn't have any cookies.
Because a session gets created, from that point forward it has the
session it created with it sent back in the request header, but, of
course, that session doesn't have any of the attributes stored in it.
Looking at these cookies with the WebDeveloper tools in Firefox, the
difference is that the new one created during the XMLHttpRequest is
associated with a / path, the other one (the real one) with
/myAppName path.

Is is possible the difference in these path associations has something
to do with not finding the session?  I do use a different URL mapping
for this servlet because of a CheckUser problem I had way back that
started this whole chain.

Next step is to download Frank's http://www.omnytex.com/test.zip and get
that to work (also, I see what you mean by Headers under Firebug
Console, now, too- it is also repeated under Firebug Net).

 -Original Message-
 From: Christopher Schultz [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, May 22, 2007 10:04 AM
 To: Tomcat Users List
 Subject: Re: Session IDs  XMLHttpRequests
 
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Allen,
 
 Williams, Allen wrote:
  Will it work with POST as well as GET?  Although I guess 
 I'll soon find
  out;-)
 
 It should work equally well with GET and POST. The browser should send
 cookies with every type of request (not just GET and POST).
 
 I strongly encourage you to make arrangements for non-cookie-using
 people. When you emit the HTML (and javascript) to make your
 XMLHttpRequest, try making the URL dynamic and running it through
 HttpServletResponse.encodeURL to add the jsessionid to the 
 URL if necessary.
 
 This will make your application a little more friendly to those who
 either don't have cookies available (usually an IT policy in an office
 or something) or who choose to turn them off. I find this to be
 courteous to your users.
 
 Just my .02.
 
 - -chris
 
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.7 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
 
 iD8DBQFGUvhK9CaO5/Lv0PARAtq0AKCfANKRxmb3ljBRiDLsb6gghTZHBgCcCdxW
 tUbl8cpKi44F53BrbHBmRjA=
 =zz//
 -END PGP SIGNATURE-
 
 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Tomcat 6 run really slow with ssl

2007-05-22 Thread Hoa Doan
For some reason my page are loading really slow when SSL is enabled.  But this 
only happens on pages that are outputting a lot of records from the SQL 
database.

I am using org.apache.coyote.ajp.AjpAprProtocol for the ssl connection.

   
-
Boardwalk for $500? In 2007? Ha! 
Play Monopoly Here and Now (it's updated for today's economy) at Yahoo! Games.

TomCat, Reverse Proxy Business Objects...

2007-05-22 Thread Gareth Eason
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


   Hi,

I'm trying to get Business Objects working behind an Apache reverse
proxy server. The apache server takes care of converting to and from
HTTP -- HTTPS and provides a nice consistent URL for our clients.

From the outside world, https://www.url.com/customername/bo/foo is
mapped to http://appserver.vip.internal:port/bo/foo - which is all well
and good, except that TomCat on the appserver appears to generate its
own URLs which is passes out to the client instead of allowing the
reverse proxy layer to rewrite them.

I'm using proxyPort=443 and proxyName=www.url.com in two connector
port directives, which does rewrite the hostname correctly - but I
cannot seem to get it to add the customername part.

Is there another proxy* directive I'm missing? Adding
proxyName=www.url.com/customername doesn't appear to have an effect.

Currently, the first hit on the reverse proxy rewrites the URL
correctly and hits the TomCat server, but this sends back a response
which triggers a request to the reverse proxy written (incorrectly) as
https://www.url.com/bo/foo - which fails. (Notice that the customername
is missing.)

Any help or pointers in the right direction (or at the piece of
documentation that I've failed to grok) would be greatly appreciated.

Thanks in advance.

Best regards,
--Gar

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

iD8DBQFGU0BRK36C50PvIR8RArAJAJ9NkfE4rgQpzNEpr4mZKAw5UzCSCgCZAdiO
0qqaPxhtnalORTA8OQZrtQI=
=wlEN
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to programatically undeploy an application (war)?

2007-05-22 Thread Johnny Kewl

Interesting question
Dont think you can tell Tomcat to throw it out... but here are some 
idea's...
+ Have a look at this embedding article... maybe that deployer will show all 
exceptions and you can filter them (I dont know) then before tomcat 
is started you could let them run an integrity test (embedded tomcat in same 
location) ... maybe, these are just idea's.

http://www.onjava.com/pub/a/onjava/2002/04/03/tomcat.html

+ If you have a main servlet... or JSP... architecture depending... do your 
own forname(class) checks on the required classes... if you dont find 
them... get the real path and delete the web-app... or rename it to 
screwed or better still redirect all requests to SOS.html..or just 
delete the web.xml file..or use System.Exec to call the stop script file..
I like this kinda idea... can have one integrity servlet that does nothing 
but check the app on startup... remember to start the integrity servlet on 
startup.


Good luck... tell us how u made your I'm outa here because I'm broken- 
WebApp in the end... good stuff.




- Original Message - 
From: SiSi'mon [EMAIL PROTECTED]

To: users@tomcat.apache.org
Sent: Tuesday, May 22, 2007 8:11 PM
Subject: How to programatically undeploy an application (war)?




When tomcat is starting up I want to undeploy a war if there there is any
exception of any kind thrown in the war.  For example if there is a
hibernate exception, spring exception or an exception I throw, then I want
to not continue and either shut down tomcat (System.exit) or undeploy the
war.

I have noticed that if a MyFaces jsf exception is thrown, it will continue
to deploy the war.  I want to stop at the first failure.

thanks
--
View this message in context: 
http://www.nabble.com/How-to-programatically-undeploy-an-application-%28war%29--tf3798261.html#a10744453

Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Session IDs XMLHttpRequests

2007-05-22 Thread Williams, Allen
OK, I have FOUND the problem, and for the continued edification of the
community will share my results, as well as ask one more question that
hopefully some of you gurus can answer.

Yes, it had to do with the path.  When I went back and associated this
servlet with a valid path used path but still without the CheckUser
involved, updating through my mod_jk.conf, my web.xml for the mappings,
and, of course, the script itself, it picked up the right session id and
the world is good.

Now, for the question: how is this ancillary information stored?  When I
look at the cookie in Firebug or print it out in the servlet, all I see
is JSESSIONID=blah, blah, blah, but when I look at it in Web
Developer, I see the path associated with it, the expiration date, and
other info.  Where is that stored, and can it be accessed (like the
path, for instance) in a servlet or script?

THANKS FOR ALL THE HELP!!!

Thanks, and Regards,

 
 Yeah, I'm already sending some stuff over by URL anyway, but 
 there seems
 to be some concern floating around the net regarding session hijacking
 if the session ID is readily available.  However, although I wouldn't
 pretend to be an expert.
 
 Anyway, I took Christopher's advice, and deleted all the cookies, even
 restarted my browser (it's been running for several days), 
 and did some
 testing.  I now have two (2!) JSESSIONID's in my browser, as well as
 userid and password cookies, but on the server side, it says 
 no cookies
 were sent.
 
 And, I finally found the Headers section under Net in Firebug.  As
 near as I can decipher this, all my requests are sending a JSESSIONID
 cookie *except* the one for the XMLHttpRequest.  The first 
 time running
 after deleting all the cookies, that request doesn't have any cookies.
 Because a session gets created, from that point forward it has the
 session it created with it sent back in the request header, but, of
 course, that session doesn't have any of the attributes stored in it.
 Looking at these cookies with the WebDeveloper tools in Firefox, the
 difference is that the new one created during the XMLHttpRequest is
 associated with a / path, the other one (the real one) with
 /myAppName path.
 
 Is is possible the difference in these path associations has something
 to do with not finding the session?  I do use a different URL mapping
 for this servlet because of a CheckUser problem I had way back that
 started this whole chain.
 
 Next step is to download Frank's 
 http://www.omnytex.com/test.zip and get
 that to work (also, I see what you mean by Headers under Firebug
 Console, now, too- it is also repeated under Firebug Net).
 
  -Original Message-
  From: Christopher Schultz [mailto:[EMAIL PROTECTED] 
  Sent: Tuesday, May 22, 2007 10:04 AM
  To: Tomcat Users List
  Subject: Re: Session IDs  XMLHttpRequests
  
  -BEGIN PGP SIGNED MESSAGE-
  Hash: SHA1
  
  Allen,
  
  Williams, Allen wrote:
   Will it work with POST as well as GET?  Although I guess 
  I'll soon find
   out;-)
  
  It should work equally well with GET and POST. The browser 
 should send
  cookies with every type of request (not just GET and POST).
  
  I strongly encourage you to make arrangements for non-cookie-using
  people. When you emit the HTML (and javascript) to make your
  XMLHttpRequest, try making the URL dynamic and running it through
  HttpServletResponse.encodeURL to add the jsessionid to the 
  URL if necessary.
  
  This will make your application a little more friendly to those who
  either don't have cookies available (usually an IT policy 
 in an office
  or something) or who choose to turn them off. I find this to be
  courteous to your users.
  
  Just my .02.
  
  - -chris
  
  -BEGIN PGP SIGNATURE-
  Version: GnuPG v1.4.7 (MingW32)
  Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
  
  iD8DBQFGUvhK9CaO5/Lv0PARAtq0AKCfANKRxmb3ljBRiDLsb6gghTZHBgCcCdxW
  tUbl8cpKi44F53BrbHBmRjA=
  =zz//
  -END PGP SIGNATURE-
  
  
 -
  To start a new topic, e-mail: users@tomcat.apache.org
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 
 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: TomCat, Reverse Proxy Business Objects...

2007-05-22 Thread Filip Hanik - Dev Lists
proxyName is only for the Host name, which can also be accomplished by 
adding

ProxyPreserveHost On

in apache, and hence be able to support more than just one URL. So 
remove proxyName from the connector and added the above statement to 
your httpd config


in terms of what you are doing, that's a bit more tricky.
since you are doing URL rewriting, there is no way for Tomcat to know 
that it needs to prepend /customername/ to the URLs.


do you have ProxyPassReverse in your httpd config? that should take care 
of Response headers, as for HTML itself,
you need to probably create a valve or filter that adds the customer 
name into the HttpServletRequest methods through a wrapper


Filip

Gareth Eason wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


   Hi,

I'm trying to get Business Objects working behind an Apache reverse
proxy server. The apache server takes care of converting to and from
HTTP -- HTTPS and provides a nice consistent URL for our clients.

From the outside world, https://www.url.com/customername/bo/foo is
mapped to http://appserver.vip.internal:port/bo/foo - which is all well
and good, except that TomCat on the appserver appears to generate its
own URLs which is passes out to the client instead of allowing the
reverse proxy layer to rewrite them.

I'm using proxyPort=443 and proxyName=www.url.com in two connector
port directives, which does rewrite the hostname correctly - but I
cannot seem to get it to add the customername part.

Is there another proxy* directive I'm missing? Adding
proxyName=www.url.com/customername doesn't appear to have an effect.

Currently, the first hit on the reverse proxy rewrites the URL
correctly and hits the TomCat server, but this sends back a response
which triggers a request to the reverse proxy written (incorrectly) as
https://www.url.com/bo/foo - which fails. (Notice that the customername
is missing.)

Any help or pointers in the right direction (or at the piece of
documentation that I've failed to grok) would be greatly appreciated.

Thanks in advance.

Best regards,
--Gar

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

iD8DBQFGU0BRK36C50PvIR8RArAJAJ9NkfE4rgQpzNEpr4mZKAw5UzCSCgCZAdiO
0qqaPxhtnalORTA8OQZrtQI=
=wlEN
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



  



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



comet read event

2007-05-22 Thread Peter Warren
My BEGIN block in my comet servlet now looks like the code below (added
a while loop to read until the buffer is empty).  Is that what you had
in mind?  The buffer in the BEGIN event only contains the client's first
message.  Am I not emptying the buffer correctly?  Although, I wouldn't
expect the buffer to contain the client's second message since the
client blocks for an ack from the server before sending its second
message.  Any other thoughts on what happens to the client's second
message and why no READ event is generated?

Thanks for your help,
Peter

if (cometEvent.getEventType() == CometEvent.EventType.BEGIN) {
log(Begin for session:  + request.getSession(true).getId());
BufferedReader reader =
cometEvent.getHttpServletRequest().getReader();
String line = null;
while ((line = reader.readLine()) != null) {
log(servlet received:  + line);
   
cometEvent.getHttpServletResponse().getWriter().println(servlet
received:  + line);
cometEvent.getHttpServletResponse().getWriter().flush();
}
}

 Filip Hanik wrote:

 it could be because the data from the request already came in with the
request.
 when the BEGIN happens, perform the actions as if there was a READ as
well, ie, empty out the buffer.

 Filip

Peter Warren wrote:
 The following client code generates a comet BEGIN event on the server
 but not a subsequent READ event, as I was expecting.  How come?  Is my
 code wrong?  Are my expectations wrong?  See sequence of events
 commented in code below.

 // client test method that sends messages to server and listens for
 responses
 public void test() throws IOException {
 out.println(test 1);
 out.flush();

 // server receives client's message, generates a BEGIN event,
 and sends response to client

 in = new BufferedReader(new
 InputStreamReader(urlConn.getInputStream()));
 System.out.println(in.readLine());

 // client receives server's response and prints it

 out.println(test 2);
 out.flush();

 System.out.println(in.readLine());

 // client code blocks here waiting for server response.
 // server never generates a READ event.  How come?
 // Does the HttpURLConnection (see full code below) need to be
 set up differently?
 // Am I using the PrintWriter incorrectly when sending to the
 comet servlet?

 out.close();
 urlConn.disconnect();
 }

 Thanks for any help,
 Peter

 -- system --

 using:
 tomcat 6.0.13 on windows xp sp 2
 java 1.6.0_01

 -- test client  comet servlet source below --

 ## begin test client ##

 import java.io.BufferedReader;
 import java.io.IOException;
 import java.io.InputStreamReader;
 import java.io.PrintWriter;
 import java.net.HttpURLConnection;
 import java.net.URL;

 public class CometTestClient {

 private HttpURLConnection urlConn;

 private PrintWriter out;

 private BufferedReader in;

 public static void main(String[] args) throws Exception {
 CometTestClient test = new CometTestClient();
 test.test();
 }

 public CometTestClient() throws IOException {
 initConnection();
 }

 private void initConnection() throws IOException {
 URL url = new URL(http://127.0.0.1/CometTest;);
 urlConn = (HttpURLConnection) url.openConnection();
 urlConn.setDoInput(true);
 urlConn.setDoOutput(true);
 urlConn.connect();
 out = new PrintWriter(urlConn.getOutputStream());
 }

 public void test() throws IOException {
 out.println(test 1);
 out.flush();

 in = new BufferedReader(new
 InputStreamReader(urlConn.getInputStream()));
 System.out.println(in.readLine());

 out.println(test 2);
 out.flush();

 System.out.println(in.readLine());

 out.close();
 urlConn.disconnect();
 }
 }

 ## end test client ##

 ## begin comet servlet ##

 import java.io.BufferedReader;
 import java.io.IOException;

 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;

 import org.apache.catalina.CometEvent;
 import org.apache.catalina.CometProcessor;

 public class CometTestServlet extends HttpServlet implements
 CometProcessor {
 private static final long serialVersionUID = 5472498184127924791L;

 public void event(CometEvent cometEvent) throws IOException,
 ServletException {
 HttpServletRequest request = cometEvent.getHttpServletRequest();
 // don't want timeout events
 cometEvent.setTimeout(100);
 if (cometEvent.getEventType() == CometEvent.EventType.BEGIN) {
 log(Begin for session:  +
 request.getSession(true).getId());
 BufferedReader reader =
 cometEvent.getHttpServletRequest().getReader();
 String line = reader.readLine();

Re: Session IDs XMLHttpRequests [SOLVED]

2007-05-22 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Allen,

Just adding [SOLVED] to the subject for the benefit of those searching
the archives.

To recap, the cookie path was wrong.

- -chris

Williams, Allen wrote:
 OK, I have FOUND the problem, and for the continued edification of the
 community will share my results, as well as ask one more question that
 hopefully some of you gurus can answer.
 
 Yes, it had to do with the path.  When I went back and associated this
 servlet with a valid path used path but still without the CheckUser
 involved, updating through my mod_jk.conf, my web.xml for the mappings,
 and, of course, the script itself, it picked up the right session id and
 the world is good.
 
 Now, for the question: how is this ancillary information stored?  When I
 look at the cookie in Firebug or print it out in the servlet, all I see
 is JSESSIONID=blah, blah, blah, but when I look at it in Web
 Developer, I see the path associated with it, the expiration date, and
 other info.  Where is that stored, and can it be accessed (like the
 path, for instance) in a servlet or script?
 
 THANKS FOR ALL THE HELP!!!
 
 Thanks, and Regards,
 
  
 Yeah, I'm already sending some stuff over by URL anyway, but 
 there seems
 to be some concern floating around the net regarding session hijacking
 if the session ID is readily available.  However, although I wouldn't
 pretend to be an expert.

 Anyway, I took Christopher's advice, and deleted all the cookies, even
 restarted my browser (it's been running for several days), 
 and did some
 testing.  I now have two (2!) JSESSIONID's in my browser, as well as
 userid and password cookies, but on the server side, it says 
 no cookies
 were sent.

 And, I finally found the Headers section under Net in Firebug.  As
 near as I can decipher this, all my requests are sending a JSESSIONID
 cookie *except* the one for the XMLHttpRequest.  The first 
 time running
 after deleting all the cookies, that request doesn't have any cookies.
 Because a session gets created, from that point forward it has the
 session it created with it sent back in the request header, but, of
 course, that session doesn't have any of the attributes stored in it.
 Looking at these cookies with the WebDeveloper tools in Firefox, the
 difference is that the new one created during the XMLHttpRequest is
 associated with a / path, the other one (the real one) with
 /myAppName path.

 Is is possible the difference in these path associations has something
 to do with not finding the session?  I do use a different URL mapping
 for this servlet because of a CheckUser problem I had way back that
 started this whole chain.

 Next step is to download Frank's 
 http://www.omnytex.com/test.zip and get
 that to work (also, I see what you mean by Headers under Firebug
 Console, now, too- it is also repeated under Firebug Net).

 -Original Message-
 From: Christopher Schultz [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, May 22, 2007 10:04 AM
 To: Tomcat Users List
 Subject: Re: Session IDs  XMLHttpRequests

 Allen,
 
 Williams, Allen wrote:
 Will it work with POST as well as GET?  Although I guess 
 I'll soon find
 out;-)
 It should work equally well with GET and POST. The browser 
 should send
 cookies with every type of request (not just GET and POST).
 
 I strongly encourage you to make arrangements for non-cookie-using
 people. When you emit the HTML (and javascript) to make your
 XMLHttpRequest, try making the URL dynamic and running it through
 HttpServletResponse.encodeURL to add the jsessionid to the 
 URL if necessary.
 
 This will make your application a little more friendly to those who
 either don't have cookies available (usually an IT policy 
 in an office
 or something) or who choose to turn them off. I find this to be
 courteous to your users.
 
 Just my .02.
 
 -chris
 


 -
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGU06d9CaO5/Lv0PARAgi+AKCfDp8K++T0kt22RgMwCFJRfFZ3sQCeNSXr
GNnlB07KIACj4T7kF8ep6KY=
=kwdF
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: 

Re: R: if don't work?!?!?

2007-05-22 Thread David Delbecq
Nope, this only works if the string is a variant of True, not on the 1,
yes, si cases :)
Also, only value supposed to be sent by browser is the value=
field of input checkbox. And html 4 specs states that for checkboxes and
radio boxes this value *must* be present in html :)


Yeah, i too thought to post this request on sidebar. Long time not seen
a Paula related stuff. Did you code a Calculator recently? :D

Christopher Schultz a écrit :
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Massimiliano,

 Massimiliano PASQUALONI wrote:

 String Paula = Brilliant;

 You can replace all the code below with this gem:

 boolean myBoolean = Boolean.valueOf(yourString).booleanValue();

 Don't try to re-invent the wheel. Most of the things like this have
 already been done by someone else, and probably better. So, learn from
 and take advantage of the work others have done before you.

   
 public boolean StringToBoolean(String StrBool)
   {
  boolean convertito=false;

  if ((StrBool == 1) || (StrBool == On) || (StrBool ==
 on) || (StrBool == Yes) || (StrBool == yes) || (StrBool == Si) ||
 (StrBool == si) || (StrBool == True) || (StrBool == true))
  {
  convertito = true;
  }

  if ((StrBool == 0) || (StrBool == Off) || (StrBool ==
 off) || (StrBool ==No) || (StrBool == no) || (StrBool == 
 False)
 || (StrBool == false))
  {
  convertito = false;
  }

  return convertito;
   }
 

 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.7 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

 iD8DBQFGUzgE9CaO5/Lv0PARAlJJAJ9XdavG7OXesi3bTaqMVdrJe3nUqwCgwuNU
 2K2hHPrMKDH8NLAHvKcR8ek=
 =fK6t
 -END PGP SIGNATURE-

 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]

   

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



servlet url-pattern and subdirectories problem

2007-05-22 Thread dhay
Hi,

We're using Spring-MVC and we're trying to set up 2 apps in a single web 
app...

Our main app is under .../mainapp url, and then we have another series of 
pages that can be accessed via ./mainapp/subapp.  The subapp files are 
found in a subapp subdirectory in the mainapp webapp.  However, I'm 
having a problem setting up the url-patterns for it - it seems like I 
can't route some pages in the subapp through a servlet (Spring-MVC's 
Dispatcher servlet) and access other static pages directly?

My web.xml snippet is as follows:

servlet
servlet-namemainapp/servlet-name
 
servlet-classorg.springframework.web.servlet.DispatcherServlet/servlet-class
load-on-startup3/load-on-startup
init-param
  param-namecontextConfigLocation/param-name
  param-value
/WEB-INF/mainapp-servlet.xml,
/WEB-INF/subapp-servlet.xml
  /param-value
/init-param 
/servlet
 
servlet-mapping
   servlet-namemainapp/servlet-name
   url-pattern*.do/url-pattern
/servlet-mapping

servlet-mapping
   servlet-namemainapp/servlet-name
   url-pattern/subapp/*/url-pattern
/servlet-mapping
 
This allows me to route ./mainapp/subapp/myaction.do correctly, but I 
can't access ./mainapp/subapp/images/xyz.gif.  What I'd really like to do 
is have the last url-pattern to be /subapp/*.do - but I understand the 
spec won't allow this? 

Anyone have any idea how I can make this work?

cheers,



Re: Session IDs XMLHttpRequests

2007-05-22 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Allen,

Williams, Allen wrote:
 Now, for the question: how is this ancillary information stored?

The cookie contains all this information. When the cookie is transmitted
to the browser, it contains all this information. Check it using an HTTP
sniffer or your browser (Mozilla Firefox shows it all to you).

When the cookie is sent back to the server in a request, this extra
information is not included. For instance, the header sent to the server
is simply:

cookie: JSESSIONID=F53BFD60D943838CFA50EFDBCA27E825

 When I look at the cookie in Firebug or print it out in the servlet,
 all I see is JSESSIONID=blah, blah, blah

That is the content of the cookie. After the cookie is originally sent
to the browser, the server doesn't know the details of the path, etc...
that's the browser's problem.

 but when I look at it in Web Developer, I see the path associated
 with it, the expiration date, and other info.

Firebug must just be showing you selected pieces of information. Web
developer is showing you the browser's view of the world, which includes
the extra metadata.

 Where is that stored, and can it be accessed (like the path, for
 instance) in a servlet or script?

A script might be able to access it (because javascript runs on the
client) but the server can only capture that information during the
response that first created the cookie. In that case, you can use the
Cookie objects in the response to sniff those values.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGU2Gm9CaO5/Lv0PARAqocAJwKQs1sVd9DdoHEHQ5cDTVEGkH43wCeOLEk
dl5V9vazyYh+2Ucsaoy4zDk=
=jQwS
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: servlet url-pattern and subdirectories problem

2007-05-22 Thread Georg Sauer-Limbach

[EMAIL PROTECTED] wrote:

servlet-mapping
   servlet-namemainapp/servlet-name
   url-pattern*.do/url-pattern
/servlet-mapping

servlet-mapping
   servlet-namemainapp/servlet-name
   url-pattern/subapp/*/url-pattern
/servlet-mapping
 
This allows me to route ./mainapp/subapp/myaction.do correctly, but I 
can't access ./mainapp/subapp/images/xyz.gif.  What I'd really like to do

 is have the last url-pattern to be /subapp/*.do - but I understand the
 spec won't allow this?

 Anyone have any idea how I can make this work?

Use one more mapping which maps the subapp path:

 servlet-mapping
servlet-namesubapp-images-servlet/servlet-name
url-pattern/subapp/images/url-pattern
 /servlet-mapping

The longest matching path wins. Only if no path matches are
the extension mappings taken into account:

...
url-pattern*.ext/url-pattern

See chapter 11 of the Servlet Spec.

Georg

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Session IDs XMLHttpRequests

2007-05-22 Thread Pid

Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Allen,


...

Firebug must just be showing you selected pieces of information. Web
developer is showing you the browser's view of the world, which includes
the extra metadata.


Update your copy of Firebug if it's not clearly showing the contents of 
the cookie in the headers - my (most recent) version clearly indicates 
in the expected ';' separated, human readable format what the content, 
path and expiry date of the cookie is.



p


smime.p7s
Description: S/MIME Cryptographic Signature


How to force tomcat to not write or load .ser files?

2007-05-22 Thread SiSi'mon

Is there a configuration somewhere that I can set to force tomcat to not
write or read .ser files (under work/).

thanks

Si'mon
-- 
View this message in context: 
http://www.nabble.com/How-to-force-tomcat-to-not-write-or-load-.ser-files--tf3801114.html#a10754663
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Tomcat admin,Manager app setup

2007-05-22 Thread Raja

Hi ,

We are trying to setup multiple instanace of tomcat running on the same
server. we can able to do it successfully.
We need to  run the Manager,Admin applications also on  each instance.

Version Details : Tomcat 6.0.10
JDK Version :  1.5.09

1 .From the docs, i understand that, by default there is no ADMIN
application enabled in the tomcat. So anyone in the group guide me setup
this application and let me know where can i download the application as
well.

2. I have copied Manager application to the individual instacne of the
tomcat webapps folder. But i am getting 404 error while accessing that
applcation.

Your help on this will be really helpful to us. Thanks in advance.


With Regards,

Alagar Raja R


Re: Tomcat admin,Manager app setup

2007-05-22 Thread Rashmi Rubdi

On 5/22/07, Raja [EMAIL PROTECTED] wrote:

 Hi ,

We are trying to setup multiple instanace of tomcat running on the same
server. we can able to do it successfully.
We need to  run the Manager,Admin applications also on  each instance.

Version Details : Tomcat 6.0.10
JDK Version :  1.5.09

1 .From the docs, i understand that, by default there is no ADMIN
application enabled in the tomcat. So anyone in the group guide me setup
this application and let me know where can i download the application as
well.


There doesn't seem to be a download link for the Admin App for Tomcat
6.0.x at http://tomcat.apache.org/download-60.cgi

However, there is one for Tomcat 5.5.x here:
http://tomcat.apache.org/download-55.cgi#5.5.23

I haven't tried the 5.5.x Admin app on Tomcat 6.0.x , but it probably
(just a guess) might be compatible.


2. I have copied Manager application to the individual instacne of the
tomcat webapps folder. But i am getting 404 error while accessing that
applcation.


What link did you use to access the Manager app?

With the default install and default config of Tomcat 6.0.x , I'm able
to access the manager app at: http://localhost:8080/manager/html  ,
after defining a user and a role for that user in tomcat-users.xml

Look for tomcat-users.xml under apache-tomcat-6.0.x\conf\ folder and
add something like:

?xml version='1.0' encoding='utf-8'?
tomcat-users
 role rolename=manager/
 role rolename=admin/
 user username=somuser password=secret roles=admin,manager/
/tomcat-users


Your help on this will be really helpful to us. Thanks in advance.


With Regards,

Alagar Raja R



-Regards
Rashmi

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to force tomcat to not write or load .ser files?

2007-05-22 Thread Len Popp

Set an empty pathname in the Manager in the Context. (I haven't
tried this, but it's documented for 5.5 and 6.0.)
--
Len

On 5/22/07, SiSi'mon [EMAIL PROTECTED] wrote:


Is there a configuration somewhere that I can set to force tomcat to not
write or read .ser files (under work/).

thanks

Si'mon
--
View this message in context: 
http://www.nabble.com/How-to-force-tomcat-to-not-write-or-load-.ser-files--tf3801114.html#a10754663
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: BootStrap - Is in redundant?

2007-05-22 Thread Bill Barker

Johnny Kewl [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
Please bear with me while I study and learn Tomcats src code...

My environment is a little different to the ant build, in that I am running 
the source directly from the netbeans IDE. It works by the way and once 
I've figured it all out, I'll post the project to a site so others can do 
it too. The biggest difference is that tomcat becomes one jar file... with 
just a few associated lib files like ant.jar

The other thing is that the mode of operation I'm working with, is not the 
typical embedded environment... its still XML config environment, with 
conf and webapps in the same folder as the jar file  it seems to work 
perfectly.

OK... questions... lots of em... guessing is allowed ;)

=BOOTSTRAP=
Bootstrap seems to classload files in the SERVER folder (old tomcat 5.5 
style) and then it calls into Catalina which does the digest XML stuff 
and this in turn calls into Embedded.  Other than for legacy support, does 
this mean Bootstrap is redundant?  If I bypass Bootstrap and call (start) 
directly into Catalina... it seems to work perfectly... but I'm just 
wondering if theres a surprize somewhere if one bypasses that server class 
loader.


The main point of Bootstrap is to minimize what is on the System classpath 
(which caused no end of problems in TC 3.2.x).  It also allows you to 
configure your classloaders in 5.5 style if you want.  If all of the TC jars 
are in the System classpath, it doesn't matter if you use it or not.

=Start Stop Mechanism=
I see that START goes into a wait loop... and it will pop out of this when 
STOP is called.  I understand how this works from a single program 
(process), but I cant understand how this works from start and stop bat 
files... or in two calls from 2 separate processes. To me that will launch 
an instance and start it... and launch a separate instance and stop it... 
never shall the 2 meet??? How does that work?


Already answered, but yes, it is via a socket connection (at least for the 
script launching).  Lauching via jsvc does this differently (directly 
calling the stop method on the running TC).

=EJB and Annotations=
I see stuff like javax.ejb and javax.annotation in the source what is 
that stuff for?


This is for Annotation and Resource Injection (@see section 14.5 of the 2.5 
Servlet spec), and is the main reason that TC 6.x requires Java 5.

=org.apache.tomcat.util.net.puretls seems broken=
To make this thing work... one ends up with external libs... like cryptix, 
puretls... its a mission!  Can I remove this... is it experimental??


You can remove it.  If the PureTLS jars aren't arround when you compile, TC 
quitely removes it from the build.  It is an alternative to JSSE for people 
that want it, but if the PureTLS jars aren't there, it just sits quitely in 
it jar.

=org.eclipse.jdt.core_3.2.3.v_686_R32x.jar=
Why?  Is this for compiling? What does Tomcat compile at runtime? Why is 
this lib needed?


This is used for compiling JSP pages to classes (at least in the default 
configuration).  This is useful for development work, but you would usually 
precompile the pages for production.

Thanks in advance hopefully one day I'll be able to contribute.



Johnny Kewl
  eMail: JohnNo Spamkewlstuff.co.za  -- replace No Spam with @ --
  Cell: +027-72- 473-9331
Java Developer (Tomcat Aficionado)
  Free Tomcat software at  http://coolese.100free.com/
 




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat admin,Manager app setup

2007-05-22 Thread Caldarale, Charles R
 From: Rashmi Rubdi [mailto:[EMAIL PROTECTED] 
 Subject: Re: Tomcat admin,Manager app setup
 
 I haven't tried the 5.5.x Admin app on Tomcat 6.0.x , but it probably
 (just a guess) might be compatible.

It's not compatible, and at the moment there is no admin app for Tomcat
6.  Check the dev list for discussion thereof.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



  1   2   >