Servlet showing HTML page

I ma using Tomcat as standalone server.
have servlet showing HTML page which has frames in it . All frames are linked to some html pages. These pages are stored in
webapps/project directory and servlet is in
\Tomcat 4.1\webapps\Project\WEB-INF\classes
Tomcat can show the servlet with al frames witherror402 means it is unable to take html pages from webapps/project
what's wrong
my codes are
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class Htmlservlet extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException,IOException {
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("<HTML>\n"+
"<HEAD> <TITLE>A frameset document</TITLE></HEAD>\n"+
"<FRAMESET rows= \"20%,40%,40%\" >" +
"<FRAME src=\"contents_of_frame3.html\" frameborder=\"0\" scrolling =\"no\">"+
  "<FRAMESET cols=\"*,200\">"+
      "<FRAME src=\"contents_of_frame1.html\" scrolling=\"no\">"+
      "<FRAME src=\"contents_of_frame2.gif\" >"+
"</FRAMESET>"+
  "<FRAME src=\"contents_of_frame4.html\" frameborder=\"0\"> </FRAMESET>"+
"</HTML>");
}

Hi,
Please please try this
<FRAME src=\"/contents_of_frame1.html\"
thanks,
nvseenu

Similar Messages

  • Problems calling Java Servlets from HTML pages Online

    Hello
    I have created a Web site using Java Servlets, and have acquired some servlet enabled web-space however i am having some difficulty in calling the actual servlets from the HTML pages i was using the line of code as follows
    http://localhost:8080/servlet/....
    followed by the name eg.
    http://localhost:8080/servlet/Login
    however this doesn't seem to be working i have also tried using the exact address of the servlet but this didn't work either
    i.e ..servlet/Login.java
    I was wondering would anyone have any idea as in how the servlets should be called
    Thanks very much

    Once you write the Servlet code, you have to compile and put the classes in the server classpath. To refer these servlets from your pages, you have to configure them in the server configuration(typical a xml file). There you define how you are going to refer to the servlet(/servlet/Logon) and the correponding class.
    -Mak

  • Show HTML page on initial SAP Screen

    Hi all,
    I know how to change the image on the initial screen by maintain table SSM_CUST and upload *.gif with tcode SMW0.
    In SMW0 there is another part about HTML templates. I have uploaded an HTML page but I was not able to see this on the initial screen.
    Any way to do this or we can only show images on the initial screen ?
    Thanks
    Utku UTKAN

    Hi Mike,
    I don't mean the login screen, I mean the initial screen which comes after we logon.
    Thanks

  • Show HTML-Page

    Hi!
    How can I show a HTML-Page in Internet Explorer by clicking a Menu Item or a button?
    Thx!

    thx man, i'll try it
    Try this:
    http://www.javaworld.com/javaworld/javatips/jw-javatip6
    .html

  • JSP, downloading files and show html page

    I like to download files and show a html page on JSP.
    With the source following, downloading works well.
    But, it is just remained on the previous page, not showing the next html page.
    Someone tell me why is it?
    <%@ page import="java.io.*, java.net.URL"%><%
    String file_name = request.getParameter("file_name");
    File fileDir = new File(config.getServletContext().getRealPath("upload/"));
    File theFile = new File(fileDir, file_name);
    FileInputStream fin = new FileInputStream(theFile);
    response.setHeader("Content-Disposition","attachment; filename=\"" + theFile.getName()+"\"");
    response.setContentLength((int) theFile.length());
    BufferedInputStream bf = new BufferedInputStream(new FileInputStream(theFile), 8096);
    int i;
    while ((i=bf.read()) != -1)
    out.write(i);
    bf.close();
    out.close();
    %>
    <html>
    <head>
    <title>file download</title>
    </head>
    <body>
    <p align="center"> </p>
    <p align="center"><b><font face="Tahoma" color="#000000" size="2">You have
    successfully downloaded your file(<%=file_name%>)!</font></b></p>
    </body>
    </html>

    You's already close the JSP output stream befor you try and write your html confirmation, and I don't think browsers can provide the kind of functionality you're trying to demonstrate here. A browser will download the file and open it directly itself or using another application based on user input (e.g. save as, open file, etc.). Once the file is opened or downloaded, it's done!
    I think your best bet is to show a dialogue that the user's download should begin, then set the pages href w/ JS to the location of the file, same way other sites that allow you to download files do it. Go take a look at download.com or something like that.
    Hope that helps.

  • Viewing HTML Pages

    I used JEditorPane and JTextPane to show HTML Pages, but it did not work with the hyperlink texts. How do I solve this problem.

    You have to add a hyperlinklistener to handle user interactions.
    Code sample comes from http://www.exampledepot.com/
       try {
            String url = "http://java.sun.com";
            JEditorPane editorPane = new JEditorPane(url);
            editorPane.setEditable(false);
            editorPane.addHyperlinkListener(new MyHyperlinkListener());
        } catch (IOException e) {
        class MyHyperlinkListener implements HyperlinkListener {
            public void hyperlinkUpdate(HyperlinkEvent evt) {
                if (evt.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
                    JEditorPane pane = (JEditorPane)evt.getSource();
                    try {
                        // Show the new page in the editor pane.
                        pane.setPage(evt.getURL());
                    } catch (IOException e) {
        }

  • 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

  • Image not showing up in HTML page

    I am running tomcat and in WEB-INF I have a simple HTML page that has is trying to show an image, but it doesn't show up.
    Under WEB-INF I have:
    mypage.html
    images/logo.png
    <html>
    <head>
    <link REL="SHORTCUT ICON" HREF="images/logo.png">
    </head>
    <body>
        <img src="images/logo.png">Hello World!
    </body>
    </html>The image does not show up when I try and view it from tomcat (i.e. http://localhost:8080/mypage.html)
    But it does show up if I just open up the HTML file with IE or Firefox.
    Any ideas what I am missing?

    The page is invoked via a Servlet Filter. So I have mapped in my web.xml:
    <error-page>
    <error-code>401</error-code>
    <location>foo.html</location>
    </error-page>
    In my servlet filter I have something like:
    HttpServletResponse response = (HttpServletResponse) resp;
    response.sendError(HttpServletResponse.SC_UNAUTHORIZED);..i have to check tomorrow when i am with the server again to see what the direct URL is to the image. Theoretically I'd assume:
    http://localhost/myapp/images/logo.png
    have to double check though

  • Servlet to generate  *new*  html pages for browser

    Dear all,
    Greetings!
    I am write a servlet, and I want this servlet to generate different html pages (say 5 pages) simultaneously, and then display them in 5 different pages in client browser.
    The sequence is like this:
    1) the user click a link in a web browser and send request to web server.
    2) web server has a servlet to handle this request, then in doGet() or doPost() method it will do some calculations first, after that, it generate 5 different html pages (it can use redirect in a chain fashion) and send back to client browser.
    3) the client browser will display these 5 different html code in 5 different pages (should not be the same as the original pages that submited the request), i.e, it will pop up new web pages automatically to serve 5 different pages (since each page will have <html> ... </html> codes).
    Any solution, if possible, please give me some idea.
    //-- My main problem is: how to ask servlet to generate html codes,
    //-- and when send back to client, let browser displays the information in
    //-- a new web page (not original page the submit the request)? show some servlet doGet() code if possible.
    if you have solution for even only 1 page, your help is also very appreciated!
    once again, many thanks!

    However, for wild guessing,
    are you included d:\richard in your CLASSPATH?No. Does the CLASSPATH affect the default directory to create file - and I have to put the Tomcat as the first path in my classPath? But I just found that I set environment variable HOME to be d:\richard. It must be the reason.
    How about this:
    When a use submit a request, the servlet starts a new
    thread to do the process, for example.....I thought about this solution earlier. It is true that this is a solution. Now I am not worrying about it, since when I move on about this project, I found something more interesting (worse?) for this project. Detail follows:
    This morning I was informed that the project needs the request being sent from the front end applet, (*NOT from browser link*), so now even simple client side scripting does not work. This is because when servlet sends back response, it will send back to applet by Connection.getInputStream() - this is what I can think about right now. Basically, it means, the browser will not even have a chance to process the returned HTML code. So the question becomes: How to ask browser open a web page to display the servlet response from an front end applet directly? ;(
    I am almost run out of idea! Will check back later, meanwhile spend some more time considering... It is very late here now (early in the next morning)!
    Thank you very much indeed for all you kind help!!!

  • Portal Page showing HTML content

    Using standard Portal components, is there a way to create a
    portal page with 1) left hand set of links to html pages. 2) on
    the right side is a portlet showing the html page. This is what
    99% of websites do.
    The portal seems to have 1) single HTML portlet I would need a
    portlet and a new Portal page for each HTML.
    2) content areas with their own funky way of showing content
    i am looking for the simple web way to implement. I have though
    of writing a portlet that you feed it a parameter aka the file
    name of the HTML content that should appear.
    HELP!

    Hi,
    here's what I think works best:
    1. add an ADF Faces inlineFrame component to the page
    2. Have the inlineFrame source property pointing to a servlet that reads and streams the HTML from the database as an HTML document
    Frank

  • Can I use data from Servlet in my static html page?

    First of all, I can NOT use jsp because of web server's restriction.
    I have a servlet which will give me some image links in html file via doGET and doPOST method. I also need the sizes of the images and compress the images if too large.
    My question is how I can pass the image sizes to the html page and how I can use them in html files.
    Please advise me some solutions to this problem.

    Yeah, you have 2 choices:
    1) Change your web server to one that allows JSP.
    2) Re-build the JSP system from scratch so that the one you make will work in your server. This would involve changing your so called static HTML to have markings (like <% %> tags) where you should insert the values you need to insert. You would then have a servlet that reads the 'static' HTML, parses our the insertion tags, and inserts the values. It would then stream the results back to the user.
    Of course, your HTML is not really static, it is dynamic because the values you are inserting are capable of changing.
    If you don't want to upgrade the server to one that supports JSPs (if yours really doesn't), the have fun making your own system.

  • How to show an HTML page in a new browser window

    Hi Everyone,
    I am trying to show a page generated by some servlet in a new browser window when the button is clicked on the applet. I can accomplish that by using AppletContext as in:
    myApplet.getAppletContext().showDocument(servletUrl, "_blank");
    The only problem with this is that I don't have any control over how the new browser window is displayed. Using JavaScript I can set size, hide toolbar and address bar, etc. But how can I hide address bar on a new browser window generated in this scenario?
    I tried to call intermediate servlet from my applet which in turn generates a new window by writing out JavaScript code. This way I lose my previous page with the applet even though a new window is displayed the way I wanted but I want this new browser window to act as a pop-up box and my applet page stay on screen. Also, is there a way to send a POST request from an applet by using AppletContext.showDocument() method?
    Any help will be greatly appreciated!
    Thanks in advance,
    Y.M.

    Did you ever figure out a solution for this? I too would like to open a new browser window to act as a pop-up box and my applet page stay on screen. If anyone has any thoughts on how to do this, please post! thanks.

  • Inserting Image on a HTML page through servlet

    I want to insert an image on a HTML page which will be generated by a servlet.For that I have written the <IMG SRC>tag.But my doubt is where to store the image(i.e in which directory of the web server) I should store the Image.I am using JavaWebServer2.0.
    please help

    You can put your images in public_html directory.

  • How to show a html page in a swing applet -- URGENT!!!

    Hi All,
    I'm trying to show a html page inside a swing applet... is it possible to do that?? if so is there any built-in classes available for that?? If anyone have some examples, plz help me with that....
    Thanks,
    Ragu

    i havent tested.. but this should work. i am no expert on these either, just to give you an example.. :-)
    JEditorPane ePane = new JEditorPane();
    HTMLEditorKit html = new HTMLEditorKit();
    ePane.setEditorKit(html);
    HTMLDocument htmld = new HTMLDocument();
    try{
    URL url = new URL("http://hcs.harvard.edu/~undercon/");
    InputStream ins = url.openStream();
    ePane.setDocument(htmld);
    html.read(ins,htmld, 0);
    this.getContentPane().add(new JScrollPane(ePane),BorderLayout.CENTER);
    catch(Exception e)
    e.printStackTrace();
    }

  • Not showing image in basic copy gif image icon and place on html page

    Trying to do a basic copy gif image icon and place it on a basic html page.
    The image shows up in my local page and shows on remote side but when I go to view in browser it does not show as a image. It shows the border but no image.
    The directions were (working with windows xp and IE8)
    Download the image to your C:\temp folder.
    4. Copy the gif file from your C:\temp folder and paste it in the same folder where your .html or .asp file is.
    I copied the image with right click save as in many different areas of computer. I even put on desktop.
    I add image and it shows on the site I am working in but when putting to remote side it does not view as an image on the browser.
    I have cleared cashe as well as pressed cntrl/refresh and still nothing.
    Other images work and show.
    on-line-vacations.com
    Thanks!

    Basic assumptions:
    You have Defined a site.
    All files reside within the defined site (including image files)
    All files use the appropriate file extensions, for example, image.gif
    You have saved and uploaded all site files to your server.
    You are EXACTLY naming the source image (no errant capital letters) in the link.
    If your other images are linking properly and showing, delete this image and insert it again (or re-link it to the image file within your site structure).
    Z

Maybe you are looking for

  • How can i get an icloud backup saved in my itunes or on my pc

    Want to save my icloud backup either on my pc or in my itunes how do i do this does anybody know?

  • Text from Bulgaria

    I used to be with 02 never had any problems with them when travelling in Europe I'm now with BT mobile. When travelling to Bulgaria I had nothing but problems with this service. And also Cyprus. Bulgaria I had to choose from networks trying to get it

  • Group emails

    Since moving to the new BT Mail my group emails are not working.  I get a message saying the email addresses are incorrect.  Do I have to re-enter all my groups?  I have several groups containing between 30 and 55 addresses!

  • HT5463 Do Not Disturb feature not working?

    I have upgraded to iPhone 5 but no matter what I do with the settings on the Do Not Disturb calls still come through.  Is this a desigb

  • Alter different users table, i need to add constraint: primary key

    Hi All, my oracle database : 10G I have a user named rahul and its trying to alter a table of a different user 'biapps_12' here is the alter table script that I am firing using user 'rahul' when connected to database 'MDMINT5' : alter table BIAPPS_12