I have a web application that uses enlive.
If I change an html file used by a template I don't see the changes unless I restart figwheel.
I am using ring.middleware.reload/wrap-reload like this:
(-> routes
(ring.middleware.reload/wrap-reload {:dirs ["src" "resources"]})
...
...but without any effect.
Note that if I change any .clj or .cljs file I don't have to restart the server.
Following the link given by Piotrek I found this project which fixed my issue: https://github.com/kolov/enlive-reload
The fix was to wrap the routes with (wrap-enlive-reload) and now everything works just fine.
Related
I've tried loading a local html file using webkit_web_view_load_uri() with a file:// URL. However, the webview would display a blank page. To circumvent this, I tried using webkit_web_view_load_html() and it worked correctly.
Now that I'm trying to load some images in the html using the <img> tag, the images aren't loaded (It displays a blank page).
I'm puzzled because I tried before (~ 2 months ago) a similar method and it worked.
Note: I copied the contents of the generated HTML into a file and loaded it with Firefox and it worked as it should (The images are visible), but with another WebKitGtk application I had lying around the images didn't load.
Note: I'm using C++ as the main programming language (I'd prefer having C++ types in the solutions only if possible)
Note: I have set webkit_settings_set_allow_file_access_from_file_urls() and webkit_settings_set_allow_universal_access_from_file_urls() to TRUE
Ok, I've managed to solve this. The solution had NOTHING to do with webkitgtk, which is strange. It seems that the application was trying to download the page instead of loading it. This traces to a faulty MIME type database.
Tl;Dr:
Execute this:
rm ~/.local/share/mime/packages/user-extension-html.xml
update-mime-database ~/.local/share/mime
and use webkit_web_view_load_uri() instead of webkit_web_view_load_html() with a file:// URI
I had the same problem in C. You have to explicitly set file:// as base_uri when you call webkit_web_view_load_html().
See also answer here
In order to play around with search engine friendly urls, I have added the following mappings to my web.xml:
<servlet-mapping>
<servlet-name>CFMLServlet</servlet-name>
<url-pattern>/mywebsitename.com/index.cfm/*</url-pattern>
<url-pattern>/mywebsitename.com/posts/*</url-pattern>
</servlet-mapping>
This has allowed me to work with urls like this mywebsitename.com/posts/my-first-post
However, one little glitch is occurring. If I try and access a CFC file that was working before, it now simply returns the html text of that CFC instead of actually processing it in Railo.
To explain it better, if I add the servlet-mapping above to web.xml and call mywebsite.com/Components/CFCProxy.cfc - the html of that cfc is returned.I would expect to see a Railo dump of the functions.
However, if I remove the servlet-mapping from the web.xml file, then when I access that same URL, I see the proper railo dump of the CFC functions that can be called, which is what I expect to see.
So without the servlet-mapping it works fine, but with the servlet, only html text of the CFC is returned.
So my guess is that by adding the servlet-mapping, I am disabling the processing of that CFC by Railo somehow.
So all I would like to know is how to get that CFC file to process properly again?
Do I need to add another line to the servlet-mapping for that and if so, what?
Thanks
I ran into this same issue recently.
Try adding
<url-pattern>*.cfm</url-pattern>
<url-pattern>*.cfc</url-pattern>
I am using enlive for my web development. I start my ring server in repl using (serve my-app/handler)
However when I make changes to any of my html templates I have to restart my repl for the changes to show up. How do I reload my markup without restarting the repl ?
Thanks,
Murtaza
You need to reevaluate lines that read the template. For example in my project I would have to reevaluate ("C-x C-e" in Emacs) the following line:
(def table-template (h/html-resource "META-INF/web/table.html"))
If you don't use Emacs you could try require namespace that contains templates with :reload, please see this: force clojure :reload
I am using Grails 1.3.7 and deploy to JBoss 5.1.1. when I try to access a page myPage.gsp in one of the plugins. I got the Template not found error.
the page is working ok when using grails run-app. and the template file are definitely in th correct location and it is NOT missing.
I had searched around this issue, there is nothing really out there. I am new to Grails, I cant understand why this file is not found as it is there.
File structure as following:
grailsPlugins
myplugin
grails-app
views
templates
_myTemplate.gsp
mypages
myPage.gsp
in the myPage.gsp, I have a line like this:
<g:render template="/templates/myTemplate"/>
Can anyone help on this?
I've encountered this same issue before, so just for reference for others, while adding the optional attribute plugin="myplugin" works to resolve the plugin location, it won't allow the application that installs the plugin to customize the myTemplate template(if there is ever a need to as there was in my case!)
I found that copying the templates over to the application on install or via a script, just like Spring Security copies login template when you run the s2-quickstart was the easiest way to completely resolve the issue.
I am not a ColdFusion coder. Doing a favor for a friend who ported his CF site from a Windows server to Unix on GoDaddy.
Site is displaying error:
Cannot find CFML template for custom tag jstk. ColdFusion
attempted looking in the tree of installed custom tags but did not
find a custom tag with this name.
The site as I found it has at document root /CustomTags with the jstk.cfm file and a set of files in cf_jstk
My Googling located this:
You must store custom tag pages in any one of the following:
The same directory as the calling page;
The cfusion\CustomTags directory;
A subdirectory of the cfusion\CustomTags directory;
A directory that you specify in the ColdFusion Administrator
So I have:
Tried creating placing /CustomTags in /cfusion/CustomTags
Tried copying /cfusion/CustomTags to above document root
Tried copying jstk.cfm and subfolders into same directory as calling file(index.cfm)
Update: Per GoDaddy support I have also tried adding the following to no effect: <cfmodule template="CustomTags/jstk.cfm">
Can any one give me some tips on this or should I just tell my guy to look for a CF coder?
Thanks!
I don't know how GoDaddy is setup, so as a quick test, please do the following:
Create file test.cfm in the webroot with contents:
<cf_testtag/>
<cfoutput>test</cfoutput><cfabort/>
Create file testtag.cfm in the webroot with contents:
<cfdump var=#ThisTag# />
Then in a browser visit the test.cfm page.
You should get two debug dumps, followed by the 'test'; this will confirm that custom tags in general are working.
If that works move the testtag.cfm to the CustomTags directory, and see if you get the same behaviour or an error.
If this produces an error, for CF8 and above, you can add <cfset This.CustomTagPaths = "/CustomTags" /> inside the Application.cfc file (assuming there is a App cfc and not an Application.cfm) to ensure that directory is checked for tags.
It is possible to convert Application.cfm to Application.cfc - how easy this is depends on how complex the code is in there - might be something you could figure out, or might need an experienced CF dev, it depends.
Depending on the outcome of this, we can attempt to debug why the jstk tag isn't working (unless one of the above solves it).
In an effort to check the simple things before worrying about complex things:
Remember that filenames on *nix systems are case sensitive, but on windows are not.
For example, a windows server will pick up "application.cfm" but a linux server won't. It requires "Application.cfm".
Check to make sure all filenames/paths are the correct case.
Normally, CFML check every custom tags in current directory first, if not found, second is in CFMX8/customtags/.