|
From: <jue...@we...> - 2003-08-26 14:42:43
|
Hi Martin,
PathMatcher works Ant-style, actually its code is even ripped from the =
Ant codebase ;-)
This means that "/journal/entry/*" will just map URLs in the same =
directory, i.e. "/journal/entry/myentry" but not =
"/journal/entry/mysubdir/myentry". You need to map "/journal/entry/**" =
to map any sub directory.
Juergen
-----Original Message-----
From: Martin Hald [mailto:mar...@ya...]
Sent: Monday, August 25, 2003 10:43 PM
To: Spring Developer
Subject: [Springframework-developer] Url Mapping Problem
Hi All,
Thanks to Jean-Pierre the for the alwaysUseFullPath suggestion. It did
solve my problem where I was mapping /foo/[a-z]* to a servlet, but I am
running into another quandary.
When I map longer URL's the code seems to break. I am trying to map
/journal/entry/2003-aug10/test/DSCN5023.jpg
to a web form. My project-servlet.xml looks like:
<bean id=3D"urlMapping" class=3D"...">
<property =
name=3D"alwaysUseFullPath"><value>true</value></property>
<property name=3D"mappings">
<props>
<prop key=3D"/journal/entry.html">JournalEntryForm</prop>
<prop key=3D"/journal/entry/*">JournalEntryForm</prop>
...
</props>
</property>
</bean>
and within my web.xml I use the following:
<servlet-mapping>
<servlet-name>project451</servlet-name>
<url-pattern>/journal/*</url-pattern>
</servlet-mapping>
I have tracked down the problem to PathMatcher.java where the =
conditional
"patIdxStart > patIdxEnd" seems to disallow my URL to be properly =
mapped.
As a test I just return true at that spot and everything is fine.
Am I doing something wrong or is there a problem with the path matcher?
Thanks,
Martin
---
PS Here's some debug output from within PathMatcher in that if =
statement:
looking for '/journal/entry/2003-aug10/test/DSCN5023.jpg' in
'/journal/entry/*'
pattern=3D/journal/entry/*
str=3D/journal/entry/2003-aug10/test/DSCN5023.jpg
patIdxStart=3D3
patIdxEnd=3D2
strIdxStart=3D3
strIdxEnd=3D4
returning false 3a
-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines
at the same time. Free trial click =
here:http://www.vmware.com/wl/offer/358/0
_______________________________________________
Springframework-developer mailing list
Spr...@li...
https://lists.sourceforge.net/lists/listinfo/springframework-developer
|