How is the viewtool method VelocityWebUtil.doesVelocityResourceExist() supposed to work?

14 views
Skip to first unread message

Rahul Patel

unread,
May 24, 2022, 6:59:52 PMMay 24
to dotCMS User Group
I'm trying to use this method as follows:

```
$velutil.doesVelocityResourceExist("${dotTheme.path}my_custom_file.vtl")
```

The file definitely exists but it always returns false.  How is this supposed to be call?

I do see the following in the logs:

dotcms_1         | 22:57:09.447  WARN  services.DotResourceLoader - filePath: /application/themes/my_theme/my_custom_file.vtl, msg:cannot find resource @ url:GET//www.example.com/ | lang:1 | ip:172.20.0.1 | Admin:false | start:05-24-2022 01:25:42 GMT  ref:http://localhost:8080/
dotcms_1         | org.apache.velocity.exception.ResourceNotFoundException: cannot find resource


The use-case is that we're trying to check for the existence of file to see if it should be `#dotParse`d otherwise we fallback to a default file.
Reply all
Reply to author
Forward
0 new messages