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!!!

Similar Messages

  • How to generate a html page for a VI which is created by a vi template dynamically

    I have a executable which calls a VI template dynamically, say it is subvi.vit. A subvi1.vi is generated by the template. On my web server, I want to display the front panel of subvi1.vi. How can I generate its html file programmatically if I don't want to use CGI?
    Thanks for your reply. 

    Hi tst,
    Thanks for your fast response.
    I don't know how I could make this mistake to put the post under feedback board but let's keep it here because I don't know how to move it to LV board unless I start a new thread.
    I don't know if I could do it in wizard because subvi1.vi doesn't exist before the executable runing. I have to create a html file during running.
    I did generate a html file in wizard but I have to use subvi.vit to do the web publishing. When I log into web server http:\\localhost\subvi.html, I got error message "the requested VI is not loaded into the memory on the server computer". The reason is that the vi template subvi.vit was loaded dynamically, so it is not in memory any more once the VI reference is closed. But subvi1.vi is running now. I need to display subvi1.vi's real-time front panel.
    Did I clarify my issue?
    I would appreciate your help.
    regards,

  • How can I generate a html page in a servlet-applet connection?

    Hello, I have an applet which contains an ok button, when I click this button, I need that servlet generate an html page and view it in browser. How can I do this?
    Thanks

    But with this method only is possible I think open a page web, and if it is possible call url of the servlet, you generate other request and response object (other call to method doGet or doPost because ShowDocument needs parameter url), so the previously request when I click button ok it's no the same and how I obtain the prinwriter from first request, showDocument don't obtain html page from printwriter.

  • Help with setting up a new html page

    Following the tutorial and it tells me to select 'structure' on the insert tab when setting up a new html page.  I do not have the 'structure' option.  Help please.

    If you don't have the Structure option, you probably don't have Dreamweaver CC. The tutorial is designed for CC. It won't work with earlier versions of Dreamweaver.
    If you're using Dreamweaver CS6, you might be interested in this six-part written tutorial series: http://www.adobe.com/devnet/dreamweaver/articles/first_website_pt1_cs6.edu.html.

  • Can not preview HTML pages in browser

    I am unable to preview my HTML pages in a browser eg. safari. firefox etc... before uploading them to my server. I have tried going into preferences and clicking on the preview in browser section and adding a new primary and secondary browser but it will not work. I was able to preview my pages in browser mode fine up until a few days ago when it suddenly stopped working. I am using Mac OS X version 10.5.8, Prosessor 4x2.5 GHz PowerPC G5. Memory 4.5 GB DDR2 SDRAM. I have Dreamweaver CS3. My test server is set to none.

    Hi Murry,
    When I try to preview HTML pages in browser it comes up with a message saying 'Would you like to define a primary browser now?' but when i try this it does not work, it will not recognise the browsers when i add them to the list.
    Corinne

  • How to generate dynamic HTML pages using Swing Application?

    Hello,
    I am writing a Java application to connect to a local light-weight java database. I would like to generate and present a HTML on the fly after selecting records from a database. At server side, I could easily use JSP/Servlet to do this. How can I do this on a desktop client machine using Java application? I do not want to install Apache web server on the desktop machine. Any help will be greatly appreciated. Thanks in advance.
    Dominic

    The way u need to generate your html pages depened on what u want to generate,
    anyway what i can help with, is how to display a generated page.
    u have to use JEditorPane with HTMLEditorKit and HTMLDocument to display any HTML.
    also u can use the methods provided with the above objects to generate your html format.
    I hope I helped.

  • How to generate a html page when a button is pressed

    hi
    i have to generate a html page when a help button is pressed
    so please help me
    thanks
    shiva

    "touch index.html"
    Might not be what you're looking for but creates an html page.

  • Creating a new Master Page for new SharePoint 365 Environment

    Hello,
    If you create a new Master Page for your 365 site collection should all the Promoted Links, List Headings, etc. (standard items that are in the OOO SP Master Page) still remain the 'Blue SP Color' or are you able to change these items in the Master
    Page as well?  If someone needs additional information on my question please let me know.
    Thank you in advance!
    Joanie

    Hi Joanie,
    use those article to build your master page for office 365
    http://rstagg.com/2013/04/17/office-365-branding-creating-a-custom-masterpage-for-your-office-365-public-facing-website/
    http://msdn.microsoft.com/en-us/library/jj822370.aspx
    Kind Regards,
    John Naguib
    Technical Consultant/Architect
    MCITP, MCPD, MCTS, MCT, TOGAF 9 Foundation
    Please remember to mark your question as answered if this solves your problem

  • How to display everything inside a canvas on a new HTML page

    Hi, im trying to display images, words and everything inside a canvas on a new HTML page. By a click of a button, a new window with HTML page will pop up display the canvas. Can anyone help me?

    Apps and other media from iTunes can only be used with the account they were bought with.

  • Create new HTML page with white background.

    When I create a new HTML page the background color in Design view is yellow. Dreamweaver Preferences and Page Properties do not show yellow. What to do?
    FredF

    I'm totally stumped as to why the default color is yellow. I do know that
    the website where I'm the webmaster, all the pages have a yellow background
    ( http://281st.com ).  But what that has to do with a new HTML default
    background page color in Dreamweaver I'm not knowingŠŠŠ
    The reason is the background color is hard wired in the body like this:
    <body bgcolor="#FFFFCC" style="text-align: center">
    Now if you are relying on your styles then you are going to be totally stumped because you won't be looking at your HTML code.  In fact most people won't remember to look at HTML code because they assume that because your work is quite proficient, you are not likely to embed styles in your HTML code. 

  • Can SQL*Loader be used for Oracle html pages, for e.g Customer, Tasks etc

    Hi,
    Can SQL*Loader be used for Oracle html pages, for e.g Customer, Tasks etc.
    Reason: We have a job that creates leads, tasks in 11i, but r12 is not working as expected, an SR is open with Oracle for a long time and no solution so far. I am thinking of using SQL*loader to populate the data, but these are html pages. Will SQL* Loader work?
    12.1.4 / 11g db
    Appreciate your inputs.
    Thanks,
    K

    Can SQL*Loader be used for Oracle html pages, for e.g Customer, Tasks etc. It should work.
    Reason: We have a job that creates leads, tasks in 11i, but r12 is not working as expected, What is the issue you have with R12?
    an SR is open with Oracle for a long time and no solution so far. I am thinking of using SQL*loader to populate the data, but these are html pages. Will SQL* Loader work?What was Oracle feedback? Did they say it is certified and can be used?
    Thanks,
    Hussein

  • Made new html page, I cannot find an pactual font size

    Doing DW in a book, Lesson 1 made a html page "two col fixed header footer" There is a text size, an h1, h2 & <p> text size and it is 100% in the body, and 100% in the header, and after lesson #1, it is 90% in the main content, however of what?  I went looking as a  follow-up of the lesson and I
    could not find a reference to an actual size in the css which is in the head. How big is it, where is it established?    

    All web browsers have a default size for text. Putting 100% in the body style rule means "use the browser default for all fonts". Using 90% later simply means "use 90% of the browser default". The actual size depends on the individual browser.

  • Running into Exception while Creating new Login Page for Security

    Hi,
    I am following ADF Developers Guide to create a new login page ,so that whenever a page is run , first it redirects to Login page first and on Button click it
    goes to the Original page which was run.
    This is my Login bean code for doLogin()
    public String doLogin(){
    String un = _username;
    byte[] pw = _password.getBytes();
    FacesContext ctx = FacesContext.getCurrentInstance();
    HttpServletRequest request = (HttpServletRequest)ctx.getExternalContext().getRequest();
    try {
    CallbackHandler handler = new URLCallbackHandler(un, pw);
    Subject mySubj = weblogic.security.services.Authentication.login(handler);
    weblogic.servlet.security.ServletAuthentication.runAs(mySubj, request);
    ServletAuthentication.generateNewSessionID(request);
    //String loginUrl = "/adfAuthentication?success_url=/faces/viewactivityname";
    //sendForward(loginUrl);
    } catch (FailedLoginException fle) {
    FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_ERROR,"Incorrect Username or Password","An incorrect Username or Password" +" was specified");
    ctx.addMessage(null, msg);
    setPassword(null);
    } catch (LoginException le) {
    reportUnexpectedLoginError("LoginException", le);
    return null;
    Now the Dev guide says that :: "Specifically, without specifying a view activity as the
    redirect target, command components, such as the commandButton
    component, will always return to the original page after login."
    Hence I have commented out the code for the call to sendForward().
    As soon as I press the button I am running into an error :: "javax.faces.el.EvaluationException: java.lang.NullPointerException"
    ]] Root cause of ServletException.
    javax.faces.el.EvaluationException: java.lang.NullPointerException
         at org.apache.myfaces.trinidad.component.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:51)
         at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
         at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:190)
         at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:787)
         at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1252)
         Truncated. see log file for complete stacktrace
    Caused By: java.lang.NullPointerException
         at oracle.sample.view.LoginBean.doLogin(LoginBean.java:60)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
    These are the steps which I followed ::
    a) Created Managed bean class and registered it to adfc.config.xml
    b) Created a Custom Login Page say Login.jspx and created a DataBound Page say EmpDetails.jspx
    c) Made sure that My Login page is custom Login Page
    d) Command Button has the Action Property set to LoginBean.doLogin
    e) Configured security and has only one user, no roles and assigned the user to access the page
    e) When I run EmpDetails.jspx , I am redirected to Login page as expected but as soon as I press
    Login "CommandButton" it throws this error.
    Any pointers.
    Regards,
    Nikhil Misra

    Hi Puthanampatti,
    In that ase what would be my sendForward() mthod look like.
    Currently as per the Dev guide it is :
    private void sendForward(String forwardUrl) {
    FacesContext ctx = FacesContext.getCurrentInstance();
    try {
    ctx.getExternalContext().redirect(forwardUrl);
    } catch (IOException ie) {
    reportUnexpectedLoginError("IOException", ie);
    ctx.responseComplete();
    I understand tat there would be change in parameters like sendForward(HttpServletRequest request,HttpServletResponse response,String forwardUrl),
    but how would the other parameters work.
    Regards,
    Nikhil Misra

  • 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.

  • Change the title of the new HTML page screen

    Hi,
    I would like to change the title displayed in the screen to create a new HTML file from "New HTML Document" to something like "New Page". Is there any properties file which I can edit to get this done? Or does it come from some java class file?
    Awaiting reply.
    Thanks & Regards
    Ranjith

    Hi,
    I have found the text here:
    <i>\usr\sap\EED\JC00\j2ee\cluster\server0\apps\sap.com\irj\servlet_jsp\irj\root\WEB-INF\portal\portalapps\com.sap.km.cm.ui\lib\km.appl.ui.edit_api.jar\com\sapportals\wcm\control\edit\ResourceEditControl.properties</i>
    and here:
    <i>\usr\sap\EED\JC00\j2ee\cluster\server0\apps\sap.com\irj\servlet_jsp\irj\root\WEB-INF\portal\portalapps\com.sap.km.cm.ui\lib\km.appl.ui.edit_api.jar\com\sapportals\wcm\control\edit\ResourceEditControl_en.properties</i>
    So seems you could change it. But I think when you apply a patch to the KM the .properties files will be overwritten - so you will have to do it again...
    Romano

Maybe you are looking for