Details
-
Improvement
-
Status: Closed
-
Low
-
Resolution: Fixed
-
2.04.06
-
None
-
None
-
Does not occur in the current default HST setup, but if you upgrade Spring to v 3 for some application containers like JBoss you'll run into this problem. Spring 3 was necessary for virtual filesystem support in JBoss 5.
Description
In the component config
hst:parametername pagetype
hst:parametervalue ${pagetype}
In the sitemap matcher: no hst:parametername/hst:parametervalue
In the component class:
String pagetype = getParameter("pagetype", request);
getParameter gets an IllegalArgumentException because the underlying classes get ${pagetype} instead of null.
If you remove the hst:parametername/hst:parametervalue pair from the component config String pagetype is null (which is good).
Sometimes you want to set the configuration parameter in the component but if no value is passed from the sitemap, you can use some default value (which may be hardcoded in your component class).