File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
JavaRanch » Java Forums » Java » JSF
Bookmark "How to include an external link ?" Watch "How to include an external link ?" New topic
Author

How to include an external link ?

chen young
Ranch Hand

Joined: Sep 09, 2005
Posts: 190
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

Joined: Jun 25, 2001
Posts: 16061
    
  21

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: 190
Thank you
I will look for some other solution.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to include an external link ?