File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes OGNL and dinamic s:url Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "OGNL and dinamic s:url" Watch "OGNL and dinamic s:url" New topic
Author

OGNL and dinamic s:url

Moli molina
Greenhorn

Joined: Apr 07, 2010
Posts: 19
Hi at all!

Hi have a question about how to use s:url and s:property.
My question : I need to use s:url to get the url of my image.



This works , but the Url are inapropiate, because it do not include the aplication name...
on other images of the page I use this code
and It works.

How I get a correct s:url including a s:property?

Many Thanks
Jose






Moli molina
Greenhorn

Joined: Apr 07, 2010
Posts: 19
I've found the solution.
I use

By mistake I was trying with <img src='<s:url value="/img/app/{%icon}.png"/>'/>.....

Thanks
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9321
    
  17

This can also be made to work if you use this
${pageContext.request.contextPath} will add the "application name" or the context path to the image location...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Moli molina
Greenhorn

Joined: Apr 07, 2010
Posts: 19


I'll try with your solution.

Many Thanks Ankit,
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: OGNL and dinamic s:url