class web::WebOutStream

sys::Obj
  sys::OutStream
    web::WebOutStream

@Js

Source

WebOutStream provides methods for generating XML and XHTML content.

a

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

Source

Start a <a> tag.

aEnd

This aEnd()

Source

End a <a> tag.

article

This article(Str? attrs := null)

Source

Start a <article> tag.

articleEnd

This articleEnd()

Source

End a <article> tag.

aside

This aside(Str? attrs := null)

Source

Start a <aside> tag.

asideEnd

This asideEnd()

Source

End a <aside> tag.

atom

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

Source

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

b

This b(Str? attrs := null)

Source

Start a <b> tag.

bEnd

This bEnd()

Source

End a <b> tag.

body

This body(Str? attrs := null)

Source

Start a <body> tag.

bodyEnd

This bodyEnd()

Source

End a <body> tag.

br

This br()

Source

Write out a complete <br/> tag.

button

This button(Str? attrs := null)

Source

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

checkbox

This checkbox(Str? attrs := null)

Source

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

code

This code(Str? attrs := null)

Source

Start a <code> tag.

codeEnd

This codeEnd()

Source

End a <code> tag.

dd

This dd(Str? attrs := null)

Source

Start a <dd> tag.

ddEnd

This ddEnd()

Source

End a <dd> tag.

div

This div(Str? attrs := null)

Source

Start a <div> tag.

divEnd

This divEnd()

Source

End a <div> tag.

dl

This dl(Str? attrs := null)

Source

Start a <dl> tag.

dlEnd

This dlEnd()

Source

End a <dl> tag.

docType

This docType()

Source

Write the XHTML Strict DOCTYPE.

docType5

This docType5()

Source

Write the HTML5 DOCTYPE.

dt

This dt(Str? attrs := null)

Source

Start a <dt> tag.

dtEnd

This dtEnd()

Source

End a <dt> tag.

em

This em(Str? attrs := null)

Source

Start a <em> tag.

emEnd

This emEnd()

Source

End a <em> tag.

esc

This esc(Obj? obj)

Source

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

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

Source

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'")

This footer(Str? attrs := null)

Source

Start a <footer> tag.

footerEnd

This footerEnd()

Source

End a <footer> tag.

form

This form(Str? attrs := null)

Source

Start a <form> tag.

formEnd

This formEnd()

Source

End a <form> tag.

h1

This h1(Str? attrs := null)

Source

Start a <h1> tag.

h1End

This h1End()

Source

End a <h1> tag.

h2

This h2(Str? attrs := null)

Source

Start a <h2> tag.

h2End

This h2End()

Source

End a <h2> tag.

h3

This h3(Str? attrs := null)

Source

Start a <h3> tag.

h3End

This h3End()

Source

End a <h3> tag.

h4

This h4(Str? attrs := null)

Source

Start a <h4> tag.

h4End

This h4End()

Source

End a <h4> tag.

h5

This h5(Str? attrs := null)

Source

Start a <h5> tag.

h5End

This h5End()

Source

End a <h5> tag.

h6

This h6(Str? attrs := null)

Source

Start a <h6> tag.

h6End

This h6End()

Source

End a <h6> tag.

This head()

Source

Start a <head> tag.

headEnd

This headEnd()

Source

End a <head> tag.

This header(Str? attrs := null)

Source

Start a <header> tag.

headerEnd

This headerEnd()

Source

End a <header> tag.

hidden

This hidden(Str? attrs := null)

Source

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

hr

This hr(Str? attrs := null)

Source

Write out a complete <hr/> tag.

html

This html()

Source

Start a <html> tag.

htmlEnd

This htmlEnd()

Source

End a <html> tag.

i

This i(Str? attrs := null)

Source

Start a <i> tag.

iEnd

This iEnd()

Source

End a <i> tag.

img

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

Source

Write a complete <img> tag.

includeCss

This includeCss(Uri href)

Source

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

This includeJs(Uri? href := null)

Source

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

This initJs(Str:Str env)

Source

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

This input(Str? attrs := null)

Source

Write a complete <input> tag.

label

This label(Str? attrs := null)

Source

Start a <label> tag.

labelEnd

This labelEnd()

Source

End a <label> tag.

li

This li(Str? attrs := null)

Source

Start a <li> tag.

liEnd

This liEnd()

Source

End a <li> tag.

main

This main(Str? attrs := null)

Source

Start a <main> tag.

mainEnd

This mainEnd()

Source

End a <main> tag.

make

new make(OutStream out)

Source

Construct a WebOutStream that wraps the given OutStream.

This nav(Str? attrs := null)

Source

Start a <nav> tag.

This navEnd()

Source

End a <nav> tag.

nl

This nl()

Source

Convenience for writeChar(\n).

ol

This ol(Str? attrs := null)

Source

Start a <ol> tag.

olEnd

This olEnd()

Source

End a <ol> tag.

option

This option(Str? attrs := null)

Source

Start a <option> tag.

optionEnd

This optionEnd()

Source

End a <option> tag.

p

This p(Str? attrs := null)

Source

Start a <p> tag.

pEnd

This pEnd()

Source

End a <p> tag.

password

This password(Str? attrs := null)

Source

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

pre

This pre(Str? attrs := null)

Source

Start a <pre> tag.

preEnd

This preEnd()

Source

End a <pre> tag.

prolog

This prolog()

Source

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

radio

This radio(Str? attrs := null)

Source

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

rss

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

Source

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

script

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

Source

Start a <script> tag.

scriptEnd

This scriptEnd()

Source

End a <script> tag.

section

This section(Str? attrs := null)

Source

Start a <section> tag.

sectionEnd

This sectionEnd()

Source

End a <section> tag.

select

This select(Str? attrs := null)

Source

Start a <select> tag.

selectEnd

This selectEnd()

Source

End a <select> tag.

span

This span(Str? attrs := null)

Source

Start a <span> tag.

spanEnd

This spanEnd()

Source

End a <span> tag.

style

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

Source

Start a <style> tag.

styleEnd

This styleEnd()

Source

End a <style> tag.

submit

This submit(Str? attrs := null)

Source

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

tab

This tab(Int numSpaces := 2)

Source

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

table

This table(Str? attrs := null)

Source

Start a <table> tag.

tableEnd

This tableEnd()

Source

End a <table> tag.

tag

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

Source

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

This tagEnd(Str elemName)

Source

Write an end tag.

tbody

This tbody(Str? attrs := null)

Source

Start a <tbody> tag.

tbodyEnd

This tbodyEnd()

Source

End a <tbody> tag.

td

This td(Str? attrs := null)

Source

Start a <td> tag.

tdEnd

This tdEnd()

Source

End a <td> tag.

textArea

This textArea(Str? attrs := null)

Source

Start a <textarea> tag.

textAreaEnd

This textAreaEnd()

Source

End a <textarea> tag.

textField

This textField(Str? attrs := null)

Source

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

tfoot

This tfoot(Str? attrs := null)

Source

Start a <tfoot> tag.

tfootEnd

This tfootEnd()

Source

End a <tfoot> tag.

th

This th(Str? attrs := null)

Source

Start a <th> tag.

thEnd

This thEnd()

Source

End a <th> tag.

thead

This thead(Str? attrs := null)

Source

Start a <thead> tag.

theadEnd

This theadEnd()

Source

End a <thead> tag.

title

This title(Str? attrs := null)

Source

Write a complete <title> tag.

titleEnd

This titleEnd()

Source

End a <title> tag.

tr

This tr(Str? attrs := null)

Source

Start a <tr> tag.

trEnd

This trEnd()

Source

End a <tr> tag.

ul

This ul(Str? attrs := null)

Source

Start a <ul> tag.

ulEnd

This ulEnd()

Source

End a <ul> tag.

w

This w(Obj? obj)

Source

Convenience for writeChars(obj.toStr).