Re: Unwanted removal of attribute suffix in Tomcat environment

2008-07-14 Thread Lutz Harder
Hello Tim,

it did not seem to be that way, as the values of the HashMap did not get changed
after initial setup - but I will look into it. Thanks for the hint!

Regards,
Lutz





Re: Unwanted removal of attribute suffix in Tomcat environment

2008-07-13 Thread Lutz Harder
Hello Thierry,

I have finally managed to get rid of my problem - I am still not entirely sure
why I encountered it in the first place, but anyway:

In the simple demo app, I used to declare the template paths directly as static
strings. In the more complex live app, the paths came from a HashMap - I have
no clue why, but when I changed that and put in the paths as constant values at
compile time, the problem ceased to exist. I am aware that this seems strange
but if someone else encounters a similar problem - who knows, maybe this will 
help.

At any rate - I have said it before, but cannot overemphasize it - thanks a
great deal for your interest and your support in this matter! 

Best regards,
Lutz



Re: Unwanted removal of attribute suffix in Tomcat environment

2008-07-06 Thread Lutz Harder
Hi Thierry,

you were perfectly right, using the 1.1 libraries and sending the requests
properly as described by you did the trick in the test application.

Unfortunately, in the more complex real app, I am still having the original
problem - so far I have not been able to find out where the decisive difference
is: the resource returns the name of the given variable without the ending when
it is a known mime-type. I will have to keep looking. 

Just to give me another clue - what has changed in terms of "tunnelService and
the extension filter" that you mentioned in your first response? What happens in
processing before the original request is passed on through the framework?

At any rate - thanks a lot for your help and the time you have spent on this! 

Best regards,
Lutz




Re: Unwanted removal of attribute suffix in Tomcat environment

2008-07-02 Thread Lutz Harder
Hello Thierry,

thanks a lot for responding so quickly and for your help - I greatly 
appreciate it!

Apparently, you were at least partly right about the libraries - changing 
them to the newer version 1.1 (Test) has changed the behavior - but it is 
still not the way it should be...

I have prepared a very small WAR file to illustrate the problem - if you 
are willing to download it, it should help to clarify the problem (< 500 kB,
Source code and libraries included): http://www.leonidat.de/test.war

Having updated the libraries at first seemed to do the trick - the endings 
were accessible. However, once you send a request such as
 "http://myserver/maypp/test/foo/bar.html/"; (with a "/" at the end), the old
problem is back again. You never get a suffix after one such request with a
trailing "/" until you restart the server or redeploy the application.

To illustrate that, I have prepared three examples in the WAR, just deploy it 
in your tomcat, navigate to "http://localhost:8080/test/"; and try the three 
links I have provided. Examples 1 and 2 will work fine. After clicking the 
third link, the other two will have changed their behavior...

Any idea how to avoid that strange behavior? Obviously, I would not like to
rely on the hope that nobody will ever send a "wrong" request to the 
service...

Thanks a great deal for your support!

Cheers,
Lutz 



Unwanted removal of attribute suffix in Tomcat environment

2008-07-01 Thread Lutz Harder
Hi,

being fairly new with Restlet, I have encountered a problem 
when trying to run an application in Tomcat via the
com.noelios.restlet.ext.servlet.ServerServlet
that runs fine standalone:

I am routing GET requests such as:
http://myserver/myapp/foo/mypic.gif

to a corresponding FooResource:

Router router = new Router( getContext() );
router.attach( "/foo/{filename}", FooResource.class );

In the handleGet() method of FooResource, I need to 
access the "{filename}" attribute:

public void handleGet()
{
  String name = ( String ) getRequest().getAttributes().get( "filename" );
  ...
}

When running the application standalone, I get name = "mypic.gif" - everything
as expected.

Running the same code in a Tomcat 5.5 or Tomcat 6.0, however, the code results
in name = "mypic" - the suffix is omitted.

To my surprise, this is only the case for some endings, e.g. ".gif" or ".html". 
Endings which are (apparently) not connected to known mime types, such as 
".xyz" are passed on correctly. 

I use the following web.xml to run the application under Tomcat:


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";>



 org.restlet.application
 de.myapp.MyApplication




  RestletServlet
  com.noelios.restlet.ext.servlet.ServerServlet
  




Is there anything I can do to ensure that under Tomcat, too, 
I get the complete name including the suffix? I would greatly 
appreciate any help anyone can provide.

Thanks in advance,
Lutz