type

WebOutStream

src @Js
class WebOutStream : OutStream

WebOutStream provides methods for generating XML and XHTML content.

constructors

make

Construct a WebOutStream that wraps the given OutStream.

methods

a

Start a <a> tag.

aEnd

End a <a> tag.

article

Start a <article> tag.

articleEnd

End a <article> tag.

aside

Start a <aside> tag.

asideEnd

End a <aside> tag.

atom

Write a complete <link> tag for an Atom feed resource.

b

Start a <b> tag.

bEnd

End a <b> tag.

body

Start a <body> tag.

bodyEnd

End a <body> tag.

br

Write out a complete <br/> tag.

button

Convenience for input("type='button'" + attrs).

checkbox

Convenience for input("type='checkbox'" + attrs)

code

Start a <code> tag.

codeEnd

End a <code> tag.

dd

Start a <dd> tag.

ddEnd

End a <dd> tag.

div

Start a <div> tag.

divEnd

End a <div> tag.

dl

Start a <dl> tag.

dlEnd

End a <dl> tag.

docType

Write the XHTML Strict DOCTYPE.

docType5

Write the HTML5 DOCTYPE.

dt

Start a <dt> tag.

dtEnd

End a <dt> tag.

em

Start a <em> tag.

emEnd

End a <em> tag.

esc

Write obj.toStr to the stream as valid XML text.

favIcon

Write a complete <link> tag for a favicon.

footer

Start a <footer> tag.

footerEnd

End a <footer> tag.

form

Start a <form> tag.

formEnd

End a <form> tag.

h1

Start a <h1> tag.

h1End

End a <h1> tag.

h2

Start a <h2> tag.

h2End

End a <h2> tag.

h3

Start a <h3> tag.

h3End

End a <h3> tag.

h4

Start a <h4> tag.

h4End

End a <h4> tag.

h5

Start a <h5> tag.

h5End

End a <h5> tag.

h6

Start a <h6> tag.

h6End

End a <h6> tag.

head

Start a <head> tag.

headEnd

End a <head> tag.

header

Start a <header> tag.

headerEnd

End a <header> tag.

hidden

Convenience for input("type='hidden'" + attrs).

hr

Write out a complete <hr/> tag.

html

Start a <html> tag.

htmlEnd

End a <html> tag.

i

Start a <i> tag.

iEnd

End a <i> tag.

img

Write a complete <img> tag.

includeCss

Write a complete <link> tag for an external CSS stylesheet.

includeJs

Write a complete <script> tag for an external JavaScript file.

initJs

Customize how the JavaScript runtime environment is initialized.

input

Write a complete <input> tag.

label

Start a <label> tag.

labelEnd

End a <label> tag.

li

Start a <li> tag.

liEnd

End a <li> tag.

main

Start a <main> tag.

mainEnd

End a <main> tag.

nav

Start a <nav> tag.

navEnd

End a <nav> tag.

nl

Convenience for writeChar(\n).

ol

Start a <ol> tag.

olEnd

End a <ol> tag.

option

Start a <option> tag.

optionEnd

End a <option> tag.

p

Start a <p> tag.

pEnd

End a <p> tag.

password

Convenience for input("type='password'" + attrs).

pre

Start a <pre> tag.

preEnd

End a <pre> tag.

prolog

Write out a prolog statement using the streams current charset encoding.

radio

Convenience for input("type='radio'" + attrs)

rss

Write a complete <link> tag for a RSS feed resource.

script

Start a <script> tag.

scriptEnd

End a <script> tag.

section

Start a <section> tag.

sectionEnd

End a <section> tag.

select

Start a <select> tag.

selectEnd

End a <select> tag.

span

Start a <span> tag.

spanEnd

End a <span> tag.

style

Start a <style> tag.

styleEnd

End a <style> tag.

submit

Convenience for input("type='submit'" + attrs).

tab

Convenience for writeChars(Str.spaces(numSpaces)).

table

Start a <table> tag.

tableEnd

End a <table> tag.

tag

Write a start tag.

tagEnd

Write an end tag.

tbody

Start a <tbody> tag.

tbodyEnd

End a <tbody> tag.

td

Start a <td> tag.

tdEnd

End a <td> tag.

textArea

Start a <textarea> tag.

textAreaEnd

End a <textarea> tag.

textField

Convenience for input("type='text'" + attrs).

tfoot

Start a <tfoot> tag.

tfootEnd

End a <tfoot> tag.

th

Start a <th> tag.

thEnd

End a <th> tag.

thead

Start a <thead> tag.

theadEnd

End a <thead> tag.

title

Write a complete <title> tag.

titleEnd

End a <title> tag.

tr

Start a <tr> tag.

trEnd

End a <tr> tag.

ul

Start a <ul> tag.

ulEnd

End a <ul> tag.

w

Convenience for writeChars(obj.toStr).

Slot Details

a

src This a(Uri href, Str? attrs := null)

Start a <a> tag.

aEnd

src This aEnd()

End a <a> tag.

article

src This article(Str? attrs := null)

Start a <article> tag.

articleEnd

src This articleEnd()

End a <article> tag.

aside

src This aside(Str? attrs := null)

Start a <aside> tag.

asideEnd

src This asideEnd()

End a <aside> tag.

atom

src This atom(Uri href, Str? attrs := null)

Write a complete <link> tag for an Atom feed resource.

b

src This b(Str? attrs := null)

Start a <b> tag.

bEnd

src This bEnd()

End a <b> tag.

body

src This body(Str? attrs := null)

Start a <body> tag.

bodyEnd

src This bodyEnd()

End a <body> tag.

br

src This br()

Write out a complete <br/> tag.

button

src This button(Str? attrs := null)

Convenience for input("type='button'" + attrs).

checkbox

src This checkbox(Str? attrs := null)

Convenience for input("type='checkbox'" + attrs)

code

src This code(Str? attrs := null)

Start a <code> tag.

codeEnd

src This codeEnd()

End a <code> tag.

dd

src This dd(Str? attrs := null)

Start a <dd> tag.

ddEnd

src This ddEnd()

End a <dd> tag.

div

src This div(Str? attrs := null)

Start a <div> tag.

divEnd

src This divEnd()

End a <div> tag.

dl

src This dl(Str? attrs := null)

Start a <dl> tag.

dlEnd

src This dlEnd()

End a <dl> tag.

docType

src This docType()

Write the XHTML Strict DOCTYPE.

docType5

src This docType5()

Write the HTML5 DOCTYPE.

dt

src This dt(Str? attrs := null)

Start a <dt> tag.

dtEnd

src This dtEnd()

End a <dt> tag.

em

src This em(Str? attrs := null)

Start a <em> tag.

emEnd

src This emEnd()

End a <em> tag.

esc

src This esc(Obj? obj)

Write obj.toStr to the stream as valid XML text. The special control characters amp, lt, apos and quot are always escaped. The gt char is escaped only if it is the first char or if preceeded by the ] char. Also see Str.toXml. If obj is null, then "null" is written.

favIcon

src This favIcon(Uri href, Str? attrs := null)

Write a complete <link> tag for a favicon. You must specifiy the MIME type for your icon in the attrs argument:

out.favIcon(`/fav.png`, "type='image/png'")

src This footer(Str? attrs := null)

Start a <footer> tag.

footerEnd

src This footerEnd()

End a <footer> tag.

form

src This form(Str? attrs := null)

Start a <form> tag.

formEnd

src This formEnd()

End a <form> tag.

h1

src This h1(Str? attrs := null)

Start a <h1> tag.

h1End

src This h1End()

End a <h1> tag.

h2

src This h2(Str? attrs := null)

Start a <h2> tag.

h2End

src This h2End()

End a <h2> tag.

h3

src This h3(Str? attrs := null)

Start a <h3> tag.

h3End

src This h3End()

End a <h3> tag.

h4

src This h4(Str? attrs := null)

Start a <h4> tag.

h4End

src This h4End()

End a <h4> tag.

h5

src This h5(Str? attrs := null)

Start a <h5> tag.

h5End

src This h5End()

End a <h5> tag.

h6

src This h6(Str? attrs := null)

Start a <h6> tag.

h6End

src This h6End()

End a <h6> tag.

src This head()

Start a <head> tag.

headEnd

src This headEnd()

End a <head> tag.

src This header(Str? attrs := null)

Start a <header> tag.

headerEnd

src This headerEnd()

End a <header> tag.

hidden

src This hidden(Str? attrs := null)

Convenience for input("type='hidden'" + attrs).

hr

src This hr(Str? attrs := null)

Write out a complete <hr/> tag.

html

src This html()

Start a <html> tag.

htmlEnd

src This htmlEnd()

End a <html> tag.

i

src This i(Str? attrs := null)

Start a <i> tag.

iEnd

src This iEnd()

End a <i> tag.

img

src This img(Uri src, Str? attrs := null)

Write a complete <img> tag.

includeCss

src This includeCss(Uri href)

Write a complete <link> tag for an external CSS stylesheet. If this URI has already been included in this WebOutStream instance, then this method does nothing.

includeJs

src This includeJs(Uri? href := null)

Write a complete <script> tag for an external JavaScript file. If this URI has already been included in this WebOutStream instance, then this method does nothing.

initJs

src This initJs(Str:Str env)

Customize how the JavaScript runtime environment is initialized. This method must be called inside the <head> tag, and also before sys.js is loaded in order to take effect.

Note this method is not necessary if no customization is needed. The JS runtime will automatically initialize using default values.

The following variables are supported:

  • timezone: set the default TimeZone for JsVM
  • locale: set the default Locale for the JsVM. Note you must manually provide the locale config.props files. See FilePack.toLocaleJsFile.
  • main: an optional method to invoke after the page has been loaded. The main argument can be either a type or method. If no method is specified, main is used. If the method is not static, a new instance of type is created:
    "foo::Instance"     =>  Instance().main()
    "foo::Instance.bar" =>  Instance().bar()
    "foo::Static"       =>  Static.main()
    "foo::Static.bar"   =>  Static.bar()

input

src This input(Str? attrs := null)

Write a complete <input> tag.

label

src This label(Str? attrs := null)

Start a <label> tag.

labelEnd

src This labelEnd()

End a <label> tag.

li

src This li(Str? attrs := null)

Start a <li> tag.

liEnd

src This liEnd()

End a <li> tag.

main

src This main(Str? attrs := null)

Start a <main> tag.

mainEnd

src This mainEnd()

End a <main> tag.

make

src new make(OutStream out)

Construct a WebOutStream that wraps the given OutStream.

src This nav(Str? attrs := null)

Start a <nav> tag.

src This navEnd()

End a <nav> tag.

nl

src This nl()

Convenience for writeChar(\n).

ol

src This ol(Str? attrs := null)

Start a <ol> tag.

olEnd

src This olEnd()

End a <ol> tag.

option

src This option(Str? attrs := null)

Start a <option> tag.

optionEnd

src This optionEnd()

End a <option> tag.

p

src This p(Str? attrs := null)

Start a <p> tag.

pEnd

src This pEnd()

End a <p> tag.

password

src This password(Str? attrs := null)

Convenience for input("type='password'" + attrs).

pre

src This pre(Str? attrs := null)

Start a <pre> tag.

preEnd

src This preEnd()

End a <pre> tag.

prolog

src This prolog()

Write out a prolog statement using the streams current charset encoding.

radio

src This radio(Str? attrs := null)

Convenience for input("type='radio'" + attrs)

rss

src This rss(Uri href, Str? attrs := null)

Write a complete <link> tag for a RSS feed resource.

script

src This script(Str? attrs := "type='text/javascript'")

Start a <script> tag.

scriptEnd

src This scriptEnd()

End a <script> tag.

section

src This section(Str? attrs := null)

Start a <section> tag.

sectionEnd

src This sectionEnd()

End a <section> tag.

select

src This select(Str? attrs := null)

Start a <select> tag.

selectEnd

src This selectEnd()

End a <select> tag.

span

src This span(Str? attrs := null)

Start a <span> tag.

spanEnd

src This spanEnd()

End a <span> tag.

style

src This style(Str? attrs := "type='text/css'")

Start a <style> tag.

styleEnd

src This styleEnd()

End a <style> tag.

submit

src This submit(Str? attrs := null)

Convenience for input("type='submit'" + attrs).

tab

src This tab(Int numSpaces := 2)

Convenience for writeChars(Str.spaces(numSpaces)).

table

src This table(Str? attrs := null)

Start a <table> tag.

tableEnd

src This tableEnd()

End a <table> tag.

tag

src This tag(Str elemName, Str? attrs := null, Bool empty := false)

Write a start tag. Use attrs to fully specify the attributes manually. Use empty to optionally close this element without using an end tag.

tagEnd

src This tagEnd(Str elemName)

Write an end tag.

tbody

src This tbody(Str? attrs := null)

Start a <tbody> tag.

tbodyEnd

src This tbodyEnd()

End a <tbody> tag.

td

src This td(Str? attrs := null)

Start a <td> tag.

tdEnd

src This tdEnd()

End a <td> tag.

textArea

src This textArea(Str? attrs := null)

Start a <textarea> tag.

textAreaEnd

src This textAreaEnd()

End a <textarea> tag.

textField

src This textField(Str? attrs := null)

Convenience for input("type='text'" + attrs).

tfoot

src This tfoot(Str? attrs := null)

Start a <tfoot> tag.

tfootEnd

src This tfootEnd()

End a <tfoot> tag.

th

src This th(Str? attrs := null)

Start a <th> tag.

thEnd

src This thEnd()

End a <th> tag.

thead

src This thead(Str? attrs := null)

Start a <thead> tag.

theadEnd

src This theadEnd()

End a <thead> tag.

title

src This title(Str? attrs := null)

Write a complete <title> tag.

titleEnd

src This titleEnd()

End a <title> tag.

tr

src This tr(Str? attrs := null)

Start a <tr> tag.

trEnd

src This trEnd()

End a <tr> tag.

ul

src This ul(Str? attrs := null)

Start a <ul> tag.

ulEnd

src This ulEnd()

End a <ul> tag.

w

src This w(Obj? obj)

Convenience for writeChars(obj.toStr).