Re: invalidate session after calling listeners

2005-08-29 Thread Franklin Phan

Hassan,

How do I add an instance of the listener to each session?  Can you please 
provide an example?

I forgot to mention that I already have the following in the first JSP after 
the login is validated:

jsp:useBean id=listener class=abcd.AbcdSessionListener scope=session /

%
session.setAttribute(sessionListener, listener);
%


What you say, ...and that object receives the event, it still knows its attributes.  
What do you mean by object?  Which object?

Thanks.


Hassan Schroeder wrote:

Franklin Phan wrote:

I'm trying to code a method to clean up specifically named files 
inside a working dir (in Windows XP) whenever the session times out.  



Rather than a global listener approach, why not just add an instance
of your listener *to each session*? When the session ends and that
object receives the event, it still knows its attributes; from your
example:

 public void valueUnbound(HttpSessionBindingEvent se) {
AbcdUtil util = new AbcdUtil();

/* -- neither of these is necessary, as userId is still defined
 *   HttpSession session = se.getSession();
 *   String userId = (String)session.getValue(userId);
 */

I use this approach to return items to stock from an abandoned (via
session timeout) shopping cart, for instance.

FWIW!



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: invalidate session after calling listeners

2005-08-29 Thread Franklin Phan

Hassan,

Also, I don't understand the difference between a global and a non-global 
listener approach.  Can you explain?  Thanks.

Thanks.


Hassan Schroeder wrote:

Franklin Phan wrote:

I'm trying to code a method to clean up specifically named files 
inside a working dir (in Windows XP) whenever the session times out.  



Rather than a global listener approach, why not just add an instance
of your listener *to each session*? When the session ends and that
object receives the event, it still knows its attributes; from your
example:

 public void valueUnbound(HttpSessionBindingEvent se) {
AbcdUtil util = new AbcdUtil();

/* -- neither of these is necessary, as userId is still defined
 *   HttpSession session = se.getSession();
 *   String userId = (String)session.getValue(userId);
 */

I use this approach to return items to stock from an abandoned (via
session timeout) shopping cart, for instance.

FWIW!



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: invalidate session after calling listeners

2005-08-29 Thread Franklin Phan

Hassan,

I have found the solution.  I think that a big part of what you were saying was something that I was already doing but neglected to mention (i.e., having a line of code in the JSP to bind the 
listener object to the session using setAttribute).


Your commenting out my two lines of code did hint to me to take a closer look 
at the Servlet API Documentation.
The API documentation for HttpSession interface says:

When an application stores an object in or removes an object from a session, the session checks whether the object implements HttpSessionBindingListener. If it does, the servlet notifies the 
object that it has been bound to or unbound from the session.


Reading that again did clarify for me what it means for an object to implement 
HttpSessionBindingListener and led me to add the following:

session.getServletContext().getRealPath(XML_WORK_PATH)

to the valueBound method to set an instance variable because that's where the 
session object is still valid.  I then removed the two lines of code from 
valueUnbound as you indicated.

Thanks.

What threw me off in the first place was the poor API documentation for 
HttpSessionBindingListener interface.  It says for valueUnbound:
Notifies the object that it is being unbound from a session and identifies the 
session.

It gave me the impression that the method itself notifies the object (which is the object that contains the implementation of HttpSessionBindingListener itself) and provides a reference to the 
session.


The API documentation for that method should have said something like:

This method is called *upon receiving notification* that this object is being 
unbound from the *invalidated* session.

Thanks, again.

Still, though, what is a global listener approach?



Franklin Phan wrote:

Hassan,

How do I add an instance of the listener to each session?  Can you 
please provide an example?


I forgot to mention that I already have the following in the first JSP 
after the login is validated:


jsp:useBean id=listener class=abcd.AbcdSessionListener 
scope=session /


%
session.setAttribute(sessionListener, listener);
%


What you say, ...and that object receives the event, it still knows its 
attributes.  What do you mean by object?  Which object?


Thanks.


Hassan Schroeder wrote:


Franklin Phan wrote:

I'm trying to code a method to clean up specifically named files 
inside a working dir (in Windows XP) whenever the session times out.  




Rather than a global listener approach, why not just add an instance
of your listener *to each session*? When the session ends and that
object receives the event, it still knows its attributes; from your
example:

 public void valueUnbound(HttpSessionBindingEvent se) {
AbcdUtil util = new AbcdUtil();

/* -- neither of these is necessary, as userId is still defined
 *   HttpSession session = se.getSession();
 *   String userId = (String)session.getValue(userId);
 */

I use this approach to return items to stock from an abandoned (via
session timeout) shopping cart, for instance.

FWIW!




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



invalidate session after calling listeners

2005-08-26 Thread Franklin Phan

Is there a way to set Tomcat to call listeners before invalidate() is called on 
a session?
I'm trying to code a method to clean up specifically named files inside a working dir (in Windows XP) whenever the session times out.  I can't seem to find a way to do it.  Apparently, 
invalidate() is called prior to calling listeners, and these specifically named files that I want to clean up are named after the user ID that is stored in the HttpSession object (meaning 
I'd need to access the session object.  I understand Resin has a setting called invalidate-after-listener and am wondering whether Tomcat has same.


Thanks.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: invalidate session after calling listeners

2005-08-26 Thread Franklin Phan

Darek,

I've tried your suggestion.  As I've said before: I need to access the Session 
object.  This is what I have:

package abcd;

import java.io.*;
import javax.servlet.http.*;

public class AbcdSessionListener implements HttpSessionBindingListener {

  private String userId;
  public void valueBound(HttpSessionBindingEvent se) {
HttpSession session = se.getSession();
userId = (String)session.getValue(userId);
  }

  public void valueUnbound(HttpSessionBindingEvent se) {
AbcdUtil util = new AbcdUtil();
HttpSession session = se.getSession(); // ---This is not possible because 
the session is already invalidated at this point.
String userId = (String)session.getValue(userId);

// Clean up the folder of old XML files by the same user from previous 
login (uses the AbcdUtil class)
String XML_WORK_PATH = /WEB-INF/work_xml;
File[] files = 
util.fileSearch(session.getServletContext().getRealPath(XML_WORK_PATH), userId + 
_*.*);

for (int i = 0; i  files.length; i++) {
files[i].delete();
}
  }
} // End AbcdSessionListener


And I use the following in a JSP:

jsp:useBean id=listener class=abcd.AbcdSessionListener scope=session /

%
session.setAttribute(sessionListener, listener);
%

All this fails with or without a listener element in the web.xml entry (and 
how should one decide whether or not to put one in web.xml?).
If you read the Servlet API Documentation for the HttpSession Interface 
(http://jakarta.apache.org/tomcat/tomcat-5.5-doc/servletapi/index.html), it 
says:
For session that are invalidated or expire, notifications are sent after the 
session has been invalidated or expired.  Pretty useless, if you ask me.

Any advice?


Franklin



Darek Czarkowski wrote:

You could implement HttpSessionBindingListener and define your own
valueBound and valueUnbound methods.

DarekC

On Fri, 2005-08-26 at 13:08, Franklin Phan wrote:


Is there a way to set Tomcat to call listeners before invalidate() is called on 
a session?
I'm trying to code a method to clean up specifically named files inside a working dir (in Windows XP) whenever the session times out.  I can't seem to find a way to do it.  Apparently, 
invalidate() is called prior to calling listeners, and these specifically named files that I want to clean up are named after the user ID that is stored in the HttpSession object (meaning 
I'd need to access the session object.  I understand Resin has a setting called invalidate-after-listener and am wondering whether Tomcat has same.


Thanks.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Multiple Tomcats on the same machine possible?

2005-08-25 Thread Franklin Phan

Instead of having one Tomcat on each machine, we'd like to try to fit multiple 
on one.  Any advice on how to go about that?  We use Windows XP.  How would the 
start/stop services work then?  I
presume that we will need a different port number for each Tomcat install.


Thanks.




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Malformed URL Exception: unknown protocol: c

2005-08-25 Thread Franklin Phan
I use Windows XP Pro. My JAVA_HOME environment variable points to c:\j2sdk1.4.2_05.  The CLASSPATH is set to have as the first element %JAVA_HOME%\bin.  I've written an XSL Transform servlet 
that makes use of the package javax.xml.transform.  Why do I get the following error:


javax.servlet.ServletException:
javax.xml.transform.TransformerConfigurationException:
javax.xml.transform.TransformerException:
java.net.MalformedURLException: unknown protocol: c

The four lines above actually appear altogether in one line.  And the error appears to be due to the following piece of code where I'm trying to get the path to a folder on the local drive to 
access a file:


String XML_WORK_PATH = /WEB-INF/work_xml;
TransformerFactory tFactory = TransformerFactory.newInstance();
Transformer transformer =
  tFactory.newTransformer(new 
javax.xml.transform.stream.StreamSource(getServletContext().getRealPath(XML_WORK_PATH) + 
\\ + xslParam)); //xslParam is an XSL file name


The Malformed URL Exception does not occur on another machine running Windows 
XP Server.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Single copy of Tomcat shared amongst multiple users

2005-08-25 Thread Franklin Phan

In RUNNING.txt, a paragraph says:

In many circumstances, it is desirable to have a single copy of a Tomcat 4
binary distribution shared among multiple users on the same server.  To make
this possible, you must configure a CATALINA_BASE environment variable (in
addition to CATALINA_HOME as described above) that points to a directory
that is unique to your instance.

I'm not understanding this.  I've been thinking about having multiple installs of Tomcat 4 on the same server.  I'm now wondering whether what RUNNING.txt suggests can take the place of having 
multiple installs.  But I'm not understanding how just setting a CATALINA_BASE env var can achieve this.  I can only set one CATALINA_BASE env var, right?  What if there are four ...um...not 
instances, but...users who each want their own Tomcat to work with?  How is it possible to have four CATALINA_BASE environment variables?



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Malformed URL Exception: unknown protocol: c

2005-08-25 Thread Franklin Phan
To make things a bit more puzzling, I have a different app inside the same Tomcat 4.1.18 that uses the same XSL Transform class under its own web app context.  That app works without a hitch. 
 Why is that?



Jay Burgess wrote:

First, I assume you mean CLASSPATH and /lib, or PATH and /bin, but not CLASSPATH
and /bin?

Second, your situation has me puzzled.  Mark's answer appears correct, as
unknown protocol: c is typically the C:\ of a Windows filesystem path.  And
checking the documentation, StreamSource requires a URI, so a windows filesystem
path won't work.

However...my code does something very similar, and it works. The only difference
is that I'm doing it for a StreamResult, not a StreamSource:

String root = getServletContext().getRealPath();
String xmlFileName = root + File.separator + WEB-INF + 
File.separator + TestData.xml;

TransformerFactory.newInstance().newTransformer().transform(
new DOMSource(buffer),
new StreamResult(xmlFileName)); // DOM into XML

I just threw in a quick println(), and xmlFileName is equal to
C:\tomcat-5.0.19\webapps\TestApp\WEB-INF\TestData.xml.

Can anyone explain why mine works and Franklin's fails?  Maybe I'm missing
something obvious.

Jay

| Jay Burgess [Vertical Technology Group]
| Essential Technology Links
| http://www.vtgroup.com/


-Original Message-
From: Mark Thomas [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 25, 2005 4:21 PM

To: Tomcat Users List
Subject: Re: Malformed URL Exception: unknown protocol: c

I assume becuase the url you pass it starts c:\ as that is the start 
of the XML_WORK_PATH. You need to prefix it with file:/// (or however 
many slashes you need to get this to work in windows).


Mark

Franklin Phan wrote:

I use Windows XP Pro. My JAVA_HOME environment variable points to 
c:\j2sdk1.4.2_05.  The CLASSPATH is set to have as the first element 
%JAVA_HOME%\bin.  I've written an XSL Transform servlet that makes use 
of the package javax.xml.transform.  Why do I get the following error:


javax.servlet.ServletException:
javax.xml.transform.TransformerConfigurationException:
javax.xml.transform.TransformerException:
java.net.MalformedURLException: unknown protocol: c

The four lines above actually appear altogether in one line.  And the 
error appears to be due to the following piece of code where I'm trying 
to get the path to a folder on the local drive to access a file:


String XML_WORK_PATH = /WEB-INF/work_xml;
TransformerFactory tFactory = TransformerFactory.newInstance();
Transformer transformer =
 tFactory.newTransformer(new 



javax.xml.transform.stream.StreamSource(getServletContext().getRealPath(XML_WORK_PATH)



+ \\ + xslParam)); //xslParam is an XSL file name


The Malformed URL Exception does not occur on another machine running 
Windows XP Server.







-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Malformed URL Exception: unknown protocol: c

2005-08-25 Thread Franklin Phan

Jay,

I just looked again at my Environment Variables under the Advanced tab of my System Properties window.  
You are correct; it is the Path var that says %JAVA_HOME%\bin;...more 
paths.

Franklin


Jay Burgess wrote:

First, I assume you mean CLASSPATH and /lib, or PATH and /bin, but not CLASSPATH
and /bin?

Second, your situation has me puzzled.  Mark's answer appears correct, as
unknown protocol: c is typically the C:\ of a Windows filesystem path.  And
checking the documentation, StreamSource requires a URI, so a windows filesystem
path won't work.

However...my code does something very similar, and it works. The only difference
is that I'm doing it for a StreamResult, not a StreamSource:

String root = getServletContext().getRealPath();
String xmlFileName = root + File.separator + WEB-INF + 
File.separator + TestData.xml;

TransformerFactory.newInstance().newTransformer().transform(
new DOMSource(buffer),
new StreamResult(xmlFileName)); // DOM into XML

I just threw in a quick println(), and xmlFileName is equal to
C:\tomcat-5.0.19\webapps\TestApp\WEB-INF\TestData.xml.

Can anyone explain why mine works and Franklin's fails?  Maybe I'm missing
something obvious.

Jay

| Jay Burgess [Vertical Technology Group]
| Essential Technology Links
| http://www.vtgroup.com/


-Original Message-
From: Mark Thomas [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 25, 2005 4:21 PM

To: Tomcat Users List
Subject: Re: Malformed URL Exception: unknown protocol: c

I assume becuase the url you pass it starts c:\ as that is the start 
of the XML_WORK_PATH. You need to prefix it with file:/// (or however 
many slashes you need to get this to work in windows).


Mark

Franklin Phan wrote:

I use Windows XP Pro. My JAVA_HOME environment variable points to 
c:\j2sdk1.4.2_05.  The CLASSPATH is set to have as the first element 
%JAVA_HOME%\bin.  I've written an XSL Transform servlet that makes use 
of the package javax.xml.transform.  Why do I get the following error:


javax.servlet.ServletException:
javax.xml.transform.TransformerConfigurationException:
javax.xml.transform.TransformerException:
java.net.MalformedURLException: unknown protocol: c

The four lines above actually appear altogether in one line.  And the 
error appears to be due to the following piece of code where I'm trying 
to get the path to a folder on the local drive to access a file:


String XML_WORK_PATH = /WEB-INF/work_xml;
TransformerFactory tFactory = TransformerFactory.newInstance();
Transformer transformer =
 tFactory.newTransformer(new 



javax.xml.transform.stream.StreamSource(getServletContext().getRealPath(XML_WORK_PATH)



+ \\ + xslParam)); //xslParam is an XSL file name


The Malformed URL Exception does not occur on another machine running 
Windows XP Server.







-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Malformed URL Exception: unknown protocol: c

2005-08-25 Thread Franklin Phan

Jay,

I did that just last night.  I got:

C:\Program Files\Apache Group\Tomcat 4.1\webapps\htmaint\WEB-INF\work_xml

Franklin Phan
Cygna Energy Services
www.cygna.net

Jay Burgess wrote:
Why don't you do: 


  System.out.println(getServletContext().getRealPath(XML_WORK_PATH));

And see what it tells you.  I'd be curious to see what you're passing to the
StreamSource constructor, and how it differs from my string.

Jay
 


-Original Message-
From: Franklin Phan [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 25, 2005 4:52 PM

To: Tomcat Users List
Subject: Re: Malformed URL Exception: unknown protocol: c

To make things a bit more puzzling, I have a different app inside the same
Tomcat 4.1.18 that uses the same XSL Transform class under its own web app
context.  That app works without a hitch. 
  Why is that?



Jay Burgess wrote:


First, I assume you mean CLASSPATH and /lib, or PATH and /bin, but not CLASSPATH
and /bin?

Second, your situation has me puzzled.  Mark's answer appears correct, as
unknown protocol: c is typically the C:\ of a Windows filesystem path.  And
checking the documentation, StreamSource requires a URI, so a windows filesystem
path won't work.

However...my code does something very similar, and it works. The only difference
is that I'm doing it for a StreamResult, not a StreamSource:

String root = getServletContext().getRealPath();
String xmlFileName = root + File.separator + WEB-INF + 
   File.separator + TestData.xml;

TransformerFactory.newInstance().newTransformer().transform(
   new DOMSource(buffer),
   new StreamResult(xmlFileName)); // DOM into XML

I just threw in a quick println(), and xmlFileName is equal to
C:\tomcat-5.0.19\webapps\TestApp\WEB-INF\TestData.xml.

Can anyone explain why mine works and Franklin's fails?  Maybe I'm missing
something obvious.

Jay

| Jay Burgess [Vertical Technology Group]
| Essential Technology Links
| http://www.vtgroup.com/


-Original Message-
From: Mark Thomas [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 25, 2005 4:21 PM

To: Tomcat Users List
Subject: Re: Malformed URL Exception: unknown protocol: c

I assume becuase the url you pass it starts c:\ as that is the start 
of the XML_WORK_PATH. You need to prefix it with file:/// (or however 
many slashes you need to get this to work in windows).


Mark

Franklin Phan wrote:


I use Windows XP Pro. My JAVA_HOME environment variable points to 
c:\j2sdk1.4.2_05.  The CLASSPATH is set to have as the first element 
%JAVA_HOME%\bin.  I've written an XSL Transform servlet that makes use 
of the package javax.xml.transform.  Why do I get the following error:


javax.servlet.ServletException:
javax.xml.transform.TransformerConfigurationException:
javax.xml.transform.TransformerException:
java.net.MalformedURLException: unknown protocol: c

The four lines above actually appear altogether in one line.  And the 
error appears to be due to the following piece of code where I'm trying 
to get the path to a folder on the local drive to access a file:


String XML_WORK_PATH = /WEB-INF/work_xml;
TransformerFactory tFactory = TransformerFactory.newInstance();
Transformer transformer =
tFactory.newTransformer(new 





javax.xml.transform.stream.StreamSource(getServletContext().getRealPath(XML_WORK_PATH)




+ \\ + xslParam)); //xslParam is an XSL file name


The Malformed URL Exception does not occur on another machine running 
Windows XP Server.







-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Setting up mutiple Tomcats as services

2005-08-25 Thread Franklin Phan
I installed two instances (two separate installations) of Tomcat 4.1.18 onto my computer.  How do I have them both as services that start automatically whenever my machine starts?  I use 
Windows XP.


Thanks.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Expression Languange not working for me

2005-04-26 Thread Franklin Phan
I am new at this.
Yes, I can correctly view the EL examples that came with Tomcat 5.0.
You are correct; it was a caching issue.  Resaving the file under a new 
timestamp solved the problem.
I also found that the web-app tag need only contain the version=2.4 attribute 
for EL to work.  I don't know what the other attributes are for, but...
Thank you very much.
Fredrik Liden wrote:
Are you able to correctly view the Expression Language examples that
comes with Tomcat 5.0?
If so look at those web.xml files to make sure you have the same web-app
attributes.
Right now it could be some caching that prevents you from seeing the
correct result.
Try creating a new jsp from scratch and do it again.
-Original Message-
From: Franklin Phan [mailto:[EMAIL PROTECTED] 
Sent: Monday, April 25, 2005 6:34 PM
To: Tomcat Users List
Subject: Re: Expression Languange not working for me

It doesn't help.  I'm still getting the same result.
My current web.xml:
?xml version=1.0 encoding=ISO-8859-1?
web-app version=2.4
  xmlns=http://java.sun.com/xml/ns/j2ee;
  xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
  xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee
  http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd; 
/web-app

Fredrik Liden wrote:

Try this:
web-app version=2.4
xmlns=http://java.sun.com/xml/ns/j2ee;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd; 
/web-app
-Original Message-
From: Franklin Phan [mailto:[EMAIL PROTECTED]
Sent: Monday, April 25, 2005 6:24 PM
To: Tomcat Users List
Subject: Re: Expression Languange not working for me
This is what my web.xml file contains:
?xml version=1.0 encoding=ISO-8859-1?
!DOCTYPE web-app
PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN
http://java.sun.com/dtd/web-app_2_3.dtd;
web-app
/web-app
What do I change?

Fredrik Liden wrote:

Check your web.xml file to make sure you're using the 2.4 dtd and not
2.3 or lower.
Fredrik
-Original Message-
From: Franklin Phan [mailto:[EMAIL PROTECTED]
Sent: Monday, April 25, 2005 6:04 PM
To: tomcat-user@jakarta.apache.org
Subject: Expression Languange not working for me
I am running Tomcat 4.1.18 and 5.0.x.
I tried the following HTML and JSP using EL, and am not getting the
correct response from either Tomcat version.
I have the following HTML:
html
body
form action=TestBean.jsp
  Name: input type=text name=namebr
  input type=submit
/form
/body
/html

And the following JSP:
%@ page isELIgnored =false %
html
body
Request param name is: ${param.name} br
/body
/html

Regardless of what I type in the Name box in the HTML page, the
response is always:
Request param name is: ${param.name}
What is wrong?
Thanks.





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Getting Log4JLogger errors when attempting to start web app

2005-04-26 Thread Franklin Phan
I have not been able to start my web app.  I am using Tomcat 5.0.?.  Everytime I go to 
the URL, I get The requested resource (/xyz) is not available error.
I go to look in the launcher.server.log file and see the following:
SEVERE: Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigListener
org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;@1a66c87 for 
org.apache.commons.logging.impl.Log4JLogger
.
.
.
Caused by: org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;@1a66c87 for org.apache.commons.logging.impl.Log4JLogger
.
.
.
Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Logger
.
.
.

Now, in the WEB-INF\lib\ folder, there is a log4j.jar, which contains org/apache/log4j/Logger.class.
In the TOMCAT_HOME\commons\lib\ folder, there is a commons-logging-api.jar, dated May 30, 2003; but it does not contain Log4JLogger although it does contain Jdk14Logger.class (both under 
org.apache.commons.logging.impl).

Is this commons-logging-api.jar too old?  Where can I get the necessary 
org.apache.commons.logging.impl.Log4JLogger.class?
Thanks.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Expression Languange not working for me

2005-04-25 Thread Franklin Phan
I am running Tomcat 4.1.18 and 5.0.x.
I tried the following HTML and JSP using EL, and am not getting the correct 
response from either Tomcat version.
I have the following HTML:
html
body
form action=TestBean.jsp
   Name: input type=text name=namebr
   input type=submit
/form
/body
/html

And the following JSP:
%@ page isELIgnored =false %
html
body
Request param name is: ${param.name} br
/body
/html

Regardless of what I type in the Name box in the HTML page, the response is 
always:
Request param name is: ${param.name}
What is wrong?
Thanks.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Expression Languange not working for me

2005-04-25 Thread Franklin Phan
This is what my web.xml file contains:
?xml version=1.0 encoding=ISO-8859-1?
!DOCTYPE web-app
PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN
http://java.sun.com/dtd/web-app_2_3.dtd;
web-app
/web-app
What do I change?

Fredrik Liden wrote:
Check your web.xml file to make sure you're using the 2.4 dtd and not
2.3 or lower.
Fredrik
-Original Message-
From: Franklin Phan [mailto:[EMAIL PROTECTED] 
Sent: Monday, April 25, 2005 6:04 PM
To: tomcat-user@jakarta.apache.org
Subject: Expression Languange not working for me

I am running Tomcat 4.1.18 and 5.0.x.
I tried the following HTML and JSP using EL, and am not getting the
correct response from either Tomcat version.
I have the following HTML:
html
body
form action=TestBean.jsp
Name: input type=text name=namebr
input type=submit
/form
/body
/html

And the following JSP:
%@ page isELIgnored =false %
html
body
Request param name is: ${param.name} br
/body
/html

Regardless of what I type in the Name box in the HTML page, the response
is always:
Request param name is: ${param.name}
What is wrong?
Thanks.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Expression Languange not working for me

2005-04-25 Thread Franklin Phan
It doesn't help.  I'm still getting the same result.
My current web.xml:
?xml version=1.0 encoding=ISO-8859-1?
web-app version=2.4
 xmlns=http://java.sun.com/xml/ns/j2ee;
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee
 http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd; 
/web-app

Fredrik Liden wrote:
Try this:
web-app version=2.4
 xmlns=http://java.sun.com/xml/ns/j2ee;
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd; 
/web-app
-Original Message-
From: Franklin Phan [mailto:[EMAIL PROTECTED] 
Sent: Monday, April 25, 2005 6:24 PM
To: Tomcat Users List
Subject: Re: Expression Languange not working for me

This is what my web.xml file contains:
?xml version=1.0 encoding=ISO-8859-1?
!DOCTYPE web-app
 PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN
 http://java.sun.com/dtd/web-app_2_3.dtd;
web-app
/web-app
What do I change?

Fredrik Liden wrote:

Check your web.xml file to make sure you're using the 2.4 dtd and not 
2.3 or lower.

Fredrik
-Original Message-
From: Franklin Phan [mailto:[EMAIL PROTECTED]
Sent: Monday, April 25, 2005 6:04 PM
To: tomcat-user@jakarta.apache.org
Subject: Expression Languange not working for me
I am running Tomcat 4.1.18 and 5.0.x.
I tried the following HTML and JSP using EL, and am not getting the 
correct response from either Tomcat version.

I have the following HTML:
html
body
form action=TestBean.jsp
   Name: input type=text name=namebr
   input type=submit
/form
/body
/html

And the following JSP:
%@ page isELIgnored =false %
html
body
Request param name is: ${param.name} br
/body
/html

Regardless of what I type in the Name box in the HTML page, the 
response is always:

Request param name is: ${param.name}
What is wrong?
Thanks.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]