How to print html code block

hi all
i have a problem about printing my html code block in a loop ...for example;
<%
int i;
for(i=1;i<10;i++)
     out.println("<h1>Hi ALL</h1><h2>Hi All</h2>");
%>it works well because the html code is just one line.
but if i want to print very long html code how am i going to print that???
for example i want to print that html code;what am i going to do now
<table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="800" height="60" valign="top"><div align="center">
            <span class="style1">Ders Ad&#305;</span>:          
            <%
          dersismi.next();
            %>
          <span class="stilim"><%out.println(dersismi.getString("DERS_ADI"));%></span>
          </div></td>
      </tr>
    </table>thanks for your help

If you are printing out large blocks of HTML you shouldn't be using any java command. You should just write the HTML like you have in your example.
The whole point of JSP was that you didn't have to put out.println() statements into a servlet!.
If you just want to out.println a value into the HTML, consider using the <%= %> expression tag. ie rather than <%out.println(dersismi.getString("DERS_ADI"));%>
just have
<%= dersismi.getString("DERS_ADI") %>
If you want to set up a loop, you can intersperse java and html code, but thats ugly. I would recommend using JSTL custom tags for looping.
Good luck,
evnafets

Similar Messages

  • How to print html code in sap

    Hi gurus
    my requirement is to display html code in sap. in transaction o12c i am giving the html code in longtext , i want to display in co60 transaction . now when i am going to co60 it is taking as textfile instead of html.Plz give a solution
    thanks
    vivek

    Hi Vivek,
    You can take reference of BCALV_DEMO_HTML  this program.
    Regards,
    Pravin

  • How to print HTML to a remote Server

    Ho guys my problem is only this
    how to print HTML to a remote Server
    i hav used JavaPrintService for it javax.print....
    The Doc Flavor i used is
    DocFlavor.INPUT_STREAM_TEXT_HTML_HOST;
    and with simple print attribute set but it doesnt locates
    the PrintSerivces.
    Plz try this code on your system(Jdk1.4 beta) and see whether it detects PrintServices or not
    import java.io.*;
    import javax.print.*;
    import javax.print.attribute.*;
    import javax.print.attribute.standard.*;
    import javax.print.event.*;
    public class PrintHTML {
    FileReader readfile;
    Doc doc;
         public static void main(String args[]) {
              PrintHTML ps = new PrintHTML();
         public PrintHTML() {
              DocFlavor flavor =DocFlavor.INPUT_STREAM_TEXT_HTML_HOST;
              PrintRequestAttributeSet aset =
                   new HashPrintRequestAttributeSet();
              aset.add(MediaSizeName.ISO_A4);
              // aset.add(OrientationRequested.LANDSCAPE);
              aset.add(new Copies(1));
    PrintService[] pservices =
                   PrintServiceLookup.lookupPrintServices(flavor, aset);
    if (pservices.length > 0) {
                   System.out.println("Available printer " + pservices[0].getName());
                   System.out.println("Available printer " + pservices[1].getName());     
                   System.out.println("Available printer " + pservices[2].getName());     

    The documentation is misleading. You cannot directly print HTML. See:
    http://developer.java.sun.com/developer/bugParade/bugs/4495770.html

  • How to print claim code for envy 5530 without connecting to internet?

    how to print claim code for hp envy 5530 without connecting to internet. We do not have wireless internet and we are trying to set up the eprint app for our samsun android phones and ipad. We need to print off the claim code from the printer but it seems we need to have internet for that. is there any way around that?
    Thanks

    Hi,
    You have to, without connecting to the internet, the claim code (if you can get one) is useless.
    Regards.
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

  • How to Print Bar codes in SAP script.

    Hi Experts,
    Could you please tell me how to print bar codes through sapscript (the steps basically)?
    <<text removed by moderator>>
    Thanks in advance,
    Suchi.
    Edited by: Matt on Nov 13, 2008 2:04 PM - do not use ASAP or urgent.

    hi,
    check these.
    [https://forums.sdn.sap.com/click.jspa?searchID=18572128&messageID=4724540]
    [http://help.sap.com/saphelp_nw04/helpdata/en/68/4a0d5b74110d44b1b88d9b6aa1315b/content.htm]

  • How to print HTML contents

    can anyone tell me how to print HTML contents...i needed it urgently
    Thanks

    actually i have a print button on html page....when i click on print button using window.print(); the html page gets printed...but along with it print button is also printed...i dont want print button to be printed...
    this is the issue...
    please resolve it
    Thanks a lot...

  • How to write html code in narrative

    Hi,
    How to write html code in narrative to get following format
    desc value1 Value2 totalvalue
    a 10 20 30
    b 20 30 50
    Totalvalue 30 50 80
    Total % 0.3 0.5 0.8
    Can any one help guide on writing HTMl code for above table format in narrative type of display data at report level
    Thank you
    Manu

    Hi Balu,
    If you are using the Web Application server (WEBAs), Then you can create applications using BSP( Bussiness server pages). Which is some what luike JSP.
    Or
    In SE80 , Try to create internet service files uisng BHTML. In the dropdown select internet service. And then try to create the HTML templates
    Thanks,
    Sarayoodharan.K

  • How to embed html code in flash builder 4 ?

    How to embed html code in flash builder 4 ?

    Ya i tried by keeping <fx:Declarations> part but still it is throwing error,
    In flex3 we are making a component ex: <mx:canvas> and changeing that component to
    <cairngorm:ServiceLocator xmlns:mx="http://www.adobe.com/2006/mxml"
    xmlns:cairngorm="com.adobe.cairngorm.business.*">
    </cairngorm:ServiceLocator>
    if any one used 4.5 with cairngorm let me know
    thanks

  • How to keep HTML code in the applet source (.java) file itself?

    Hi,
    How to keep HTML code (APPLET tag) in the applet source (.java) file itself?
    Please give an example?
    thank you,

    R6i wrote:
    ...What I mean is without writing external HTML file, how to run an applet (during practice)?'Practice'? What does that mean? During development? If that is what you are referring to, add an applet tag at the top of YourApplet.java inside a Java comment area. Then AppletViewer (in recent SDKs) can then run it with just..
    prompt:javac YourApplet.java
    prompt:// the '.java' extension is not a mistake
    prompt:appletviewer YourApplet.javaIf you do not mean 'during development', then that brings us back to +"What advantages do you see that is bringing to the end user?".+

  • Adobe Muse: how to access HTML code inserted?

    Hi everyone,
    do you know how to edit HTML code already inserted in an Adobe Muse template?
    This code is for analytics purpose.
    Thanx
    fremo

    This forum is actually about the Cloud, not about using individual programs
    Once your program downloads and installs with no errors, you need the program forum
    If you start at the Forums Index http://forums.adobe.com/index.jspa
    You will be able to select a forum for the specific Adobe product(s) you use
    Click the "down arrow" symbol on the right (where it says ALL FORUMS) to open the drop down list and scroll
    http://forums.adobe.com/community/muse for program questions

  • How to print html as it appears in internet explorer

    i've been workin on a program (volunteer work) to help storing database ...... i am almost close to finals in my school and im lookin for a way to finish fast, im desperate i've been workin for 3 month no sleep ..... please i just need advise on:
    1- I am linking my program through JDBC and imma access the code through java and do the changes but before doing that i need to know if i would be able to print the Html page as you can see it throu internet explorer. I dont know how to use a code in java to print the Html PAGE, i havent started on that cz i wana make sure i can print an html before editing the files. I have all my forms that i need to fill in .doc .html i can create them in any file whichever is more easy and convenient (i can do them in any format).would it be hard to print preview my html page throu java as well?
    2- how to make my java executable through jar or whatever is good, and how to create an installation wizard for my program and how to set the path for all internal files so the program can function as it functions in java.
    3- How to transfer the JTextPane to a file and save the style with it (bold or italic or Underline {bass im not saving any other styles })
    4- i need to figure out how to make a SpellCheck button that checks for error and give me the option to replace or add to dictionary and i need the button to access a JTextPane.
    5-i am creating a page that actually Display(play),save and delete audio and pictures. my program has multiple cases how am i gonna be able to save pics and audio in like seperate folders for each case?? and of course create that folder???
    i know its a lot of stuff anything u can advise would be helpful just any links or help as far as code
    any advise on getting answers or using this forum is appreciated, that;s my first trial as going to an online source in forums all ive been reading is the book and internet resources
    Edited by: cchaptini on Mar 8, 2008 3:17 AM

    Hi ,
    Try this
    SQL> set serveroutput on size 1000000;
    SQL>SQL> ed
    Wrote file afiedt.buf
    1 declare
    2 str varchar2(32000);
    3 begin
    4 str := 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    5 for i in 0 .. length(str)/250 Loop
    6 dbms_output.Put_line(substr(str, i*250+1, 250) );
    7 end loop;
    8* end;
    SQL> /
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    aaaaaaaaaa
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    aaaaaaaaaa
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.02
    Thanks
    Suni

  • ___Advice on how to print html from an applet___

    I have been working on this problem for a little while, but still can't find a good solution. I ask for any help/advice I can receive on this matter.
    Below is what I have already tried:
    1) Place the HTML within a JEditorPane and print the graphics object.
    * In order to do this I would have to display the HTML, which I do not want to do.
    * I have also tried placing the HTML within a JEditorPane and not display it, but I get no data from printing the graphics object.
    2) Print the View classes that contain the text by placing the html into a JEditorPane ex) JEditorPane.getUI().getRootView(jeditorPane).
    * This method is how the following article prints HTML: http://www.fawcette.com/javapro/2002_12/online/print_kgauthier_12_10_02/
    * This class prints each "leaf" view, which unfortunately will not print lists or table borders b/c they are contained in "branch" views. I have not been able to convert this class to print the branch views in a nice looking format.
    3) Use a DocFlavor of type "text/html" and send document to the printer.
    * Some printers can render html, but these are few and far between. Most printers I am dealing with do not accept type text/html.
    Below are some things I am thinking about trying:
    1) Convert the HTML to postscript and print the postscript.
    * I have no clue how to do this. I have searched the internet for code and found nothing but perl code (but I am using a java applet).
    2) Save the html file to users disk and open html file in new browser window. Then use javascript print function.
    * I really do not want to have to save files to the users disk just to print. This seems like the easiest way, but is also the least user-convient way.
    I would greatly appreciate any advice on printing HTML using java. Should I re-examine the methods I already tried? Can anyone give input on the methods I am planning to try? I would think this is a common problem, but I am having a hard time finding answers.
    Thanks for your interest and any help you can provide :)

    I tried the Java printing API in 1.4.2 but found it hopeless in terms of printing anything without using AWT.
    Also since the print service was going to be on Windows machine I used jawin (http://sf.net/projects/jawinproject/) to query the registry for the command to print a particular extension and then exec that command.

  • How to see html code in a php file using CS5.5 without using testing server?

    In CS5.5 when I open a page with php extention, DW does not show any html code in design view without me having to set up a testing server. In DW 8 it would open the same files and show me the html in design view. I have no need to test php code, I just need to alter the html. Is there a setting I can change to enable this in CS5.5? Thanks.

    Below is the code. I discovered that if I create a new php document not from
    a template, then I can see the html elements in design view. If I create a
    new page from a template and save it as html, design view still works, but
    if I save a new page from template and save it as php, I only see symbols
    for php and nothing else in design view.
    Thanks for your help on this.
    <!--
    body
    /* ~~ Element/tag selectors ~~ */
    ul, ol, dl { /* Due to variations between browsers, it's best practices to
    zero padding and margin on lists. For consistency, you can either specify
    the amounts you want here, or on the list items (LI, DT, DD) they contain.
    Remember that what you do here will cascade to the .nav list unless you
    write a more specific selector. */
        padding: 0;
        margin: 0;
    h1, h2, h3, h4, h5, h6, p {
        margin-top: 0;     /* removing the top margin gets around an issue where
    margins can escape from their containing div. The remaining bottom margin
    will hold it away from any elements that follow. */
        padding-right: 15px;
        padding-left: 15px; /* adding the padding to the sides of the elements
    within the divs, instead of the divs themselves, gets rid of any box model
    math. A nested div with side padding can also be used as an alternate
    method. */
    a img { /* this selector removes the default blue border displayed in some
    browsers around an image when it is surrounded by a link */
        border: none;
    /* ~~ Styling for your site's links must remain in this order - including
    the group of selectors that create the hover effect. ~~ */
    a:link
    a:visited
    a:hover, a:active, a:focus { /* this group of selectors will give a keyboard
    navigator the same hover experience as the person using a mouse. */
        text-decoration: none;
    /* ~~ This fixed width container surrounds all other divs ~~ */
    .container
    /* ~~ The header is not given a width. It will extend the full width of your
    layout. It contains an image placeholder that should be replaced with your
    own linked logo. ~~ */
    .header
    /* ~~ These are the columns for the layout. ~~
    1) Padding is only placed on the top and/or bottom of the divs. The elements
    within these divs have padding on their sides. This saves you from any "box
    model math". Keep in mind, if you add any side padding or border to the div
    itself, it will be added to the width you define to create the *total*
    width. You may also choose to remove the padding on the element in the div
    and place a second div within it with no width and the padding necessary for
    your design.
    2) No margin has been given to the columns since they are all floated. If
    you must add margin, avoid placing it on the side you're floating toward
    (for example: a right margin on a div set to float right). Many times,
    padding can be used instead. For divs where this rule must be broken, you
    should add a "display:inline" declaration to the div's rule to tame a bug
    where some versions of Internet Explorer double the margin.
    3) Since classes can be used multiple times in a document (and an element
    can also have multiple classes applied), the columns have been assigned
    class names instead of IDs. For example, two sidebar divs could be stacked
    if necessary. These can very easily be changed to IDs if that's your
    preference, as long as you'll only be using them once per document.
    4) If you prefer your nav on the right instead of the left, simply float
    these columns the opposite direction (all right instead of all left) and
    they'll render in reverse order. There's no need to move the divs around in
    the HTML source.
    /* sidebar1 = left */
    .sidebar1
    .content
    .sidebar2
    /* ~~ This grouped selector gives the lists in the .content area space ~~ */
    .content ul, .content ol
    /* ~~ The navigation list styles (can be removed if you choose to use a
    premade flyout menu like Spry) ~~ */
    ul.nav {
        list-style: none; /* this removes the list marker */
        border-top: 1px solid #666; /* this creates the top border for the
    links - all others are placed using a bottom border on the LI */
        margin-bottom: 15px; /* this creates the space between the navigation on
    the content below */
    ul.nav li {
        border-bottom: 1px solid #666; /* this creates the button separation */
    ul.nav a, ul.nav a:visited { /* grouping these selectors makes sure that
    your links retain their button look even after being visited */
        padding: 5px 5px 5px 15px;
        display: block; /* this gives the anchor block properties so it fills
    out the whole LI that contains it so that the entire area reacts to a mouse
    click. */
        width: 160px;  /*this width makes the entire button clickable for IE6.
    If you don't need to support IE6, it can be removed. Calculate the proper
    width by subtracting the padding on this link from the width of your sidebar
    container. */
        text-decoration: none;
        background: #C6D580;
    ul.nav a:hover, ul.nav a:active, ul.nav a:focus { /* this changes the
    background and text color for both mouse and keyboard navigators */
        background: #ADB96E;
        color: #FFF;
    /* ~~ The footer styles ~~ */
    .footer
    /* ~~ Miscellaneous float/clear classes ~~ */
    .fltrt {  /* this class can be used to float an element right in your page.
    The floated element must precede the element it should be next to on the
    page. */
        float: right;
        margin-left: 8px;
    .fltlft { /* this class can be used to float an element left in your page.
    The floated element must precede the element it should be next to on the
    page. */
        float: left;
        margin-right: 8px;
    .clearfloat { /* this class can be placed on a
    or empty div as the
    final element following the last floated div (within the .container) if the
    .footer is removed or taken out of the .container */
        clear:both;
        height:0;
        font-size: 1px;
        line-height: 0px;
    TD.mincart {
        font-size: 10px;
        font-family : Verdana;
        position:relative:
        left: 10px;
        top: -30px;
    P.mincart {
        font-size: 10px;
        font-family : Verdana;position:relative:
        left: 10px;
        top: -30px;
    #search 
    #minicartdiv
    P.smaller{
        text-align:center;
        font-size: 12px;
        position: relative;
        top: 1px;
    #tagline {
        font-weight: bold;
        color: #03F;
        height: 18px;
        width: 350px;
        font-size: 18px;
        position: relative;
        left: 10px;
        padding-bottom: 10px;
    #contact {
        font-size: 12px;
        float: right;
        height: 18px;
        position: relative;
        padding-right: 10px;
        font-weight: bold;
        font-family: "Courier New", Courier, monospace;
        padding-top: 7px;
    Call 541-424-5555 Mon-Fri 7am-4pm Pacific Time. Email:
    [email protected]
    Bluetooth and More! No Sales Tax!
    body, this
    is a test
     [Home | index.php] - Store Policies - Products
            - Search - Checkout
            email: [email protected] Call
    541-424-5555</p>
      <!-- end .footer --></div>
      <!-- end .container --></div>
    SSL
    COT("images/cot.gif", "SC2", "none");
    </html

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

  • How to print BAR CODE in SAP SMART FORMS

    Hi,
    I want to print inspection lot's BAR CODE in the smart form, but i dont know the way how to print this into the smartform.
    if anyone have any idea, please suggest me how to print this as it is urgent for me to complete the object.
    Thanks in advance.
    Best Regards,
    Abnish Jain

    Hello Abnish,
    Welcome to SDN.
    We are able to print barcodes from smartforms. Doing this way, we print barcodes on laser printers.
    We are also printing from sap to zebra printers using two ways:
    1. Download the data to an excel sheet, then creating a macro that opens the printer port and sending the commands to the printer through this "file". All this is done via vb script provided with excel)..
    2. The second way is creating a vbscript (an ascii file from sap) with the printer commands and then runing it using ws_execute.
    You need a barcode reader to read the barcodes, and this scanner acts like a keyboard, it sends the data scanned to the active field on screen. (which might be a notepad, word, excel or an input field or ... ).
    From 4.6c on, you can use smartforms to print barcodes without buying any barcode.dll software nor hardware extention like Bardimm on any laser/inkjet printer (Please Note that I haven't mentioned Zebra printers here!). To do this, you have to create a smartstyle -> character format with the desired barcode font (defined within sap). Then in the smartform, create a window, put the field and associate it the character format. That's all (I mean, that's all we do at least :-). I think, you have to consider the barcode specifications before sending the barcode value to the smartform (Just an example, if you're using 3 of 9, the code should start and end with an asterisk - '*' -) We're printing an interleaved 2 out of 5 barcode in our invoices due to a legal requirement, and we did it this way.
    3. If you have a barcode scanner, then you should not need reading the barcode into an ascii file to get the data read in an standard or custom screen field. You can read it directly to the field you want. (unless... you have complex data coded in the barcode - for example if you're using an ean-ucc 128 compliant code and you're sending several fields in a single code ... In this case, an interface is almost mandatory because you must interpret the data fields according to the ucc standard, split the code into several fields .... and .... pure programming logic ).
    To put it clear: if you have to read, for example, a barcode that holds the legal number of an invoice using a barcode scanner and this number should be sent to migo-> bktxt then you don't need an interface. The scanner itself acts like a fast operator entering the characters using a keyboard and filling in the field.
    We're reading barcodes in several places (when we finish each pallet, when we receive an invoice, and so on. Each case is a different screen. We arent using an ascii file to read these barcodes. Furthermore, we read the invoice legal number into migo bktxt field (Head Text).
    http://www.sap-img.com/abap/questions-about-bar-code-printing-in-sap.htm
    Regards
    Naren

Maybe you are looking for

  • I upgraded to Firefox 12.0. Now, my Gmail calendar will not open in edit mode. I reverted to Explorer, and the calendar does open there. What is the remedy?

    I upgraded to Firefox 12.0. Now, when I attempt to reach my Gmail calendar, it only comes up in read-only mode. I temporarily went to Explorer. the calendar comes up in edit mode without issue. What should be my next steps to resolve this?

  • Corrupted fonts

    After upgrading to Snow Leopard Mail was not displaying some fonts correctly. In particular, for me, courier was corrupted. I tracked down the problem to a corrupted font family. Using the font book I deleted the bad fonts and that seemed to resolve

  • Crystal using parameter from universe

    When creating parameter in a Crystal report using a universe the LOV becomes static.  This is a weak limitation in the tool.  Has anyone found a work around so that the parameter is dynamic as it was intended and the parameter LOV is refreshed each t

  • CiscoWorks Updates

    I'm new to CiscoWorks and inherited 2 LMS 3.2 servers about 2 months ago.  Sense the server build in Januray this year, there has not been any updates/upgrades to it at all.  The following is the current build info I was able to collect - Integration

  • List all of the existing column and there column format and data format?

    Hello Gurus, I am new to OBIEE and i have a requirement to verify the column format and data format for all of the existing column while generating a analysis report. Is there any way i can list down all of the columns which are exposed and list ther