Getrealpath returns null tomcat




















Such changes are to be expected across major versions and certainly do not qualify as bugs. If these changes are causing problems, then they can be added to the migration guide. I'm not convinced that that argument is valid since there is nothing I see in the specs or the Javadoc to support it. Just a few thoughts: 1.

There is nothing in the spec which tell that getRealPath must start with a slash. At least not as far as I can see.

IMHO the spec for the whole servlet api is fubar anyway So the new behavior is not more strict but just different. The leading slash in the path of urls is kind of inexistent anyway. In complete urls there is no "leading slash". Just a separator between the host and the path 4. On the other hand throwing an exception would be the right thing to take in this case.

The spec says: "This method returns null if the servlet container cannot translate the virtual path to a real path [ The key here is "cannot". How it stands right now it is a "doesn't want to". Exception exception, java. String msg Deprecated. This method was originally defined to write an exception's stack trace and an explanatory error message to the servlet log file.

String msg Writes the specified message to a servlet log file, usually an event log. String message, java. Throwable throwable Writes an explanatory message and a stack trace for a given Throwable exception to the servlet log file.

I can understand that you guys all have your reasons for wishing to stay with TC - but there is always the option of going with Jetty - you may be pleasantly surprised. At the very least, give it a try. You will benefit by cross-referencing against another implementation of the spec, so your app becomes more portable. You might just choose to use Jetty while you wait for TC bug-fixes to filter through, or you might find you like it and stay with it Jules Jetty Evangelist! I am trying out Jetty.

In terms of compilation of jsp, it seems to be a little slower than Tomcat. Is there a release of jboss3. X that comes bundled with jetty? There only appears to be jboss If you deploy a war file with the manager from a different location it will not. Doing so creates non-portable webapps. It's better to make the location of upload dirs, etc configurable with servlet or context init params and keep the location outside of the webapp.

Hi, Thanks for the reply from everybody. I have tried even adding my application context name, that doesn't work too. If we cannot access directories in war file using getRealPath..

However, thanks for your help.



0コメント

  • 1000 / 1000