How to make html file on server side from the data entered in text area

Hi!
I want to know how to make .html file on server side. Like if i enter the data in text area ( or like we normaly see when we write mail that editor) and we can use html tages in it and when user submit form all the data in that field will be saved on server side as an html formate. Is it possible to do so??? or any ruff idea how to design it???

Erm ...
Whats the problem with that?!
Ok, here the code ...
String myparameter = request.getParameter("paramname");
String htmltemplate = "<html>\n"
                     +"<head><title>demo</title></head>\n";
                     +"<body>@parametertag@</body>\n";
                     +"<html>";
String htmlpage = htmltemplate.replaceAll("@parametertag@",myparameter);
File yourHTMLfile = new File("wheredoyouwannagotoday.html");
FileOutputStream fos = new FileOutputStream(yourHTMLfile);
fos.write(htmlpage.getBytes());
fos.close();You're done.
Happy Coding! :-) &copy;

Similar Messages

  • How to make a redirect without auto-redirect from the portlet "edit" mode?

    How to make a redirect without auto-redirect from the portlet "edit" mode?
    I use some sofisticated customizing with server-side validation of the form data. I want to redirect to the page of the portlet "show" mode and to the "edit" mode depending on the validation results. How can I do it?

    Heay.....this worked for me.
    I am able to change the mode programatically from edit to show.
    HttpPortletRendererUtil.handleEditAction(portletRenderRequest,"OK");
    I removed Apply , OK and Cancel buttons and applied my own Submit and Back button in Personalize mode and then change the mode to show on click of Back button using the above mentioned statement.
    Thanks
    ~Neeraj Sidhaye
    Try_Catch_Finally @ Y !
    ExtremePortal @ Gmail&#12288;&#65316;&#65359;&#65364;&#12288;&#65315;&#65359;&#65357;

  • I want to be able to save texts to a file or folder seperate from the rest of my texts.  This is so I can forward them onto someone else at a later date.

    Hi
    I want to be able to save texts to a file or folder seperate from the rest of my texts.  This is so I can foward them onto someone else at a later time.
    I have always had this facility on my previous phones e.g. blackberry but can't seem to find a way with my Iphone.

    No such option is available with the iPhone.
    A text can be forwarded, but texts are saved in conversation format by contact/phone number.
    Texts are included with your iPhone's backup, which is updated by iTunes as the first step during the iTunes sync process. There are a number of 3rd party utilities that provide for extracting select data from your iPhone's backup for access on your computer - viewing/archiving/printing, etc.
    Here is one.
    http://www.mobilesyncbrowser.com/

  • How to make html file from a text field data

    hi!
    I want to know how to make a file with .html extension and the data in this file should be from a text field. like i want to enter some thing in a text area and have to place it in a file on server side in html formate.

    so you told us what you want, but what is your question?

  • How to save HTML file with images present in the server to local machine

    Hi all
    In my application i have a option for the user to save HTML files with images present in the server. The HTML file is getting saved but the images are not being saved.
    The code i am using is below :-
    l
                        File fname = new File(filePath);
                        if(!fname.exists())                return;
                        FileInputStream istr = null;
                        OutputStream ostr = null;
                        response.setContentType("application/"+format);
                        response.setHeader("Content-Disposition", "attachment; filename=\"" + fname.getName() + "\";");
                        try { 
                             istr = new FileInputStream(fname);
                             ostr = response.getOutputStream();
                             int curByte=-1;
                             while( (curByte=istr.read()) !=-1)
                                  ostr.write(curByte);
                             ostr.flush();
    Can anyone suggest what i need to do
    regards

    The client should probably parse the html that comes down, and look for <img> links, and request those of the server as well.

  • How to create a .mdf SQL Server database from a Data-Tier Application file that has data?

    This is a noob question, though I do use SQL Server databases all the time with Entity Framework when I code in C# using Visual Studio 2013.  The development environment is found below at [A].  I am trying to make a clone of a SQL Server 2008 R2
    database (.mdf)  that exists online.  I can read, connect and work with this database in Visual Studio 2013, but I wish to make a local copy of the database, as an .MDF file.  Somewhere in my notes I have a way of creating a local copy from
    an online database when using Visual Studio but I forgot how (it seems, reviewing my notes, that it deals with ADO.NET which is deprecated in Visual Studio 2013 these days, or so it seems).  So I'm looking for another way.  What I did was create
    (or export) a "Data-Tier Application File" from the online SQL Server database, with data, and it seems to have worked in that this Data-Tier Application file exists on my hard drive and seems to have data in it ("SQL Server Replication Snapshot"
    is the format it seems).  It contains skeleton code to create a database, but when I tried to execute it with SQL Server 2014 Management Studio, I got a bunch of errors.
    So my question is:
    1) Can I somehow create a .MDF SQL Server Database from an Data-Tier Application file that has data?  What tool do I use?  I saw this link, http://social.technet.microsoft.com/wiki/contents/articles/2639.how-to-use-data-tier-application-import-and-export-with-a-windows-azure-sql-database.aspx 
    and it relates to Azure, but is there a tool for C#Visual Studio 2013, standalone?
    2) If there's an easy way to create a .mdf SQL Server Database file from an online file, within SQL Server Management Studio?  I don't think so, since it would require Administrator permissions on the online server, which I don't have. I have permission
    to read, update, delete the online database file, but strangely not to download it (the service I use has a tool for backup, but not for download).
    3) same question as 2), but for Visual Studio 2013?  I don't think so, since I notice none of the templates even mentions ADO.NET anymore, but instead they go with Entity Framework.  Using EF I can of course do anything I want with the online database
    (CRUD), but it remains online.  Maybe there's a switch to make a local copy?  I guess I could write a short program to suck all the data out of the online database and put it into a new, duplicate database having the same tables, that I create on
    my localhost, but my question here is if there's an easier way than this, maybe a tool or command I can run from inside Visual Studio?
    Any advice on any of the above questions is appreciated.
    Thank you,
    Paul
    [A] Microsoft Visual Studio Professional 2013
    Version 12.0.21005.1 REL
    Microsoft .NET Framework
    Version 4.5.51641
    Microsoft Web Developer Tools 2013   2.0.40926.0
    SQL Server Data Tools   12.0.30919.1
    Microsoft SQL Server Data Tools
    Windows Azure Mobile Services Tools   1.0
    Windows Azure Mobile Services Tools

    Thanks but these links are too general to help.
    "2. what do you mean by online file?" - I mean the SQL Server database file is on a remote web server that I rent from, but I am not the administrator of.  I can access my database using SQL Server Authentication, but nothing more.
    Paul
    What do you mean by too general? It explains on how you can use data tier application to create and deploy databases
    May be this will help you to understand better
    http://www.databasejournal.com/features/mssql/article.php/3911041/Creating-Data-Tier-Applications--in-SQL-Server-2008-R2.htm
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • How to use mathscript node in server side with the parameter from the client side

    I tried to develop a server/client system with some algorithms written in matlab. So I included a mathscript node on the server side. The client will send the parameter to the server. According to these parameters, the sever will call the matlab functions to do some computings and then send the results back to the client. The server has to wait for all parameters received before the computings. How do I know this since I only connect the parameter variables to the inputs of mathscript node on the server. The sever cannot know whethere these parameters are the new ones or old ones since the client may send parameters multiple times?

    It seems to me you have two perfectly good options to start with. You could send all possible parameters in a single packet from the client to the server. This could be in the form of a cluster or an array of values. If by server/client you mean you are sending data over the network, then you could flatten this data to string before sending and unflatten it on the other side. Since all parameters come in one packet, you know all the data is valid every time you send data.
    The other option is to send the parameters individually, but include some extra information such as a timestamp or iteration count. The server keeps reading and storing parameter values until a packet arrives with the next timestamp. Alternatively, you could include some information such as an end-of-parameter-list boolean that is sent with every parameter. It would be false until the last parameter packet.
    Give it a thought. There are lots of solutions.
    Jarrod S.
    National Instruments

  • How to make an appointment with a contact from the address book directly to iCal

    What is the easiest way to make an appointment with a contact from the address book. My idea is that once you identify a contact down the bottom where it has Text message Share contact, add to favorites it would be nice if it had make appointment in iCal. The open up iCal to todays date and go from there with all the relevant details?

    In the Print dialogue box select Lists in the Style drop down box.

  • Dummy question: how to make html file working under weblogic

    I created a file called register.html, and I put it under
    weblogic\myserver\public_html directory, but when I try to access from the
    browser, I get the following error:
    From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:
    10.4.5 404 Not Found
    The server has not found anything matching the Request-URI. No indication is
    given of whether the condition is temporary or permanent.
    If the server does not wish to make this information available to the
    client, the status code 403 (Forbidden) can be used instead. The 410 (Gone)
    status code SHOULD be used if the server knows, through some internally
    configurable mechanism, that an old resource is permanently unavailable and
    has no forwarding address.
    What should I do to make this html file working?
    Thank you for any help.
    li

    I solved the problem.
    "li" <[email protected]> wrote in message
    news:[email protected]..
    I created a file called register.html, and I put it under
    weblogic\myserver\public_html directory, but when I try to access from the
    browser, I get the following error:
    From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:
    10.4.5 404 Not Found
    The server has not found anything matching the Request-URI. No indicationis
    given of whether the condition is temporary or permanent.
    If the server does not wish to make this information available to the
    client, the status code 403 (Forbidden) can be used instead. The 410(Gone)
    status code SHOULD be used if the server knows, through some internally
    configurable mechanism, that an old resource is permanently unavailableand
    has no forwarding address.
    What should I do to make this html file working?
    Thank you for any help.
    li

  • How to display HTML file  (on server path) to ADF jspx page ?

    Hi Team,
    We have a requirement to display HTML content which is in tabular format on a page. This page is jspx page based on page template and this html has to be shown on a radio button select. I am trying to do this with Jquery but since the id of all components in jspx comes as pt1:id (pt1 being the id of page template) and : being a special character in Jquery, I am not able to proceed further.
    the syntax of Jquery to load html file a POC has been done outside Jdeveloper is working fine with a general syntax of
    $("#selector".load("html path"));
    Please let me know is they any other solution to load the file?
    Thanks
    Pavan

    For example
    - (void)viewDidLoad {
        [super viewDidLoad];
        NSURL *fileURL = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"readMe" ofType:@"html"]];
        [infoWebView loadRequest:[NSURLRequest requestWithURL:fileURL]];
    and from the .h
    @property (nonatomic, retain) IBOutlet UIWebView *infoWebView;

  • How to print html file on client system without viewing data on client syst

    I want to print html data from database.
    i am not able to print it using java code,
    javascript can do that.
    but in javascript window is opened on client browser.
    but i dont want to open that
    var disp_setting="toolbar=no,location=no,directories=no,menubar=no,";
           disp_setting+="scrollbars=no,width=0,height=0";
         var docprint = window.open("","",disp_setting);
         //docprint = new PopUpWindow() ;
         docprint.document.write('<%= mm %>');
         docprint.document.close();
            docprint.focus();
         docprint.document = null; mm contents the data to be printed. it prints well but window is shown
    in mm there is <BODY self.print() > so it prints on printer but i am viewing window i donot want to view window....
    and print Dialog box also.. I want to by pass this both.
    please send me code or any help regarding that.
    ....

    1. Post a javascript question on a javascript forum please.
    2. Don't think you can bypass without some plugin/setting on the client browser.

  • Generating a PDF file from the date entered on line and serving it to user

    All,
    I need to create a page where the data will be entered by the user outside the company.
    The requirement is to create a pdf file which dynamic images and a bar code and server ir once the user clicks a button.
    In short, they do not want the user to go to the report manager or process monitor to see the image.
    Any thought on how this can be accomplished ?

    Is there a special reason to create PDF file? I have generated dynamic images and HTML content including Barcode based on user data entry on the fly.If you need more information, please contact me at [email protected]

  • How to make a simple C program universal from the command line???

    Hi all,
    I've developed widgets that use a simple C program. I had no clue how to make it universal. Apple documentation is all about big projects to be developed inside Xcode and so on, but I don't understand even the introductory remarks...
    As far as I've read, I have to make a binary for PPC and a binary for i386, and then merge it with lipo. Fine. I get my PPC binary from:
    gcc-4.0 prog.c -o prog_ppc -lm -arch ppc -arch ppc64
    Now, it seems that I have to use:
    gcc-4.0 prog.c -o prog_i386 -lm -arch i386
    The latter command didn't work until I added -L/Developer/SDKs/MacOSX10.4u.sdk/usr/lib/ at the end. With this, it creates a binary file, but with the following message:
    /usr/bin/ld: warning fat file: /usr/lib/system/libmathCommon.A.dylib does not contain an architecture that matches the specified -arch flag: i386 (file ignored)
    and I guess this is quite an issue if I don't have the common math functions, no?...
    Can somebody help me? I googled a lot on this, and found nothing helpful.
    Cédric

    Thanks, it helped me. I googled a bit to build up my Makefile, and this is what I got.
    CC= gcc-4.0
    CFLAGS= -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386
    LDFLAGS= -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk -lm
    TARGETS= skycalc.fixed.c
    all: $(TARGETS)
    $(CC) $(TARGETS) $(CFLAGS) $(LDFLAGS) -o skycalc_universal
    Thanks again.

  • How to delete other files(yellow color code) from the hard drive, how to delete other files from the hard drive

    how can i delete the yellow color code items from my hard drive? What are these other files anyway? I wanna save some memory space from my storage.

    Macbook Pro community is here
    Following thread could solve your question.
    https://discussions.apple.com/message/19030300#19030300

  • How do I "delete" files that I emptied from the trash but not securely deleted

    just dont want to waste memory

    They are gone. Securely deleting a file or files in no way affects memory. It doesn't affect disk storage space either. I merely makes it more difficult for someone to recover data from a hard drive.

Maybe you are looking for

  • PR table/Report

    Hi all, IS there any table/report which lists out the Planned orders and the converter Purchase requisitions from planned orders? I want a report/table which lists out Purchase requisitions and related Planned orders. Thanks, Avani.

  • How to submit a form in jsp from tag handler class

    I have a form in jsp.I created some more links in the tag handler class.Based on the link we click form action will take place.Now how can i submit the form in tag handler class for the links i created in that class.

  • Can I put my DVD's onto itunes, then onto my iPOD????

    I just got my macbook, and just got a new video ipod...was wondering if there is a way to put a DVD onto my ipod, because when i tried to do it, nothing came up in itunes and it just started to play in the DVD player....any help would be great. Thank

  • What to do when the wrong payment is voided?

    Hello, I need a pointer in the right direction. An user has voided the wrong check. This check has already been cashed, but Cash Management has not reconciled it in the system yet. So now, we have an invoice that is re-opened, and a void in the posit

  • HELP: Possible to nest %=expression% within javascript code?

    Hi, I'm working on an application where I need to use dynamic JSP variables in javascript, as shown below onclick="jsFunc(this.form, '<=myClass.getSpecialString()%>');">(Te code is originally within a button tag) This will not work, any ideas why? If