• Post Reply Bookmark Topic Watch Topic
  • New Topic

jsp:include action

 
Rashmi Umre
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I would like to include the static contents .html files into my jsp. All static contents are available in the Apache Web server.
We are using APACHE 2.2.4 and JBOSS 3.2.7. All dynamic contents in the Jboss server and static contents are in Web server due to performance issue.

I am using below syntax to include in jsp.
<jsp:include page="/news.html" flush="true" />

This news page is changing daily based on the activities. I am not getting any error, but the contents are not including. When I will use JSP directive then I will get below error.
ServletException in:/lottery/fr/loterie/news.jsp] /lottery/fr/loterie/news.jsp(47,0) File "/lottery/fr/loterie/news.html" not found'

I would like to use the jsp:action because of the days to day changes on news item.

APACHE httpd.conf files has set for the below

RewriteEngine on
RewriteCond %{REQUEST_URI} !.*\.(gif|png|jpg|pdf|js|css|swf|html)$
RewriteRule ^/(.*) balancer://esi_loadbalancer/$1 [P] lbmethod=byrequests nofailover=On


Can you help me on this?
 
Suman Sharma
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried the value of page attribute without forward slash?
<jsp:include page="news.html" flush="true" />
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Suman Sharma:
Have you tried the value of page attribute without forward slash?
<jsp:include page="news.html" flush="true" />


Blindly trying different variations without understanding the nature of the problem is rarely helpful.

Where is the news file in relation to the web application? The include action can only be used for resources within the same web app.
 
Rashmi Umre
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We have the news.html file in the WEB Server (APACHE Web Server 2.2.4). All static contents are resided here. JSP files are in the JBOSS Server, which try to includes the news.html file. All request route via the WEB to APP. But for th include, it tries to locate in the same APP server that file.
There is any other way to route the request through web for jsp:include action?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd use the <c:import> JSTL action, which can include resource from other web apps. Be sure that the URL you supply is server-relative if the JBoss and APache servers are on the same machine, or absolute if they are on different servers.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!