Setting fields on html page from servlet

I have a HTML Page1 on ServerA that calls a servlet on ServerB. I want the servlet to load Page2 on ServerA and set fields on Page2.
I know I can do so by using Redirect and passing parameters in the URL that can be loaded in the onLoad event of Page2 but I was wondering if there is some way I can cause the servlet to set the fields directly.
I have looked a getRequestDispatcher("url").forward but it seems to me that the page being called would have to be on ServerB (the servlet's server). Am I correct? If not how do I get this to work? I have tried getRequestDispatcher("Page2").forward() and getRequestDispatcher("/Page2").forward() but neither seem to work. I assume because the pages are expected to be found on the servlet's server?

thank you!
I do put a bounch of System.out.println statements in it. one is just before the out.println("<html>") statement. another is before response.sendRedirect(). My program can print out each of the System.out.println(). but stop after that.I really do not know why!
Sean

Similar Messages

  • How can I display the HTML page from servlet which is called by an applet

    How can I display the HTML page from servlet which is called by an
    applet using the doPost method. If I print the response i can able to see the html document. How I can display it in the browser.
    I am calling my struts action class from the applet. I want to show the response in the same browser.
    Code samples will be appreciated.

    hi
    I got one way for this .
    call a javascript in showDocument() to submit the form

  • How to call a html page from servlet

    i want to link a servlet to a html page, if i use requestdispatcher, it says XXX.html is not available, can anybody help

    Can you be more specific about what you're trying to do? Can't read your mind =). But if you mean you want to just have an static HTML page such as a header read by the servlet you can you the requestdispatcher include().
    Create a servlet to generate a page, and then map it as /getPage in the web.xml file. Then you can use:
    // header
    RequestDispatcher rd = ...getRequestDispatcher("/getPage");
    rs.include(req, res);
    // the rest of the servlet output
    // and you can do another one for the footer down here
    rd = ...getRequestDispatcher("/getPageFooter");
    rs.include(req, res);
    and it'll output the HTML in the servlet.
    Hope this helps

  • Calling HTML file from servlet and vice versa...

    i have got few questions..
    1- if a site is made in HTML then what should be used to put user login functionality in it, servlets or jsp or other option(specify)?
    2- im trying to do with servlets, so when im calling doPost method from HTML page and sending data, everything working fine but because of this the page refreshes and the HTML coding get lost, so how can i stop that from happening if possible, like showing the same page with messege = "Logged in".
    3- how can i call an HTML page from servlet?
    4- how can i send data from servlet to HTML page?

    that i m aware of, but when a servlet is called then the page will refresh n it will display the things that you have mentioned in the servlet file n not the things that u have mentioned in HTML file, n the page will be blank if u have not mentioned any HTML coding in servlet file.
    so i need to knw how to call back that prev HTML file so that the things i want to display can be displayed, i knw the same can be done by adding the HTML code in servlet file but i would like to know if there is any way to call back the HTML file.

  • Urgent....How can i redirect to my jsp page from servlet in init() method..

    How can i redirect to my jsp page from servlet in init() method..Becoz that servlet is calling while server startsup..so im writing some piece of code in init() method..after that i want to redirect to some jsp page ...is it possible?
    using RequestDispatcher..its not possible..becoz
    RequestDispatcher rd = sc.getRequestDispatcher("goto.jsp");
    rd.foward(req,res);
    Here the request and response are null objects..
    So mi question can frame as how can i get request/response in servlet's init method()..

    Hi guys
    did any one get a solution for this issue. calling a jsp in the startup of the servlet, i mean in the startup servlet. I do have a same req like i need to call a JSP which does some data reterival and calculations and i am putting the results in the cache. so in the jsp there in no output of HTML. when i use the URLConnection i am getting a error as below.
    java.net.SocketException: Unexpected end of file from server
    at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:707)
    at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:612)
    at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:705)
    at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:612)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon
    nection.java:519)
    at com.toysrus.fns.alphablox.Startup.callJSP(Unknown Source)
    at com.toysrus.fns.alphablox.Startup.init(Unknown Source)
    at org.apache.tomcat.core.ServletWrapper.doInit(ServletWrapper.java:317)
    so plz do let me know how to call a jsp in the start up of a servlet.
    Thanks
    Vidya

  • Store html page with servlets

    we know its possible to generate a html page using servlets
    i would like to know using servlets is it possible to create a new html page and store this page in a desired location
    and acess it if its only needed

    Hi friend,
    I am chetan from India, I have developed the WebSite www.bhavishya.net. I am encountering a serious problem in writing into a text file. I am unable to configure the path of the text file. while using Linux i got it. but now i am using Windows Environment. The code is as follows. could u plese give the correct path ("<web-server-root>/httpdocs/file.txt")
    public String ewrite(String str)
    String err = "File updated";
    try
    Date d = new Date();
    BufferedWriter bwout = null;
    // for Web Server
    try
    //BufferedWriter out = new BufferedWriter(new FileWriter("/home/bhavishya/ErrorLog.txt", true)); // For Linux
    bwout = new BufferedWriter(new FileWriter("./bhavishya/logs/ErrorLog.txt", true));
    bwout.write(d.toLocaleString()+" : "+str+"\n");
    catch (RuntimeException e1) {err = e1.toString(); e1.printStackTrace();}
    System.out.println("ErrorLog - 21");
    bwout.close();
    catch (IOException e) { System.out.println(e); }
    return err;
    Regards,

  • Report HTML page from XSL

    Hi All,
    I need help with generation HTML page from
    such XML by using XSL transformation.
    XML is generated from db table.
    <ITEM level=0 name="Page row 1" type="PR"/>
    <ITEM level=1 name="Page row 2" type="PR"/>
    <ITEM level=2 name="Table 1" type="T">
         <Captions>
              <Name>Caption 1</Name>
              <Name>Caption 2</Name>
              <Name>Caption 3</Name>
              <Name>Caption 4</Name>
         </Captions>
    </ITEM>
    <ITEM level=3 name="Table row 1" type="TR">
         <Values>
              <Value>Row 1 value 1</Value>
              <Value>Row 1 value 2</Value>
              <Value>Row 1 value 3</Value>
              <Value>Row 1 value 4</Value>
         </Values>
    </ITEM>
    <ITEM level=3 name="Table row 2" type="TR">
         <Values>
              <Value>Row 2 value 1</Value>
              <Value>Row 2 value 2</Value>
              <Value>Row 2 value 3</Value>
              <Value>Row 2 value 4</Value>
         </Values>
    </ITEM>
    <ITEM level=3 name="Table row 3" type="TR">
         <Values>
              <Value>Row 3 value 1</Value>
              <Value>Row 3 value 2</Value>
              <Value>Row 3 value 3</Value>
              <Value>Row 3 value 4</Value>
         </Values>
    </ITEM>
    <ITEM level=0 name="Page row 3" type="PR"/>
    <ITEM level=1 name="Table 2" type="T">
         <Captions>
              <Name>Caption 1</Name>
              <Name>Caption 2</Name>
         </Captions>
    </ITEM>
    <ITEM level=2 name="Table row 4" type="TR">
         <Values>
              <Value>Row 1 value 1</Value>
              <Value>Row 1 value 2</Value>
         </Values>
    </ITEM>
    HTML should looks like:
    Page row 1
         Page row 2
              |Caption 1 |Caption 2 |Caption 3 |Caption 4 |
              | Row 1 value 1|Row 1 value 1|Row 1 value 1|Row 1 value 1|               
              | Row 2 value 1|Row 2 value 1|Row 2 value 1|Row 2 value 1|                         
              | Row 3 value 1|Row 3 value 1|Row 3 value 1|Row 3 value 1|               
              | Row 4 value 1|Row 4 value 1|Row 4 value 1|Row 4 value 1|               
    Page row 3
         |Caption 1 |Caption 2 |
         | Row 1 value 1|Row 1 value 1|
         | Row 2 value 1|Row 2 value 1|
    There can be many levels but always table item is leaf,
    Thanks in advance,
    Regards Peter

    Hi
    You are probably better posting in the flash forum, as without seeing the code, (and if it is not standard flash html publish) they can probably better advise on a solution.
    PZ

  • Referencing static html pages from jsps...

              Hi,
              This is probably a very simple thing to solve, but I'm having problems with referencing
              html pages from jsps under Weblogic.
              I get Error 404 - not found, whenever I try something like this in a JSP...
              <frame name="title" src="title.html" scrolling=no>
              The title.html file has definitely been copied into my ear file, and yet it isn't
              found. I can solve the problem by turning title.html into a jsp and registering
              it in web.xml. But this seems like serious overkill with static content!!
              Am I missing something really simple here?
              

              I've worked it out - directory mistake...
              Thanks,
              Chris
              "Matt Krevs" <[email protected]> wrote:
              >it sounds like a relative pathing problem
              >
              >is title.html reachable if you enter its address in the browser?
              >
              >is title.html in the same directory as your jsp?
              >
              >perhaps you could post your web.xml file?
              >
              >"Chris Sceats" <[email protected]> wrote in message
              >news:3d9c41b5$[email protected]..
              >>
              >> Hi,
              >>
              >> This is probably a very simple thing to solve, but I'm having problems
              >with referencing
              >> html pages from jsps under Weblogic.
              >> I get Error 404 - not found, whenever I try something like this in
              >a
              >JSP...
              >>
              >> <frame name="title" src="title.html" scrolling=no>
              >>
              >> The title.html file has definitely been copied into my ear file, and
              >yet
              >it isn't
              >> found. I can solve the problem by turning title.html into a jsp and
              >registering
              >> it in web.xml. But this seems like serious overkill with static content!!
              >>
              >> Am I missing something really simple here?
              >
              >
              

  • May by anyway view Local Network files[e-book] or videos or html pages, from the main PC

    In ipad 3 upgraded to 4 ios, may by anyway view Local Network files[e-book] or videos or html pages, from the main PC if, this main has local host[php/mysql] or, from the local network itself: eg //user/downloads/pdf/ebook1.pdf?

    In ipad 3 upgraded to 4 ios, may by anyway view Local Network files[e-book] or videos or html pages, from the main PC if, this main has local host[php/mysql] or, from the local network itself: eg //user/downloads/pdf/ebook1.pdf?

  • Exclude HTML page from Webcache with ESI

    Hi.
    I would like to exclude a html page from cache using ESI.
    Somebody can show me the tags that I need to use?
    Thanks in advanced.

    It is possible to dynamically exclude pages from caching through Surrogate-Control . I couldn't get what you are trying to achieve by using ESI...

  • How to Create HTML page from portal

    Hi
    I have a requirement to create html pages from portal.
    There will be an author who can choose document type as HTML
    and then he will write html codes on saving it should be saved as HTML doc in UCM.
    and publisher should be able to display it on portal(may be using content presenter).
    please help me in this. I know there is rich text editor task flow which can save a doc as doc file.
    and in spaces we have option of creating HTLM file but i don't know how to do it for my portal.
    Thanks

    A better way would be to create the page using approach in this blog:
    https://blogs.oracle.com/ATEAM_WEBCENTER/entry/content_presenter_cmis_complete
    That way the page can be edited inline and the html author need not upload html to ucm everytime.

  • How to call an HTML page from a JSP

    Hi,
    I am getting problem in calling an html page from a jsp
    The Sample code is
    int rowsAffected = stm.executeQuery("Select * From Table");
    if (rowsAffected == 1)
    {   %>
    <jsp:forward page="xyz.html" />
    <%

    See the other forum where you asked the same question http://forums.java.sun.com/thread.jsp?forum=45&thread=158981
    Please refrain from cross posting.

  • How to cache a content item like a Static HTML Page from UCM to Coherence/C

    Hi All,
    How to cache a content item like a Static HTML Page from UCM to Coherence/Coherence Web?
    Thanks

    Hi,
    Could you explain your use case in more detail?
    It does not look like proper use of coherence to cache static content - it more suited for dynamic content like user session etc.
    Adam

  • How to extract HTML page from the internet

    i am new to java, i wish to know how to extract Html page from the internet and also how to identify the differences between the images and text information?

    You can create a java.net.URL that points to the file you want to "extract" and read the HTML code (or what ever that file contains) from there using the inputstream given by URL.openStream().
    The difference between images and text... well, images are embedded in html using the img-tag. example: <IMG src="http://forum.java.sun.com/images/reply.gif" alt="Reply">. Attributes width, height, alt are sometimes left out and there may or may not be quotes around the values and everything is case insensitive... you'll be having hard time trying to parse the input so I'd suggest using existing parsers.
    What are you trying to do anyway? You can load a URL directly to a JTextEditorPane with the setPage(URL page) method...

  • Open HTML page from the stage

    How can I open a HTML page by pressing a button on the stage?
    I've created a rollover button and I'm trying to make it open
    an existing html page from the local disk (not an internet URL).
    But I can't make it open with Lingo or behaviour.
    Please help.
    Thanks a lot.
    Gideon.

    goToNetPage "
    http://somewhere.html" is the
    typical form for a page on
    the web, director must use the address format the system's
    browser uses
    for local files, this is somewhat platform dependant, a
    practical
    aproach is to open the file in question from within your
    browser then
    copy and paste the displayed address into your lingo code.
    Some report the goToNetPage counterpart provided by the
    buddyAPI xtra
    works more reliably, the xtra can be used for free if limited
    to a
    couple of functions.
    An alternate approach buddyAPI can use is to have the browser
    directly
    access the html file as if it were double clicked in the file
    manager
    using the same form commonly used to open PDF files with
    acrobat.
    (sorry I don't have example code handy)

Maybe you are looking for

  • Feature request: jump to time in program

    It would be great to enter a number of minutes and jump to that time in a program.  Replay DVRs implement this by entering the number of minutes that you want to advance and then press the forward or backward advance.  So when the FIOS DVR fails to p

  • Save as JPEG changes CMYK colour

    Hi, I have a solid colour in Photshop that I set CMYK values for (I work in CMYK image mode). When I save as JPEG, the resulting JPEG file changes one of the CMYK values by 1 percentage point. When I save as TIFF, it works fine (CMKY values match ori

  • Eps vs ai when rendering in CAD program

    Hello, I'm using a CAD program, Solidworks 2010 if it helps, to create and render 3D artwork for my forum.  In Ai, I'd like to import an eps or ai file with both wireframe and artwork.  So far I have only been able to import the wireframe which Ai ap

  • Problem when work with Image on Conten Mangement

    Hi all, My Repository have Library Service enable true and I created one content have type is article. On the window edit the value of "file" property I insert one image from my Repository. But I only can search out images were published and only the

  • UNABLE TO INSTALL ADOBE'S SOFTWARES

    Sirs, I am not able to install any adobe software. Last time it was with PS LR 4 and now the same with PS ELEM 11. I am getting the following report  ** This installation package could not be opened. Verify that the package exists and that you can ac