I am redirecting an uploaded image in grails like so:
Controller:
def upload() { def f = request.getFile('myFile') if (f == null | f.empty) { flash.default = "file cannot be empty" errors.getFieldError("cannot be empty") return } def fName = f.getOriginalFilename() def picture = new Picture(orgName: fName, urlOrg: "http://localhost/"+fName) f.transferTo(new File('/Users/sagarmichael/Desktop/photoUpload/'+fName)) println("saved") redirect(action: 'test', params: [url1:picture.urlOrg] ) } def test(){ System.out.println(params.url1) [url1:params.url1] } I would expect this to then send url1 to my view called test where I have this:
<img src="${url1}"/> I would expect this to then show the image on screen. I have the apache2 config set correctly and when i go to
http://localhost/<imageName> it works correctly.
What I am getting is this in the url bar on the browser:
http://localhost:8080/FYP/profile/test?url1=http%3A%2F%2Flocalhost%2Flonglogo3.png any ideas?