• Post Reply Bookmark Topic Watch Topic
  • New Topic

include external html in the jsp  RSS feed

 
Dora Di Donato
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello guys,
someone give me an help to include an external htm in the jsp.I used the <c:include> or the <c:import> but they no good because put the context path.

I have for example:
<c:when test=${metaTag eq "metatag_gioco.html"}>
Here i need include my html to see the metaTag
</c:when>

The html : metatag_gioco.html

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="description" content="Su Bingo Club di Lottomatica trovi il nuovissimo Gioco di Bingo e tutti i migliori Chat Games. Gioca a Bingo con i tuoi Amici su Lottomatica e fai Jackpot!" />
<meta name="keywords" content="bingo, jackpot, bingo online, gioco bingo, bingo gratis, sale bingo, bonus bingo, chat games, download bingo, cartelle bingo, bingo free, bingo italia, jackpot bingo, giocare a bingo, giochi bingo online." />
<meta name="language" content="it" />

Someone can help me.

Thanks

solage
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the file is external to the web app, then <c:import> is the means to include external resources. There is no such tag as <c:include>. But if you meant <asp:include> then that's inly for internal resources.

sol age wrote: the <c:import> but they no good because put the context path.

No, you can use any URL.
 
Dora Di Donato
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can give me an example?the folder where is the file is:?/alfresco/metaTag/mamefile.html and I try ti write in the tag url=%{alfresco}/bingo/metaTag/namefile.html and this is the error:the path /bingo/alfresco/bingo/metaTag/namegile.html mot available.

Thank you
Sol age
 
Stefan Evans
Bartender
Posts: 1836
10
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For security reasons, the server will only serve/include files under its context with the standard include tags. So you can't go trawling the hard drive with an include tag.

The <c:import> tag is smart in that you can include an HTML page from another server by specifying a complete url: eg http://www.coderanch.com
If it doesn't start with http://, then it is presumed to be a local resource and uses the standard RequestDispatcher within context.

If you want to pick up a file from outside the web context, you are going to have to do some custom coding, and use a servlet to load the file from disk, and send it out the ServletOutputStream.
IMO it is normally better to have everything under the web context rather than hacking around a solution like that.

 
Dora Di Donato
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok so you suggest me write cide hava in the jsp to get the file?
What is IMO?
thank you very much for you reply
Sol age
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!