Re: Issue between RewriteValve and DefaultServlet

2017-06-27 Thread Jérémie Barthés

"That behaviour is expected."

I really didn't expect that. it took me two weeks, two years ago to understand 
why i had a redirect and not a forward if my URI last char isn't a '/'
---
"The way to handle this is to wrap the response and intercept
the call that sets the location header and modify the value before
calling the wrapped response."

we have other service using redirection to work. It's tricky to wrap response 
then change location headers without disturbing our 302 redirections.

May this method be protected in following versions ?
"Unlikely at this point."

it would really help in our case. We'll study for other solutions anyway


Thanks

Jeremie


Le 26/06/2017 à 14:52, Mark Thomas a écrit :

On 26/06/17 11:22, Jérémie Barthés wrote:

Thank for your  fast answer

I would like to extend DefaultServlet to override doDirectoryRedirect
but the method is private,
private void doDirectoryRedirect(HttpServletRequest request,
HttpServletResponse response)

May this method be protected in following versions ?

Unlikely at this point.


i can't change a header on the way out, after server started to answer,
can i ?

Correct. The way to handle this is to wrap the response and intercept
the call that sets the location header and modify the value before
calling the wrapped response.

Mark



Regard

Jeremie

PS : i added a custom valve just to put non-rewritten URI in a request
attribute, so i can use it if present when doDirectoryRedirect occurs


Le 26/06/2017 à 12:01, Mark Thomas a écrit :

On 26/06/17 10:55, Jérémie Barthés wrote:

Hi,

I have an issue between org.apache.catalina.valves.rewrite.RewriteValve
and org.apache.catalina.servlets.DefaultServlets

If my request is forwarded by the RewriteValve and then pass into
doDirectoryRedirect in DefaultServlets to be redirected. The hidden
rewritten URI is displayed in the browser.

To test it, try the following example (any tomcat 8, 8.5 or 9)

add RewriteValve in conf/server.xml


add rewriteRule in conf/Catalina/localhost/rewrite.config
RewriteRule ^/iWantThisVisible/(.*) $/examples/$1/

start tomcat

go to following URLs (any internet browser) :
http://localhost:8080/iWantThisVisible/servlets
http://localhost:8080/iWantThisVisible/servlets/

That behaviour is expected.

If you want to stick with the RewriteValve you'll need to write a custom
Valve or Filter to modify the HTTP headers on the way out.

You might be better off writing a custom Servlet that does a forward.

Mark

-
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



Re: Tomcat events in London (and beyond)

2017-06-27 Thread Mark Thomas
On 27/06/17 12:24, Olaf Kock wrote:
> I love the idea - am just wondering how you're planning to combine £50
> without financial risk, with lunch & room (having an idea what hotels
> charge for a catered event day), Travel for you/the committers etc.

Having a company host the first event removes the upfront financial
risk. That event should then leave us with enough funding to pay the
upfront costs for future events.

Choosing the right venue is key to keeping the costs down. I'm not
looking at the typical London hotel chains for this. I'm looking at the
budget end of the market. For example, Premier Inn offers meeting rooms
in suitable locations at prices that would work.

My travel costs are fairly minimal (for London anyway). Bringing in
other committers gets more expensive but could be doable at relatively
low numbers of attendees (~20) providing we are careful about costs.

Mark

> 
> I'll be happy to forward this to some people within my company - aiming
> at several european cities including London. Ping me directly if needed.
> 
> Olaf
> 
> 
> Am 27.06.2017 um 13:12 schrieb Mark Thomas:
>> Hi,
>>
>> I'm looking to start a series of Tomcat events. Starting in London, the
>> hope is that - if they are successful - to expand to any UK - or
>> possibly European - location where there is a demand.
>>
>> The essentials are:
>> - 1 day event
>> - ticket price is £50
>> - attendees get a say in the topics
>> - lunch provided
>> - me, and possibly a.n. other committer, presenting
>> - venue TBD but somewhere in London Underground zone 1
>>
>> At this point I am looking to see if there is sufficient interest in the
>> Tomcat user community to go ahead and organise the first event. Please
>> let me know (either on this thread or off-list) if you are likely to attend.
>>
>> I am trying to do this without taking on any financial risk for me
>> personally or the Apache Software Foundation. That makes organising a
>> venue tricky as they typically require payment upfront or a significant
>> deposit. With that in mind, if anyone works for a company that would be
>> willing to host the first of these please let me know. In return for
>> providing the venue and the lunch, the hosting company will get 50% of
>> the available places at zero cost. My guess is that we'd need a venue
>> for ~20 people for the first event.
>>
>> The plan is to build up a small fund that we can then use to:
>> - pre-book venues so we aren't reliant on companies
>> - pay travel expenses for speakers so we can expand to locations outside
>>   of  London
>> - bring in additional speakers (so it isn't always just me doing the
>>   talking)
>>
>> My plan is to be completely open regarding the finances. I'll post a
>> spreadsheet somewhere that shows all the income and expenses so everyone
>> can see what money is generated by these events and where it is then
>> spent. If the events turn out to be wildly successful and the events
>> generate a large surplus (experience tells me this is unlikely) then
>> that would be donated to the ASF.
>>
>> I look forward to your responses,
>>
>> Mark
>>
>> -
>> 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: Tomcat events in London (and beyond)

2017-06-27 Thread Olaf Kock
I love the idea - am just wondering how you're planning to combine £50
without financial risk, with lunch & room (having an idea what hotels
charge for a catered event day), Travel for you/the committers etc.

I'll be happy to forward this to some people within my company - aiming
at several european cities including London. Ping me directly if needed.

Olaf


Am 27.06.2017 um 13:12 schrieb Mark Thomas:
> Hi,
>
> I'm looking to start a series of Tomcat events. Starting in London, the
> hope is that - if they are successful - to expand to any UK - or
> possibly European - location where there is a demand.
>
> The essentials are:
> - 1 day event
> - ticket price is £50
> - attendees get a say in the topics
> - lunch provided
> - me, and possibly a.n. other committer, presenting
> - venue TBD but somewhere in London Underground zone 1
>
> At this point I am looking to see if there is sufficient interest in the
> Tomcat user community to go ahead and organise the first event. Please
> let me know (either on this thread or off-list) if you are likely to attend.
>
> I am trying to do this without taking on any financial risk for me
> personally or the Apache Software Foundation. That makes organising a
> venue tricky as they typically require payment upfront or a significant
> deposit. With that in mind, if anyone works for a company that would be
> willing to host the first of these please let me know. In return for
> providing the venue and the lunch, the hosting company will get 50% of
> the available places at zero cost. My guess is that we'd need a venue
> for ~20 people for the first event.
>
> The plan is to build up a small fund that we can then use to:
> - pre-book venues so we aren't reliant on companies
> - pay travel expenses for speakers so we can expand to locations outside
>   of  London
> - bring in additional speakers (so it isn't always just me doing the
>   talking)
>
> My plan is to be completely open regarding the finances. I'll post a
> spreadsheet somewhere that shows all the income and expenses so everyone
> can see what money is generated by these events and where it is then
> spent. If the events turn out to be wildly successful and the events
> generate a large surplus (experience tells me this is unlikely) then
> that would be donated to the ASF.
>
> I look forward to your responses,
>
> Mark
>
> -
> 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



[ANN] Apache Tomcat 9.0.0.M22 available

2017-06-27 Thread Mark Thomas
The Apache Tomcat team announces the immediate availability of Apache
Tomcat 9.0.0.M22.

Apache Tomcat 9 is an open source software implementation of the Java
Servlet, JavaServer Pages, Java Unified Expression Language, Java
WebSocket and JASPIC technologies.

Apache Tomcat 9.0.0.M22 is a milestone release of the 9.0.x branch and
has been made to provide users with early access to the new features in
Apache Tomcat 9.0.x so that they may provide feedback. The notable
changes compared to 9.0.0.M21 include:


- Add a new JULI FileHandler configuration for specifying the maximum
  number of days to keep the log files. By default the log files will be
  kept 90 days.

- Update the Servlet 4.0 implementation to add support for setting
  trailer fields for HTTP responses.

- When pre-compiling with JspC, report all compilation errors rather
  than stopping after the first error.


Please refer to the change log for the complete list of changes:
http://tomcat.apache.org/tomcat-9.0-doc/changelog.html

Downloads:
http://tomcat.apache.org/download-90.cgi

Migration guides from Apache Tomcat 6.x, 7.x and 8.x:
http://tomcat.apache.org/migration.html

Enjoy!

- The Apache Tomcat team

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



Tomcat events in London (and beyond)

2017-06-27 Thread Mark Thomas
Hi,

I'm looking to start a series of Tomcat events. Starting in London, the
hope is that - if they are successful - to expand to any UK - or
possibly European - location where there is a demand.

The essentials are:
- 1 day event
- ticket price is £50
- attendees get a say in the topics
- lunch provided
- me, and possibly a.n. other committer, presenting
- venue TBD but somewhere in London Underground zone 1

At this point I am looking to see if there is sufficient interest in the
Tomcat user community to go ahead and organise the first event. Please
let me know (either on this thread or off-list) if you are likely to attend.

I am trying to do this without taking on any financial risk for me
personally or the Apache Software Foundation. That makes organising a
venue tricky as they typically require payment upfront or a significant
deposit. With that in mind, if anyone works for a company that would be
willing to host the first of these please let me know. In return for
providing the venue and the lunch, the hosting company will get 50% of
the available places at zero cost. My guess is that we'd need a venue
for ~20 people for the first event.

The plan is to build up a small fund that we can then use to:
- pre-book venues so we aren't reliant on companies
- pay travel expenses for speakers so we can expand to locations outside
  of  London
- bring in additional speakers (so it isn't always just me doing the
  talking)

My plan is to be completely open regarding the finances. I'll post a
spreadsheet somewhere that shows all the income and expenses so everyone
can see what money is generated by these events and where it is then
spent. If the events turn out to be wildly successful and the events
generate a large surplus (experience tells me this is unlikely) then
that would be donated to the ASF.

I look forward to your responses,

Mark

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