Can not access the images from the webapp folder in Grails 3 - grails

I'm using grails 3.2.7 application and I can't access the images in the webapp folder
I tried to set some images in the auth.gsp (spring-security-core) But it is not getting displayed.
Here is the code
<img height="100" width="252"style="background-color: #556a7f"
src="${resource(dir: 'images', file: 'Standout-Logo-2.png')}"
class="img-responsive" alt="Utility Application" />
Can someone help?
Here is the folder structure

Related

Universal Viewer 2.0.2 build process

Something has changed in the latest UniversalViewer (https://github.com/UniversalViewer/universalviewer)
Previously the build process would build all files into a uv/build/uv-xx-xx-xx directory. Which could then be moved as required and used something like so:
<div class="uv" style="min-width:750px; min-height:750px; height:100%; max-height:100%; margin:0 auto; background-color: #000"
data-fullscreen="0"
data-assetsequenceindex="0"
data-assetindex="0"
data-locale="en-GB:English,cy-GB:Welsh"
data-uri="/<?php echo $partner; ?>/<?php echo $identifier; ?>/manifest"
<?php echo $extra; ?>
></div>
<script type="text/javascript" id="embedUV" src="/packages/uv/build/uv-xx-xx/lib/embed.js"></script>
</body>
</html>
Unfortunately the build process appears to have changed but not been documented fully. Compiled js files now appear in the src/ directory and a .build/ directory.
If I use the whole uv/ directory, there is an error that uv.js is missing.
If I use only the uv/.build/ directory. Then the embed.js is missing.
What is the correct procedure after running grunt build --dist to now get the above php file working again?
After running grunt build in UV3, you will nee to copy over the ./examples directory and that should function similarly.

Jenkins upload artifact to nexus plugin not working with Nexus 3

I have a Jenkins project that does a gradle build and uploads build artifacts to a Nexus maven hosted repository using the Jenkins upload artifact to nexus plugin. This was working fine when I was using Nexus 2.13 - but after upgrading to Nexus 3, the upload to Nexus is no longer working. I have made sure that I have configured Nexus 3 repository just like my Nexus 2.13 repository. When I build my Jenkins project I get a response
GroupId: com.company
ArtifactId: hello-world-util
Version: 1.0.0
File: hello-world-util-1.0.0.jar
Repository:companyDevops
Uploading artifact hello-world-util-1.0.0.jar started....
Reason Phrase: Method Not Allowed
<!DOCTYPE html>
<html>
<head>
<title>405 - Nexus Repository Manager</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<!--[if lt IE 9]>
<script>(new Image).src="http://192.168.99.100:18081/favicon.ico?3.0.1-01"</script>
<![endif]-->
<link rel="icon" type="image/png" href="http://192.168.99.100:18081/favicon-32x32.png?3.0.1-01" sizes="32x32">
<link rel="mask-icon" href="http://192.168.99.100:18081/safari-pinned-tab.svg?3.0.1-01" color="#5bbad5">
<link rel="icon" type="image/png" href="http://192.168.99.100:18081/favicon-16x16.png?3.0.1-01" sizes="16x16">
<link rel="shortcut icon" href="http://192.168.99.100:18081/favicon.ico?3.0.1-01">
<meta name="msapplication-TileImage" content="http://192.168.99.100:18081/mstile-144x144.png?3.0.1-01">
<meta name="msapplication-TileColor" content="#00a300">
<link rel="stylesheet" type="text/css" href="http://192.168.99.100:18081/static/css/nexus-content.css?3.0.1-01"/>
</head>
<body>
<div class="nexus-header">
<a href="http://192.168.99.100:18081">
<div class="product-logo">
<img src="http://192.168.99.100:18081/static/images/nexus.png?3.0.1-01"/>
</div>
<div class="product-id">
<div class="product-id__line-1">
<span class="product-name">Nexus Repository Manager</span>
</div>
<div class="product-id__line-2">
<span class="product-spec">OSS 3.0.1-01</span>
</div>
</div>
</a>
</div>
<div class="nexus-body">
<div class="content-header">
<img src="http://192.168.99.100:18081/static/rapture/resources/icons/x32/exclamation.png?3.0.1-01"/>
<span class="title">Error 405</span>
<span class="description">Method Not Allowed</span>
</div>
<div class="content-body">
<div class="content-section">
HTTP method POST is not supported by this URL
</div>
</div>
</div>
</body>
</html>
My Jenkins nexus upload is configured like (and this has not changed between Nexus 2.13 and 3)
Upload artifact to nexus
Nexus Details
Protocol HTTP
Nexus URL 192.168.99.100:18081
User admin
Password admin123
Credentials com.company
GroupId com.company
ArtifactId hello-world-ui
Version 1.0.0
Packaging jar
Repository companyDevops
File build/libs/hello-world-util-1.0.0.jar
My Nexus 3 maven hosted repository is configured like
Name companyDevops
Format maven2
Type hosted
URL http://192.168.99.100:18081/repository/companyDevops/
Online
Maven 2
Version policy Release
Layout policy Strict
Storage
Blog store default
Strict content type validation X
Hosted
Deployment policy Allow redeploy
Not sure why I’m getting this error
-I’ve validated that the Nexus admin user has permission to upload artifacts
-I’ve validated that allow redeploy is enabled
What might be happening
-possibly the Jenkins ‘upload artifact to nexus’ plugin is not compatible with Nexus 3?
Has anyone got this to work with Nexus 3? Any suggestions?
Thanks!
Nexus Artifact Uploader plugin now supports Nexus-2.x & Nexus-3.x.
Support for Nexus-3.x with plugin version 2.6
https://wiki.jenkins-ci.org/display/JENKINS/Nexus+Artifact+Uploader
Please use "Nexus Artifact Uploader", below is the url and also support nexus 3 as well.
https://plugins.jenkins.io/nexus-artifact-uploader
After the installation of plugin, we would get nexus artifact uploader in build section.
This plugin doesn't support Nexus-3.x, We are working to provide capability uploading artifacts to Nexus-3.x

UmbracoAzureBlobStorage - Files lost after some times Using Umbraco 7

I have a project that uses a combination of these tools:
==================================
Azure website
Azure Blob
Azure CDN
UmbracoAzureBlobStorage - 1.0.10.5 - https://github.com/idseefeld/UmbracoAzureBlobStorage
WindowsAzure.Storage - 4.3.0
Umbraco - 7.2.5 assembly: 1.0.5610.18894
idseefeld.de.UmbracoAzure - 1.0.0.0
https://our.umbraco.org/projects/backoffice-extensions/azure-blob-storage-provider/
==================================
config/FileSystemProviders.config
<FileSystemProviders>
<!-- Media -->
<Provider alias="media"
type="idseefeld.de.UmbracoAzure.AzureBlobFileSystem, idseefeld.de.UmbracoAzure">
<Parameters>
<add key="containerName" value="media" />
<add key="rootUrl" value="http://az739977.vo.msecnd.net/" />
<add key="connectionString" value="DefaultEndpointsProtocol=https;AccountName=XXX;AccountKey=XXX" />
</Parameters>
</Provider>
</FileSystemProviders>
==================================
The file upload is working as expected at start. But after sometime, and of course few uploads, it looks like our files are deleted from the blob and the CDN cannot serve them anymore.
Is there something I'm missing? I have almost the same configuration in another project and it's working as expected. I tried reinstalling the whole thing but the problem occurs everytimes.
https://our.umbraco.org/projects/backoffice-extensions/azure-blob-storage-provider/ show us configuration that point directly to the blob, not the CDN as I do. Should I take a look at this?
Uninstall-Pacakge UmbracoAzureBlobStorage
Uninstall-Package idseefeld.de.UmbracoAzure
Install-Package UmbracoAzureBlobStorage
Solved the problems. The project referenced the "idseefeld" DLL. It was kinda weird.

How to link to files on local disk from html in JSF 2.0 app

I use tomcat 7.0 and eclispe WTP plugin. I can't reference to file on my local disk.
<h:graphicImage value="C:/tmp/someFile.png"/>
I tried to resolve it by adding in location C:\Program Files (x86)\apache-tomcat-7.0.32\webapps
directory tmp/ and use <h:graphicImage value="/tmp/someFile.png"/>
I tried also add from eclipse to tomcat file: server.xml <Context docBase="C:/tmp" path="/tmp" />
<Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true">
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" pattern="%h %l %u %t "%r" %s %b" prefix="localhost_access_log." suffix=".txt"/>
<Context docBase="myProjectName" path="/myProjectName" reloadable="true" source="org.eclipse.jst.jee.server:myProjectName"/>
<Context docBase="C:/tmp" path="/tmp" /></Host>
and reference to file in the same way <h:graphicImage value="/tmp/someFile.png"/>
In result I have HTTP Status 404. description The requested resource is not available.
How Can I resolve it ?
Thanks
The <h:graphicImage> automatically prepends the context path of the current webapp in the URL. If you'd have looked at the generated HTML output and/or the HTTP traffic monitor in webbrowser's builtin webdeveloper toolset, you'd have noticed it.
Just use plain HTML <img> element instead.
<img src="/tmp/someFile.png" />
"webapp" directory serves as the root directory of your application when you deploy it (ideal practice). So if you use path (url) "/tmp/someFile.png" to access file someFile.png, then you must put the file in "/src/main/webapp/tmp/someFile.png" and after deployment put the contents of "webapp" into root directory of your application.
So basically just make sure that "tmp" is in your applications root directory.
If you want to use filesystem. You can see this answer here.

Making Glassfish respond to ajax request JSF 2

I'm trying to do an ajax request to my server (Glassfish v3.1 open source edition) and for any reason the request never go to the server, running the same proyect on tomcat 7 it works correctly, there's any configuration that i should make on glassfich or anything??
im using eclipse helios, jsf 2 MyFaces 2.1.1, richfaces 4.0.0, and glassfish 3.1 open source edition
here's my code
<h:panelGroup>
<h:inputText id="firstName"
value="#{RegistrationForm.first_name}"
required="true"
requiredMessage="Please enter your first name">
<f:converter converterId="bankingCore.UpperCaseConventer for="firstName"/>
<f:ajax event="blur" execute="#all" render="#form"/>
</h:inputText>
<h:message id="NameError" for="firstName" styleClass="errorClass"/>
</h:panelGroup>
Glassfish as being a full Java EE implementation ships with a JSF implementation (Mojarra) already bundled. Glassfish will auto-load it before your webapp. But since you bundled a different JSF implementation (MyFaces) in your webapp, it will collide. Tomcat is a simple JSP/Servlet container and does not ship with JSF bundled so there's also nothing which will collide (until you drop some JSP/Servlet libraries of a different implementation/version in your webapp).
You have 2 options:
Get rid of MyFaces libraries in your webapp. Your webapp will only not run on Tomcat anymore without changing Tomcat's shared classpath to include JSF libraries.
Tell Glassfish to not load its bundled JSF implementation but to use the webapp-bundled JSF instead. Edit the /META-INF/sun-web.xml file in your webapp to contain the following lines:
<class-loader delegate="false" />
<property name="useBundledJsf" value="true" />

Resources