• 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

including content from webserver in JSP

 
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
All,

Am working with application where we are using webserver for content like images, CSS, JS..etc and Appserver for application code.

We are placing all images and able to display in the pages properly. Now we planned to move some static html files as well into the webserver. But, we we used include directive or jsp:include, it is not working.

Any help will greatly appreciated.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You haven't given us any information that we can use.

But my guess is that you are using page-relative URLs to the various resources. That's fragile and brraks easily.
 
Mallik Avula
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:You haven't given us any information that we can use.

But my guess is that you are using page-relative URLs to the various resources. That's fragile and brraks easily.



Here is some more information for you.

Assume that header and footer are totally static content. So, I made those as html files - header.html, footer.html

Now, Instead of placing these files in the ear, I want to place in the webserver(Apache) /static directory under htdocs. So that we can change the content without redeploying the ear file.

So, I need to include these files in each page means JSP.

If I say like,


I am getting exception like header.html not found. As I know, it is trying to find the header.html file in the application context path and failed.

My question is: How can I say this file fetch from webserver documents means from /static/header.html from htdocs.

Hope this helps to clarify/help me on this.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Use <c:import> and specify the full path to resource.
 
Mallik Avula
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We have tried using c:import. In my scenario, i want to include a jsp page from physical location. (say for eg: C:\DynamicPages\ ). If there is any solution. Please help..
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That cannot work. The page must be available via server, not the file system path.
 
No matter how many women are assigned to the project, a pregnancy takes nine months. Much longer than this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic