Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to include an external link ?

 
chen young
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

In order to add a jsf file to the main frame I am using <ui:include> for example:


The problem is that I need to add an outside file (http://ip:7001/outside.jsf) to the main frame.
How can I add a link so I can see that the file has an inside file in the main frame?

Thanks
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18277
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://ip:7001/outside.jsf is NOT a file.

It is a URL. There is a major difference. For one thing, no such file as "outside.jsf" exists anywhere and no file explorer or command-line directory tool can find it. If you pass that URL to the appserver at "ip", the appserver will analyze the URL, send it to a webapp, the webapp will analyze it further, and generate output based on the analysis.

The consequences of this critical difference are as follows:

1. Because the appserver at "ip" is not serving a file, but instead resolving a URL, what comes back from "ip" won't be xhtml source, it will be an actual webpage in HTML.

2. Because http://ip:7001/outside.jsf is a URL and not a file path, any function that attempts to open and read files (such as the "include" directive) will fail

What you are really looking to do is embed one bit of generated HTML inside another bit of HTML. There are several ways to do that. Portal servers do so using Portlets, but Portlets are specialized objects and we have a forum just for them. Another way is to use a construct such as HTML frames or IFRAMEs. That has to be done carefully, however, as JSF doesn't really like frames very much.
 
chen young
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you
I will look for some other solution.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic