I was wondering whether it's possible to distinguish "parameter not specified" from "parameter is empty". In both cases the Mojo parameter has the value null.

I want the default value to kick in, if the user does not give the parameter, and the empty string, if user gives the empty parameter element.

有帮助吗?

解决方案

If you have a null in case of a string you can assume the user didn't defined it at all otherwise you can assume it had been defined. You can set appropriate default-values for Mojo parameters to distinguish between those cases. Or can you be more specific.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top