Display from another website

Hello all,
I need to display a page from another website in my jsp. I'm using Sitemesh to build the header, footer and layout of the page, but I need to bring a page from another website to display in the body. I have searched the internet and haven't found any good posts/articles/tutorials/ect. on the subject. Could someone please point me in the right directions.
Thanks,

Use a tool that gets data from a URL then sets a JSTL tag. You can use the tag then to place the new content. Please only do this if the site belongs to you. This will be frowned at if not.
Simple class to get a URL
package uk.co.classfinance.curl;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;
* Grabs data from an URL after passing parameters in a POST or GET request
* @author Garry Taylor
public class WebFetch {
     private String Url;
     private String Method;
     private String Response;
     private String PostData;
     public WebFetch() {
          this.PostData = "";
          this.Method = "POST";
     public void setUrl( String value) {
          this.Url = value;
     public void setMethod( String value) {
          this.Method = value;
     public String getUrl() {
          return this.Url;
     public String getMethod() {
          return this.Method;
     public String getResponse() {
          return this.Response;
     public void setPost(String name, String value) {
          String prefix = "";
          if( this.PostData.equals("") ){
               prefix = "";
          } else {
               prefix = "&";
          try {
               this.PostData += prefix + name + "=" + URLEncoder.encode (value, "UTF-8" );
          } catch (UnsupportedEncodingException e) {
               // TODO Auto-generated catch block
               e.printStackTrace();
     public String getRequest() throws IOException {
          URL url;
          URLConnection urlConn;
          DataOutputStream printout;
          DataInputStream input;
          // URL of CGI-Bin script.
          url = new URL (this.Url);
          // URL connection channel.
          urlConn = url.openConnection();
          // Let the run-time system (RTS) know that we want input.
          urlConn.setDoInput (true);
          // Let the RTS know that we want to do output.
          urlConn.setDoOutput (true);
          // No caching, we want the real thing.
          urlConn.setUseCaches (false);
          // Specify the content type.
          urlConn.setRequestProperty
          ("Content-Type", "application/x-www-form-urlencoded");
          // Send POST output.
          printout = new DataOutputStream (urlConn.getOutputStream ());
          String content = this.PostData;
          printout.writeBytes (content);
          printout.flush ();
          printout.close ();
          // Get response data.
          input = new DataInputStream (urlConn.getInputStream ());
          String str = "";
          String result = "";
          while (null != ((str = input.readLine()))) {
          System.out.println (str);
          //textArea.appendText (str + "\n");
               result += str + System.getProperty ( "line.separator" );
          input.close ();
          return result;
}

Similar Messages

  • If I try and follow a link from another website to open another I get awclick.php (GIF Image 1x1) pixels in a new tab instead of the web page I want.

    I was trying to open a website as a link from another website and I get a new tab that says
    awclick.php(GIF Image 1x1 pixels)
    I can open the website without clicking on a link to it by just typing in the address but as this is a cash back site I am linking from it doesn't help!

    You're welcome

  • Why is there no option for a Black ipod anymore/ I've seen the option on other websites, but this website no longer has it. And if I get the Black iPod Touch from another website, will it be old and IOS 6, because the option went away long before IOS 7

    I want a Black iPod Touch Fifth Generation, however I do not see an option for it. I have seen the option before, but it is no longer there, just like the option for a White iPod Touch. I still see the option for a Black iPod on other websites, such as Amazon. I wonder if it will not be updated and slower if I buy it from another websites that sell a Black version, because I think Apple might have eliminated that option for the iPod Touch Fifth Generation.

    No there is the option for a black iPod touch 5th Generation. However, they call it Space Gray now. It provides a black front screen and a slightly gray colored aluminum on the back.

  • How to access a page from another website in to the portlet

    Hai,
    I need this specific requirement. In a portlet that is written in jsp, i need to access another page which is running in another server.I will explain what is my requirement clearly.. In a portlet, i have to acess a page from another site, and i have to pass a parameter directly. If i use URL-Based Portlet with passing parameters, It ask the user to enter the parameter and submit the page.. But what my need is, i have to pass the parameter directly. what i am planning is in a new tab, i will add a portlet, where i need to access the another website page..when the user opens that tab, it directly shows that website..... How do i proceed...
    Can anybody help me.. Its URGENT....
    If possible send me the code..
    my mail id: [email protected]
    Thanks in advance
    damodar

    Damodar,
    To include an existing JSP page as a portlet have a look in the PDK section http://portalcenter.oracle.com there is lots useful information. The two things you might find most relevant is a paper on creating java portlets. This paper has a section on turning an existing JSP page into a portlet
    http://portalstudio.oracle.com/pls/ops/docs/FOLDER/COMMUNITY/PDK/ARTICLES/HOW.TO.BUILD.A.JAVA.PORTLET.USING.PDK.JAVA.V2.HTML
    and to pass parameters and events
    http://portalstudio.oracle.com/pls/ops/docs/FOLDER/COMMUNITY/PDK/ARTICLES/OVERVIEW.PARAMETERS.EVENTS.HTML
    Hope this helps,
    Candace

  • When I open a link from another website ForeFox puts a messagge at the top of the new link saying that it has blocked the websiste from transferring me to a new

    When I open a link for another website Firefox opens a new tab but puts a line on the top of the new page saying that Firefox has blocked the website from transferring me to another page.
    I have to press ALLOW before Firefox will open the new page.
    How can I solve this problem.
    Many thanks in advance.

    hello betth007, in order to get effective help, please open a new question at https://support.mozilla.org/en-US/questions/new instead and include a bit more details about your issue (what kind of error message are you getting, etc.). thank you!

  • Link from another website

    I want to use the iWeb blog software, but I have a website that does not use iWeb. Can I link the iWeb blog from my website?
    Thanks!

    I am assuming that your web site is hosted by another host, and that you also have a MobileMe account with Apple. If taht's the case, here's what I would do:
    1. Create a an iWeb web site with just your Blog page in it, then publish it to MobileMe.
    2. Create a "Blog page" in your other web site's navigation menu and link it to your index.html file which iWeb uploaded to MobileMe.
    If I'm not mistaken, that ought to work.

  • Including a file from another website on a Mac (PHP)

    I'm working on a Mac, and my websites are in a folder at the
    following
    location...
    MacIntosh HD > Users > MyName > Sites
    Let's say I'm working on a page on a website named Beta...
    HD > Users > MyName > Sites > Beta
    ...and I want to include a file from a different website,
    Alpha...
    HD > Users > MyName > Sites > Beta
    This is what the include looks like on my PC, though it isn't
    directed
    to another website:
    $BaseINC = $_SERVER["DOCUMENT_ROOT"];
    include ($BaseINC."/a1/inc/footer/index.php");
    Can anyone tell me how to modify this code so that it
    includes HD >
    Users > MyName > Sites > Alpha > a1 > inc >
    footer > index.php on a page
    in Sites > Beta? (I'm just focused on doing this locally;
    I know how to
    include files across websites online.)
    I assume it would look something like this
    include ("Alpha/a1/inc/footer/index.php");
    Thanks.

    > Can anyone tell me how to modify this code so that it
    includes HD >
    > Users > MyName > Sites > Alpha > a1 > inc
    > footer > index.php on a page
    > in Sites > Beta? (I'm just focused on doing this
    locally; I know how to
    > include files across websites online.)
    Includes are a web server functionality. As such, you'll need
    to place your
    folders inside the default APACHE folders (assuming Apache is
    the web server
    you are running on your mac).
    Secondly, SSIs crossing sites is typically not supported on
    any web server
    AFAIK. Your example would be grabbing a file from a different
    FOLDER,
    though...not specifically a different site (ie, it's own root
    directory on
    the server).
    -Darrel

  • Will not load sites linked from another website--have cleared cache, cookies, history, restarted, checked in Safe Mode--still does not work.

    Some sites load fine. But some sites will not load when linked from another web site, or, occasionally, even from my bookmarks. I went through troubleshooting routine--cleared cache and cookies, history, checked in Safe Mode for extensions, etc., but still will not work in Safe Mode. No other problems with computer or browser.

    What happens when you click the link that does not open up the new page? Is it a blank page? Does this also happen if you Shift Click the link?
    Sometimes a problem with Firefox may be a result of malware installed on your computer, that you may not be aware of.
    You can try these free programs to scan for malware, which work with your existing antivirus software:
    * [http://www.microsoft.com/security/scanner/default.aspx Microsoft Safety Scanner]
    * [http://www.malwarebytes.org/products/malwarebytes_free/ MalwareBytes' Anti-Malware]
    * [http://support.kaspersky.com/viruses/disinfection/5350 Anti-Rootkit Utility - TDSSKiller]
    * [http://general-changelog-team.fr/en/downloads/viewdownload/20-outils-de-xplode/2-adwcleaner AdwCleaner] (for more info, see this [http://www.bleepingcomputer.com/download/adwcleaner/ alternate AdwCleaner download page])
    * [http://www.surfright.nl/en/hitmanpro/ Hitman Pro]
    * [http://www.eset.com/us/online-scanner/ ESET Online Scanner]
    [http://windows.microsoft.com/MSE Microsoft Security Essentials] is a good permanent antivirus for Windows 7/Vista/XP if you don't already have one.
    Further information can be found in the [[Troubleshoot Firefox issues caused by malware]] article.
    Did this fix your problems? Please report back to us!

  • Inserting a page from another website?

    i am a dreawaever novice!
    i have to make this a website and a video, i found a great
    java tour
    http://www.pan3sixty.co.uk/tours/uoh/java-map.htm
    i want to put it into my web page so it plays. can i do this?
    another thing!
    I have tried to a swf video file that i made in flash but it
    does not play when i preview the page, but play when play is
    pressed in the properties toolbar?
    please help me
    thanks in advance!!!!!

    Technically, you can open an an URL inside of a web page
    using the IFRAME tag in HTML. This may not be the right thing to do
    if the owner of that page does not give you approval to do so.
    A Flash movie (swf file) will not play in Design View unless
    you use the Play button in the Property Inspector. You can see the
    Flash movie play if you preview the web page in a browser (F12 or
    Preview in Browser from the File menu).

  • Optimize photo links from another website??

    I have a client that has two websites.  I want to use all the photos from her other website to make thumbnails.  There are huge amounts of photos, so I have just linked the photos from her present site.  Does anyone know if it's possible to optimize them, so the page full of thumbnails is faster to load?  Is there some sort of Javascript for that?  I'm guessing not, but am very hopeful!
    Thanks in advance!

    Hey Nancy
    Maybe it would just be easier to give you these details...
    The site that the pictures are from:  http://blog.carmichaelphoto.com
    Thumbnails are embedded into: http://elopeinbanff.ca/indexNew.php
    Photos have been uploaded to Blogger by the client. 
    The Elope in Banff server is fast enough, but the more thumbnails that are added, the more it slows down the "special effects" that the page has (the opening of the gallery tab, itself).  And yes, the site is all on one page, so that gets a tad bulky too, but it wasn't that big a deal till I added the thumbs.

  • Refer jsf from another website

    Hey there,
    i see no solution in a problem of mine.
    howto deal with a url like
    http://server/app/details.jsf?id=7645623
    i need to display details of products, refered from some foreign webapps.
    how can i pass my parameter through jsf?
    in struts i have for this actions, that do SQL-Selects and forward
    an jsp.
    is this possible in jsf?
    any ideas?

    create an BackingBean for your details.jsp
    set its scope to "request"
    in Construktor you do something like this:
    public BackingBean()
      String param = (String) FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("id");
    // pass 'param' into SQL or something other.
    //result of that could be the value of backingbeans propertiesif you have SQL, i recommend to use <h:dataTable> in jsp-file,
    that could use a resultset directly for displaying.
    .Matthias

  • Controlling active display from another VI?

    Hi,
    I have a VI that needs to serve the purpose of selecting different display screens. The selction process is just one enumeration that should keep one screen up at a time, but I have no idea how to code it such that is the case. I could bring up the different subVI's in a case statement but is there any way to close them and re-open them without restarting the whole process? Please let me know if I'm not being really clear.

    Well, this was my first answer on these forums, and I am a bit embarrassed since I could not get it to work the way I described. I do think it's possible the way I mentioned, but there is another way.
    There is a 'close panel no abort.vi' in the labview\vi.llb\utility\victl.llb library that will let you close the displays. You will also need to set up the display vi's so that they open when called, but don't close when done.
    I am attaching a simple example. If you can't read version 6.02, let me know and I will upload a version 5 example.
    Good luck,
    Bill Kemmerer
    Attachments:
    DisplayExample.llb ‏51 KB

  • Using info from another website

    Hi there,
    I am very weak with my script knowledge ( i do have basic knowledge on Flash), so please excuse me if I'm posting my question in the wrong section.
    Basically, I'll like to work on a project to showcase my DVD collection (it's for practice). I'll like to have DVD covers which, when click on, shows information such as "Director" "actors" "movie length", etc. And it will be too much for me to key in the data manually. So, i'll like the script to grab such info from http://www.imdb.com by itself. It will save me lots of updating efforts when i add new titles onto the site.
    Has this been done before? What should I look into? XML, CSS, Actionscript?
    Please guide me on where and what i should learn.
    Thank you.

    IMDB doesn't appear to offer a web service that you can call for this type of thing, which leaves you with a couple of options.
    1. You can find a free web service that does this by searching the internet for "movie information web service" or some such.
    2. You can grab the URL of a search page for IMDB, load it in actionscript as text, and parse the HTML to find what you want.
    A quick google found this:
    http://www.codeplex.com/imdb - some .NET classes for searching IMDB (it appears as though you would have to create your own web service from the classes and then use it in Flash - probably not what you are looking for)
    http://www.trynt.com/trynt-movie-imdb-api/ - a web service for IMDB searches - appears very limited in scope of information returned
    I am sure you will be able to find something with a bit more searching

  • How do I block a website from being loaded automatically from another website?

    I want to be able to instruct Firefox to block certain web pages/sites from loading. (The particular problem is certain sites which I DO want to view automatically opening other web pages/sites in new Firefox windows.) There ought surely to be a facility in the Options menu or elsewhere to specify particular sites to be blocked from loading, but I can't find one. I'm sure the hated Internet Explorer had such a facility. Where is it in Firefox?

    You can try Adblock Plus:
    * Adblock Plus: https://addons.mozilla.org/firefox/addon/1865
    You need to subscribe to a Filter list (e.g. the EasyList).
    * http://adblockplus.org/en/subscriptions
    * http://adblockplus.org/en/getting_started

  • Using MBP monitor to display from another source

    Might be a dumb question, but is it possible to use my MBP monitor as if it were a stand-alone monitor? I've got a a laptop that the backlight went out on, but everything else works fine, and would like to be able to use it as a secondary computer that I could still have all my music and stuff like that on. Thanks if anybody has any insight.

    No i'm afraid unless you plan some serious hacking. there are no video in as such ports on the MBP.
    ~Just buy a cheap monitor for your bust laptop~

Maybe you are looking for