Spring framework & URI.

Associate
Joined
27 Nov 2002
Posts
2,497
Location
Ireland
Hello,

I am working through the Spring MVC step by step pdf that comes with spring framework. I am having trouble understanding how the spring-form.tld is accessed. I can delete

<jsp-config>
<taglib>
<taglib-uri>/spring</taglib-uri>
<taglib-location>/WEB-INF/tld/spring-form.tld</taglib-location>
</taglib>
</jsp-config>

from the web.xml file and it has no effect on the app.
I had a look around and found another copy of the file in
\spring-framework-2.5.4\src\org\springframework\web\servlet\tags\form. I then thought that

<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>

might be somehow referencing the above location but again when i deleted the file, spring-form.tld, the appliction worked fine.

So i guess what i am really asking is what is the URI doing?

cheers.
 
Hi,

From what I've read the taglib provides Spring-specific tags for the various HTML items e.g form, input etc. So, rather than just use the standard HTML object the item defined in the taglib is referenced.

This enables Spring to map the fields on the screen to their values in the beans etc. Not using the taglib might not have any immediately obvious effects but will probably have effects further down in your code (effects that I'd figure would most likely be bad).

At least that's what I understand it to be doing.

Jim
 
Back
Top Bottom