This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes JSF and the fly likes Static content Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Static content" Watch "Static content" New topic
Author

Static content

Michal Glowacki
Ranch Hand

Joined: Mar 14, 2006
Posts: 114
hi,

for performance reasons, I would like some of my images, flashes etc to be served by Apache which is fronting my JBoss. The problem is, that those images are uploaded to web site by operators, so I can not make static link in JSP. So I made an approach:

I upload file to apache static content directory, save the file name and it's target page in database. Then in JSP page I use <hutputText escape="false"... which is generating html code for > with correct source (URL to static files + filename from database). Is it the best solution? I was wondering how to eliminate database between.

The reasons I am changing this are: the resources are not cached because now I am reading them from database using <input type="image" and servlet, and to reduce number of requests to JBoss (Tomcat).

Any tips or links much appreciated.

Thanks,
Michal>
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16022
    
  20

I got a little confused towards the end of that, but no, I don't really recommend using "escape=true" in outputText except in very rare cases. I believe there's a JSF h:outputLink tag or something like that that would be more what you want. Note that this is NOT the h:commandLink tag, which is designed to submit requests to JSF.

You could always jam in a raw HTML "a" tag, but that's also not something I recommend doing if you have any choice in the matter.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Static content