• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

including content from webserver in JSP

 
Mallik Avula
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • 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.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65124
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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
  • 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
Author and ninkuma
Marshal
Pie
Posts: 65124
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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
  • 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
Author and ninkuma
Marshal
Pie
Posts: 65124
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That cannot work. The page must be available via server, not the file system path.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic