Re: Tomcat 6.0.35 filters not invoked for error-pages

2012-04-24 Thread Ludwig Magnusson

Thanks for your reply.

First of all: I have solved the acutal problem caused by this in a more 
stable way.


But out of curiosity I tried your solution and it does not work either.
this is my setup:

servlet
   servlet-namemyservlet/servlet-name
   servlet-classmypackage.MyServlet/servlet-class
/servlet

servlet-mapping
   servlet-namemyservlet/servlet-name
   url-pattern/*/url-pattern
/servlet-mapping

filter-mapping
   filter-namemyfilter/filter-name
   servlet-namemyservlet/servlet-name
   dispatcherREQUEST/dispatcher
   dispatcherFORWARD/dispatcher
/filter-mapping

/Ludwig

-Ursprungligt meddelande- 
From: Christopher Schultz

Sent: Monday, April 23, 2012 4:05 PM
To: Tomcat Users List
Subject: Re: Tomcat 6.0.35 filters not invoked for error-pages

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Ludwig,

On 4/22/12 2:26 PM, Ludwig Magnusson wrote:

Hello. I found some strange behavour in tomcat 6.0.35 when
declaring error-pages in my web.xml. When tomcat picks up an error
and redirects it to the location given by the location element in
error-page, the filters that would have been invoked for that
location are actually not invoked.

I found an almost identical report in the bug database:
https://issues.apache.org/bugzilla/show_bug.cgi?id=49098 (the user
had the same problem when using query strings in location).
However, I do not use query strings in my locations and I still get
the error.

Is this a bug and is it known?


What does your web.xml look like?

The error page is probably treated as a FORWARD, and you'll have to
configure your filters to fire on FORWARD as well as REQUEST (the
default).

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk+VYaMACgkQ9CaO5/Lv0PD4cwCff6+JoDHqehqsEtTMU471Np1+
MicAoKYezgJgAQ+0EWP71UkDFRb41nBf
=/UDF
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org 



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat 6.0.35 filters not invoked for error-pages

2012-04-24 Thread Ludwig Magnusson

That was it. Thanks =)

-- 
From: Konstantin Kolinko 
Sent: Tuesday, April 24, 2012 7:08 PM 
To: Tomcat Users List 
Subject: Re: Tomcat 6.0.35 filters not invoked for error-pages 


2012/4/24 Ludwig Magnusson lud...@mediatool.com:

Thanks for your reply.

First of all: I have solved the acutal problem caused by this in a more
stable way.

But out of curiosity I tried your solution and it does not work either.
this is my setup:

servlet
  servlet-namemyservlet/servlet-name
  servlet-classmypackage.MyServlet/servlet-class
/servlet

servlet-mapping
  servlet-namemyservlet/servlet-name
  url-pattern/*/url-pattern
/servlet-mapping

filter-mapping
  filter-namemyfilter/filter-name
  servlet-namemyservlet/servlet-name
  dispatcherREQUEST/dispatcher
  dispatcherFORWARD/dispatcher


dispatcherERROR/dispatcher
Since Servlet 2.4.


/filter-mapping



Best regards,
Konstantin Kolinko

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Tomcat 6.0.35 filters not invoked for error-pages

2012-04-22 Thread Ludwig Magnusson
Hello.
I found some strange behavour in tomcat 6.0.35 when declaring error-pages in my 
web.xml. When tomcat picks up an error and redirects it to the location given 
by the location element in error-page, the filters that would have been 
invoked for that location are actually not invoked.

I found an almost identical report in the bug database: 
https://issues.apache.org/bugzilla/show_bug.cgi?id=49098 (the user had the same 
problem when using query strings in location).
However, I do not use query strings in my locations and I still get the error.

Is this a bug and is it known?
/Ludwig

Overwriting and not overwriting when re-deploying a warfile

2010-01-14 Thread Ludwig Magnusson
Hi!

I have a problem when i deploy a new version of my webapp. I want some of
the files in my exisiting webapp to be overwritten, and I want some to be
left as they are. Let's say that this is the structure of my app:

/myapp/templates

/myapp/uploads

 

Templates contains the templates that builds my pages. If I change one of
these from one release to another, I want it to be overwritten. If I remove
it, I want it to be removed.

 

Upload however contains files uploaded by the users. I always want these to
stay on the server and not be removed when I re-deploy a war-file.

 

Is this possible in any way?

Right now, all my files are replaced with the ones in the war file.

/Ludwig 



RE: Overwriting and not overwriting when re-deploying a warfile

2010-01-14 Thread Ludwig Magnusson
Ok thanks, I'll investigate the solution.
/Ludwig

-Original Message-
From: peter.crowth...@googlemail.com [mailto:peter.crowth...@googlemail.com]
On Behalf Of Peter Crowther
Sent: den 14 januari 2010 11:29
To: Tomcat Users List
Subject: Re: Overwriting and not overwriting when re-deploying a warfile

2010/1/14 Ludwig Magnusson lud...@itcatapult.com:
 I have a problem when i deploy a new version of my webapp. I want some of
 the files in my exisiting webapp to be overwritten, and I want some to be
 left as they are.
[...]
 Is this possible in any way?

Not if the files are stored directly under the webapp.

I believe the usual workaround is to store the files somewhere else
and add a Context to serve them.  You may need to investigate single
sign-on if users require authorisation to view particular files.

- Peter

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Problems finding the right filepath

2009-11-23 Thread Ludwig Magnusson
We are running Tomcat 6.0.20.
The JDK is 1.6 but not the exact same version on all machines. My computer
has 1.6.0.17, the server has 1.6.0.07
We are developing on both windows and mac. The server is ubuntu.

To specify what I want, here is a model of my filesystem:

/Tomcat-folder
   /conf
   /webapps
 /my-webapp
   /WEB-INF
  /web.xml
   /my-folder --- this is the folder I want to search

If there is no specific way of solving this I can try the ones you have
suggested.
/Ludwig

-Original Message-
From: Joseph Morgan [mailto:joseph.mor...@ignitesales.com] 
Sent: den 23 november 2009 19:02
To: Tomcat Users List
Subject: RE: Problems finding the right filepath

Or... maybe within a initialization parameter for a servlet if you are
using Java

-Original Message-
From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] 
Sent: Monday, November 23, 2009 11:59 AM
To: Tomcat Users List
Subject: RE: Problems finding the right filepath

 From: Ludwig Magnusson [mailto:lud...@itcatapult.com]
 Subject: Problems finding the right filepath
 
 We are a team developing a webapp running on a tomcat server.

What version of Tomcat?  (Be precise.)  What JVM?

 We need to list the files in a certain directory in our 
 application, but we cannot find a way to always get the
 correct path on the different platforms and environments.

Can you let the DefaultServlet do it?  Directory listings are normally
disabled, but you can enable them for your particular webapp if you wish

Note that there is no requirement for a servlet container (e.g., Tomcat)
to provide *any* access to the underlying file system (if there is one
at all), other than to a scratch area for the webapp's internal use.  If
your webapp is deployed as a .war file, there is no file structure to
look at.

 Is this solvable through some IO-function or do we need
 to specify the path to our project in each environment?

You will likely need to specify the path through an environment
variable, Java system property, or within the webapp Context element,
via a nested Parameter or Environment setting.

 - 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 unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Problems finding the right filepath

2009-11-23 Thread Ludwig Magnusson
Thank you, that one worked.
/Ludwig

-Original Message-
From: Joseph Morgan [mailto:joseph.mor...@ignitesales.com] 
Sent: den 23 november 2009 19:25
To: Tomcat Users List
Subject: RE: Problems finding the right filepath

Ludwig, it's been a while, but there used to be a function getRealPath
or something very close to that on the ServletContext object where you
can get a system-proper path of a resource.  Have you tried that?

-Original Message-
From: Ludwig Magnusson [mailto:lud...@itcatapult.com] 
Sent: Monday, November 23, 2009 12:17 PM
To: 'Tomcat Users List'
Subject: RE: Problems finding the right filepath

We are running Tomcat 6.0.20.
The JDK is 1.6 but not the exact same version on all machines. My
computer
has 1.6.0.17, the server has 1.6.0.07
We are developing on both windows and mac. The server is ubuntu.

To specify what I want, here is a model of my filesystem:

/Tomcat-folder
   /conf
   /webapps
 /my-webapp
   /WEB-INF
  /web.xml
   /my-folder --- this is the folder I want to search

If there is no specific way of solving this I can try the ones you have
suggested.
/Ludwig

-Original Message-
From: Joseph Morgan [mailto:joseph.mor...@ignitesales.com] 
Sent: den 23 november 2009 19:02
To: Tomcat Users List
Subject: RE: Problems finding the right filepath

Or... maybe within a initialization parameter for a servlet if you are
using Java

-Original Message-
From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] 
Sent: Monday, November 23, 2009 11:59 AM
To: Tomcat Users List
Subject: RE: Problems finding the right filepath

 From: Ludwig Magnusson [mailto:lud...@itcatapult.com]
 Subject: Problems finding the right filepath
 
 We are a team developing a webapp running on a tomcat server.

What version of Tomcat?  (Be precise.)  What JVM?

 We need to list the files in a certain directory in our 
 application, but we cannot find a way to always get the
 correct path on the different platforms and environments.

Can you let the DefaultServlet do it?  Directory listings are normally
disabled, but you can enable them for your particular webapp if you wish

Note that there is no requirement for a servlet container (e.g., Tomcat)
to provide *any* access to the underlying file system (if there is one
at all), other than to a scratch area for the webapp's internal use.  If
your webapp is deployed as a .war file, there is no file structure to
look at.

 Is this solvable through some IO-function or do we need
 to specify the path to our project in each environment?

You will likely need to specify the path through an environment
variable, Java system property, or within the webapp Context element,
via a nested Parameter or Environment setting.

 - 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 unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org