• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Static content

 
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 <h:outputText 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>
 
Saloon Keeper
Posts: 27764
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic