How to format html output of a servlet

Hello.
My servlet/JSP is processed by custom tags and XSL Translation.
After all its HTML output looks not formatted.
How to format it?
It is possible in a standard way (using a web.xml'd directive)?
What roughly I want:
<html>
  <body>
  <body>
<html>

I'd try
indent="yes" in your XSLT's<xsl:output .../>element.
Hope this helps,
-Scott

Similar Messages

  • Need Formatted html output from Xalan

    We use xalan xslt processor to convert
    xml document to html. Everything works
    fine, except the output is unformatted html.
    (ie. several HTML elements appear on the
    same line. Some lines are longer than 1000
    characters). This happens inspite of me
    specifying the HTML elements in different
    lines in the xsl.
    I would like to know if there is any way, I can generate formatted html output.
    Thanks

    have u tried
    <xsl:output indent="yes"/>
    in your stylesheet?
    ravi <[email protected]> wrote:
    We use xalan xslt processor to convert
    xml document to html. Everything works
    fine, except the output is unformatted html.
    (ie. several HTML elements appear on the
    same line. Some lines are longer than 1000
    characters). This happens inspite of me
    specifying the HTML elements in different
    lines in the xsl.
    I would like to know if there is any way, I can generate formatted html
    output.
    Thanks

  • Formatted HTML output with Spry regions - is it possible?

    I have recently begun using the XML export extension in
    conjunction with an Access database to output dynamic data into a
    page with a Spry master/detail setup. So far, my simple example is
    going great, but I've run into a snag that I need some help with.
    To explain what I'm doing - it's a simple article page with
    the list of articles on the left with the title and date and the
    article title and full contents on the right hand side. So far it's
    all working very well, updating in real time when I click an
    article title on the left. The problem is the output with this one
    field which stores not only text, but also HTML formatting that is
    generated by a wysiwyg editor used on the article creation side of
    this little app. This HTML formatted content is the article body
    and is stored in a field named the same - "body". With traditional
    ASP, the HTML formatting displays as expected and all is well, but
    with Spry, it doesn't output formatted HTML, but instead shows the
    content and HTML code together as text. How can I get this one
    field ("body") to be output so all the HTML formatting is shown?
    This is my simple page example. Click through and you'll see
    what I mean.
    http://www.shoestodyefor.com/ajax.asp
    Here's the section of code in question regarding the output
    on that right hand panel where the body is displayed for each
    article:
    <div spry:detailregion="ds1">
    {title}<br />
    {entryDate}<br />
    <br />
    {body}
    /div>
    Is it possible to have that {body} section shown so the
    dynamically created HTML code from the wysiwyg editor is displayed
    correctly?

    Steve Skinner wrote:
    > Is it possible to have that {body} section shown so the
    dynamically created
    > HTML code from the wysiwyg editor is displayed
    correctly?
    The version of Spry that ships with Dreamweaver CS3 (Spry
    1.4) doesn't
    support the type of output created by the XML Export
    extension.
    This issue has been corrected in Spry 1.5, but no plans have
    been made
    public for integrating Spry 1.5 into Dreamweaver CS3. You
    would need to
    download Spry 1.5 from
    http://labs.adobe.com/technologies/spry/.
    Details
    of how to hand-code the fix for output from XML Export are
    here:
    http://labs.adobe.com/technologies/spry/samples/data_region/HTMLFragsInXMLSample.html
    David Powers, Adobe Community Expert
    Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • Help: No Parameters, HTML Output from Java Servlet

    I have a Java Servlet that reads parameters passed from an HTML form and displays them to another HTML page. I know the servlet is being invoked; however, I am not seeing any HTML output. Sending the output to a file reveals the parameters are coming in as NULL as well.
    I attempted a simple sample app with the same results. Here is what I am running:
    The HTML Form:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE>Collecting Three Parameters</TITLE>
    </HEAD>
    <BODY BGCOLOR="#FDF5E6">
    <H1 ALIGN="CENTER">Collecting Three Parameters</H1>
    <FORM ACTION="ThreeParams">
    First Parameter: <INPUT TYPE="TEXT" NAME="param1"><BR>
    Second Parameter: <INPUT TYPE="TEXT" NAME="param2"><BR>
    Third Parameter: <INPUT TYPE="TEXT" NAME="param3"><BR>
    <CENTER><INPUT TYPE="SUBMIT"></CENTER>
    </FORM>
    </BODY>
    </HTML>
    The Java Code:
    public class ThreeParams extends HttpServlet {
    public void doGet(HttpServletRequest request,
    HttpServletResponse response)
    throws ServletException, IOException {
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    String title = "Reading Three Request Parameters";
    out.println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 " +
         "Transitional//EN\">\n" +
    "<BODY BGCOLOR=\"#FDF5E6\">\n" +
    "<H1 ALIGN=\"CENTER\">" + title + "</H1>\n" +
    "<UL>\n" +
    " <LI><B>param1</B>: "
    + request.getParameter("param1") + "\n" +
    " <LI><B>param2</B>: "
    + request.getParameter("param2") + "\n" +
    " <LI><B>param3</B>: "
    + request.getParameter("param3") + "\n" +
    "</UL>\n" +
    "</BODY></HTML>");
    What happens when I "submit" from the form is the same form reloads with the query string in the URL: "http://localhost:8080/ThreeParams/?param1=1&param2=2&param3=3"
    Any assistance with either (or both) would be thoroughly appreciated:
    a) why the parameters are not being passed correctly to the servlet
    b) why the HTML output page is not displayed
    Thanks in advance!
    - Steve

    I have found the answer to my problem listed in another thread.
    Thank you.

  • How to format sqlplus output

    In previous OTN Forum format we used {code} to format sqlplus output , how to do in this version ?

    Click on "Use Advanced Editor".
    Highlight your code.
    Click on the symbol >>
    Select Syntax Highlighting
    Select SQL...output looks like below:
    select sysdate from dual;

  • Forgot how to format HTML  in Text Area

    Hello all,
    I totally forgot something. How do you format HTML when rendering in Text area
    Suppose I pass in a string that a text area grabs for display.
    xxx.getAdditionalComments(existingComments + "\n"  +  "<B>" + date + "<\B> " + name);The text are will always display the <B> instead of displaying the date in bold.
    I remember putting escape characters eons ago but I forgot how that worked. Anyone know how to render this with date being bolded?
    Thanks.

    If you mean the textarea HTML tag for text entry fields, you don't. If you forgot anything it's that you can't do things like that.

  • How to Buffer JSP Output Inside A Servlet

    Hello, we are trying to Process a JSP page inside a servlet and then do more processing and finnaly add the JSP output to the response output stream. I know there is a RequestDispatcher that lets you include a JSP page. However as far as I know all you can do with the RequestDispatcher is either include the JSP (which does not buffer it but simply adds it to the output stream) or forward to the JSP page. Any ideas? Thanks, - dk

    http://forum.java.sun.com/thread.jsp?forum=33&thread=377214

  • How to include HTML-Files / Temlplates in Servlets ?

    Yep, that's what i need to know.
    In JSP there is the include-Command, but with Servlets this Command doesn't work. It's for something else, i think.
    I wanna include a header- and a footer-Template within the most of my Servlets.
    Thx for Help
    Tobias

    You can use the request's dispatcher to include the contents of a template in your response:
    request.getRequestDispatcher("header.jsp").include(request, response);
    request.getRequestDispatcher("template1.jsp").include(request, response);
    if(...)
      request.getRequestDispatcher("template2.jsp").include(request, response);
    request.getRequestDispatcher("footer.jsp").include(request, response);This enables your Servlet to dynamically construct the view.
    Typically you'd decide which template to forward to in your Servlet and then just use the include directive in your JSP. However, sometimes the decision about what to include can only be resolved by the controller.
    There are various other ways of achieving the same result such as passing flags from the Servlet to the top-level JSP template via the request to instruct the JSP to include another template.
    Use whichever approach you feel most comfortable with.
    Hope this helps.

  • How to format the output of Today() ⨍(x)  when used in a formula

    This table should explain what I'm asking to do. Have the Wed, Nov 2, 2011 applied to a date when I use the Today() function. Without the workaround of refernencing another cell to pickup formatting like I do in the final row.
    Formula
    Cell Format
    Result
    =CONCATENATE("Today is ",TODAY())"
    Date: Mon,Jan 5, 2009 Time: None
    Today is 02/11/2011
    =TODAY()
    Date: Mon,Jan 5, 2009 Time: None
    Wed, Nov 2, 2011
    = CONCATENATE("Today is ",C3)
    Date: Mon,Jan 5, 2009 Time: None
    Today is Wed, Nov 2, 2011

    Hi Barry
    I just discover this thread.
    The main problem here is that as we aren't allowed to define the format used by TODAY() in the described formula, we have to use a formula which is localization dependant which is really annoying.
    For my own use, I will just use two columns :
    In the first one the formula would be :
    =IF(MID(""&1/2,2,1)=".","Nous sommes le","Today is")
    In the second one it would be :
    =TODAY()
    The vertical border between the two columns is set to white.
    But I think that the most efficient answer would be that Apple give us the ability to pass a parameter to TODAY() and/or NOW().
    This parameter would define the format which would remain the current one when the parameter is omitted.
    Yvan KOENIG (VALLAURIS, France)  07 /11 /2011 17:38:15
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.2
    My iDisk is : <http://public.me.com/koenigyvan>
    Please : Search for questions similar to your own before submitting them to the community

  • HTML output with CrystalReports Server 2008

    Hi there,
    I am thinking of evaluating the Crytsal Reports Server 2008. But basically, I just have one question about it:
    - How does the HTML output of the Crystal Reports Server look like? Can it be directly shown in a browser window?
    - Does the Crystal Reports Server offer a viewer such as the JRC? Does ther viewer also only run in a servlet or can it also be included in a web service?
    Thanks,
    Pascal

    With the Web Service SDK, you will need to have Crystal Reports Server running to use it. 
    Both the JRC and the Web Service SDK allow you to render reports in HTML; the JRC uses a built in viewer object to render the report in a web browser, whereas with the WS SDK you need to create your own viewer.
    In terms of the functionality they both employ, the Web Service SDK is very similar in nature to the Enterprise SDK and in fact uses the Enterprise SDK to perform many of its tasks, the difference being of course that requests are passed in the form of a web service to the server.  Enterprise SDK uses "managed reporting" (opens reports from the CMS database), and the JRC uses unmanaged reporting (opens reports from the file system).
    The [Developer Library|https://boc.sdn.sap.com/developer/library] is a good resource for finding tutorials and information about the SDK's available with Business Objects products.

  • Formatting the output

    Hi everyone in the forum,
    I do not know if i should post this question here, but i think is the best place. Sorry if i were wrong.
    just a question because i have no idea how to format the output i need.
    I have a REAL or FLOAT and the output restrictions shows that it should be:
    1.0000 D-08 if the value is less than 1
    1.0000 if the value is [1,9]
    1.0000 D+03 is value bigger than 9
    and the other problem is whith other variable (type String) which represents integers, e.g, 0.000000 1.0000000 2.000000; and i have to return only 0 1 2 .
    Any suggestion about how to format the output?
    Thanks

    DecimalFormat

  • Help with formatting multiline output into comma delimited ordered output

    I have 2 tables:
    SQL> desc table_1;
    Name Null? Type
    ===================================
    ID NOT NULL NUMBER
    DATA1 NOT NULL VARCHAR2(440)
    DATA2 NOT NULL VARCHAR2(1024)
    SQL> desc table_2;
    Name Null? Type
    ===================================
    ID NOT NULL NUMBER
    ATTNAME NOT NULL VARCHAR2(255)
    ATTVAL                          VARCHAR2 (4000)
    DATA1 NOT NULL CHAR(1)
    DATA2                          VARCHAR2 (2000)
    DATA3                          VARCHAR2 (255)
    I need to get ATTVAL from where e.g. ATTNAME=att_name1 to ATTNAME=att_name6 from every entry (with its unique ID), and format the output into comma delimited format in e.g. this order:
    att_val1,att_val3,att_val6,att_val4,att_val5,att_val6
    So e.g. for entry with ID "9812" from the query below, the output I need would be:
    187,179,156,134,1436,1809
    What I've got so far is as follows:
    SQL> SELECT id,attname,attval FROM table_2 WHERE id in (SELECT id from table_1 WHERE data2='xxx')
    AND attname in ('att_name1','att_name3','att_name6','att_name4','att_name5','att_name6');
    ID               ATTNAME               ATTVAL
    ===============================
    1970 att_name1 123
    1970 att_name2 abc
    1970 att_name3 1234
    1970 att_name4 def
    1970 att_name5 1134
    1970 att_name6 ghj
    9812 att_name4 134
    9812 att_name5 1436
    9812 att_name3 156
    9812 att_name1 187
    9812 att_name2 179
    9812 att_name6 1809
    77 att_name1 1980
    77 att_name5 1867
    77 att_name3 174
    77 att_name4 1345
    77 att_name2 1345
    77 att_name6 1345
    but I don't know how to format the output comma limited in certain order. (or if this is the best way of getting the data out)
    Would someone have idea how this could be done?

    846954 wrote:
    Thanks Frank!
    I got much further now :).
    I've got Oracle 10g So I used the "SYS_CONNECT_BY_PATH" for my query.
    Now I get the output in the format I want, however, it comes out in the order that the attributes are (which is pretty random).The values you posted are in order: 'attval1' < 'attval2' < ...
    So I'm using this now(had to use "|" as separator because SYS_CONNECT_BY_PATH would not work with comma due to some of the attval having comma in them ):The values you posted don't contain and commas.
    You're hiding what the problem is. It would really help if you posted actual data. It always helps if you post CREATE TABLE and INSERT statements for a little sample data, and the results you want from that data.
    Assuming you really have something that has to be in a certain order, and that order is not based on anything in the values themselves, then DECODE might be a good way to do it. Storing the sort value in a table might be even better.
    It looks like you were using an Oracle 9 exanple. In Oracle 10, using SYS_CONNECT_BY_PATH is simpler:
    SELECT     id
    ,     LTRIM ( SYS_CONNECT_BY_PATH (attval, '|')
               , '|'
               )          AS attvals
    FROM     (
              SELECT     id
              ,     attval
              ,     ROW_NUMBER () OVER ( PARTITION BY  id
                                  ORDER BY          DECODE (...)
                                )     AS curr
              WHERE     id     IN (
                             SELECT  id
                             FROM     table_1
                             WHERE     data2     = 'xxx'
              AND     attname     IN ('attname1','attname2','attname3','attname4','attname5','attname6')
    WHERE     CONNECT_BY_ISLEAF     = 1
    START WITH     curr     = 1
    CONNECT BY     curr     = PRIOR curr + 1
         AND     id     = PRIOR id
    ;You don't need two almost-identical ROW_NUMBERs; one will do just fine.

  • How to Generate HTML Report Output in Excel

    Dear Experts,
    How to convert HTML report output in Excel.
    I have reports which output is coming in HTML format & the same I want to use in Excel.
    So tell me how I can covert the same in Excel.
    Thanks
    Sudhir

    hello,
    in your case, you might want to make the following :
    a) use DESFORMAT=HTML
    b) use MIMETYPE=application/vnd.msexcell (or whatever mimetype your excel application is bound to)
    i am nor sure if excel will understeand our HTMLCSS (which is actually HTML4.0 using layers for best possible rendering of the paper page in the browser).
    regards,
    the oracle reports team

  • Help with formatting parameters in html output?

    Hi --
    I would like to use a style sheet to adjust the way that javadoc displays lists of parameters below each method. In the HTML output, the code around the parameter name and description looks like this:
    <dd><code>filterContainers</code> - True if the containers within the database
    are to be considered individually during task assignment; false if the entire database is to be assigned as a single task.
    </dd>
    I apologize if this is basic CSS question, but I don't understand how to change the way 'filterContainers' is formatted -- maybe make it italic or something. I was also hoping to increase the padding below each parameter name/description because they seem to squished together.
    Any help is greatly appreciated.
    Jen

    Add this to stylesheet.css to make "filterContainers" italic:
    dl dd dl dd code {
    font-style: italic;
    }This adds space below lines inside dd
    dl dd dl dd {
    padding-bottom: 3px;
    }(You could change it to padding-top to add the space above instead.)
    The sequence "dl dd dl dd code" is the nested hierarchy of HTML tags relative to body.
    Here are the CSS elements defined above: (CSS 2.0)
    http://www.w3.org/TR/2005/WD-CSS21-20050613/propidx.html

  • How to send the output to PDF format in reports 6i?

    Hi,
    How to send the output to PDF format in reports 6i? I given Mode = BITMAP.
    DESTYPE = File, DESFORMAT = PDF, DESNAME = C:\x.pdf.
    Report is running fine. But PDF file not generated. I don't know what i missed. Any one can help this?
    Thanks
    Kavitha

    Hello,
    Do you get this problem only for DESFORMAT=PDF ?
    Test with :
    DESFORMAT = RTF, DESNAME = C:\x.rtf
    or
    DESFORMAT = HTMLCSS, DESNAME = C:\x.html
    does it work ?
    Check if DESNAME is modified in the reports itself.
    Regards

Maybe you are looking for