This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSF and the fly likes How to include an external link ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "How to include an external link ?" Watch "How to include an external link ?" New topic

How to include an external link ?

chen young
Ranch Hand

Joined: Sep 09, 2005
Posts: 188

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?

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15960

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.

Customer surveys are for companies who didn't pay proper attention to begin with.
chen young
Ranch Hand

Joined: Sep 09, 2005
Posts: 188
Thank you
I will look for some other solution.
I agree. Here's the link:
subject: How to include an external link ?
Similar Threads
problems with <f:subview>
JSF Template
Forcing JSF to output malformatted HTML
working with panelGrid
Needing to build jsf page with three content panes (forms?), looking for template