You are here: Articles > Computers & Technology > jsp

 See more articles about "jsp "

JSP and JSTL Tutorials - Tutorial Addendum - JSTL - Syntax and Announcement Accent



 31 December 18:00   

    



    



    



    

This affiliate explains:

    



        

  • Basics on JSTL syntax.

        



  •     

  • Basics on Announcement Language.

        



  •     

  • Literal data and called variables.

        



  •     

  • Basic operators and operations.

        



  •     

  • Accessing accumulating elements and item properties.

        



  •     

  • ExpExample.jsp - Announcement examples JSP page.

        



  •     

  • pageContext attributes and JSTL top akin identifiers.

        



  •     



    



    



    

JSTL Syntax

    



    

JSTL syntax is actual simple. JSTL allows you to address tags in JSP pages.

    

Each tag is infact alleged an action. Every activity haveto be accounting as an XML element.

    

The syntax of an JSTL activity XML aspect is something like these:

    



    

<p:tag attribute="text_only"/>

    

<p:tag>

    

xml_body

    

</p:tag>

    

<p:tag attribute="text_only">

    

xml_body

    

</p:tag>

    

<p:tag attribute="${expression}">

    

xml_body

    

</p:tag>

    

<p:tag attribute="text${expression}text${express}..." ...>

    

xml_body

    

</p:tag>

    



    



    

As you can see, there are a amount variations in the syntax:

    



        

  • An activity can be an abandoned or non-empty XML element.

        



  •     

  • An activity can accept zero, one, or some attributes.

        



  •     

  • Attribute ethics can be argument only, or alloyed with expressions.

        



  •     

  • An accurate is consistently accounting in the architecture of ${expression}.

        



  •     



    



    

The expressions haveto be accounting by folowing rules authentic by the announcement language.

    



    

Examples of JSTL actions:

    

 

    

<c:out value="Hello world!"/>

    

<c:if test="${1+1==2}">

    

Consistently true.

    

</c:if>

    

<c:set var="message" value="Hello world!"/>

    

<c:out value="${message}"/>

    



    



    



    

Expression Language

    



    

Since announcement will be acclimated in alotof of the JSTL actions, let s attending at the

    

express accent afore alone JSTL actions.

    



    

JSTL announcement accent is aggressive by both ECMAScript and XPath announcement language.

    

It is simple, and acknowledging the afterward features:

    



        

  • Literal data and called variables.

        



  •     

  • Logical, relational and addition operations.

        



  •     

  • A set of absolute objects.

        



  •     

  • Nested backdrop and accessors to collections.

        



  •     



    



    

Examples of JSTL expressions:

    

 

    

<c:out value="${1+1==2}"/>

    

<c:out value="${1+1}"/>

    

<c:out value="${1/3}"/>

    

<c:out value="${1.0/3.0}"/>

    

<c:out value="${message}"/>

    

<c:out value="${pageContext.request.class.name}"/>

    

<c:out value="${pageContext.request.method}"/>

    

<c:out value="${pageContext.request.requestedSessionId}"/>

    

<c:out value="${pageContext.request.cookies[0].name}"/>

    

<c:out value="${quantity*price < 100.0 && country== USA }"/>

    



    



    



    

Literal Data and Called Variables

    



    

As in all computer language, announcement starts with accurate data and variables.

    

JSTL announcement accent supports 5 types of accurate data:

    



        

  • Boolean - true and false. Aforementioned as Java boolean.

        



  •     

  • Integer - like 9999, -3, and 0. Aforementioned as Java long.

        



  •     

  • Floating point amount - like, 1.0, 3.14159, and -1.0e-3. Aforementioned as Java double.

        



  •     

  • String - like, USA , "USA", or s notes. Abutting to Java String.

        



  •     

  • Null - null. Aforementioned as Java null.

        



  •     



    

(Continued on next part...)

    



    



 


 value, expression, language, syntax, attribute, action, literal, body<, {pagecontext, request, expressions, actions, named, examples, notes, written, element, variables, , expression language, literal data, value {pagecontext, xml body<, tag attribute, {pagecontext request, data and, jstl actions, tag <, attribute text, xml element, jstl syntax, text only, value {pagecontext request, tag attribute text, jstl expression language, tutorials tutorial notes, value hello world, attribute text only, notes jstl syntax, jstl tutorials tutorial, tutorial notes jstl,

Share JSP and JSTL Tutorials - Tutorial Addendum - JSTL - Syntax and Announcement Accent:
Digg it!   Google Bookmarks   Del.icio.us   Yahoo! MyWeb   Furl  Binklist   Reddit!   Stumble Upon   Technorati   Windows Live   Bookmark

Text link code :
Hyper link code:

Also see ...

JSP and JSTL Tutorials - Tutorial Addendum - JSTL - Syntax and Announcement Accent
i(Continued from antecedent part...)/iThe accurate data rules are simple to understand, with a brace of exceptions:No accurate data for appearance data type. String ca

JSP and JSTL Tutorials - Tutorial Addendum - JSTL - Syntax and Announcement Accent
i(Continued from antecedent part...)/iAs you can see, this action is actual complex. But it does create page columnist slife easier by putting a lot of intelligence abaft this operation. But it alsobrings

JSP and JSTL Tutorials - Tutorial Addendum - JSTL - Syntax and Announcement Accent
i(Continued from antecedent part...)/iDo you accept any supprises if you analyze your assumption with output? I accept someexplanations on the achievement to advice you:Example 3 show

JSP and JSTL Tutorials - Tutorial Addendum - Localization Internationalization - Non ASCII Characters in JSP Pages
This affiliate explains:How characters biking from JSP files to browser screens.How ASCII characters plan in JSP pages. How to present non ASCII characters in HTML d

JSP and JSTL Tutorials - Tutorial Addendum - Localization Internationalization - Non ASCII Characters in JSP Pages
i(Continued from antecedent part...)/iLet s attending at the additional allotment first to see how non ASCII characters are stored in HTML documents, transferred from Web servers to browsers, displayed on

JSP and JSTL Tutorials - Tutorial Addendum - Localization Internationalization - Non ASCII Characters in JSP Pages
i(Continued from antecedent part...)/iJava Strings Byte Sequences Encoded for Bounded LanguagesLet s try advantage 1 mentioned in the antecedent area first. Actuality is my

JSP and JSTL Tutorials - Tutorial Addendum - Localization Internationalization - Non ASCII Characters in JSP Pages
i(Continued from antecedent part...)/iIn adjustment to analysis out how to ascendancy those factors, I best two simplifiedChinese characters, and entered them in 7 altered formats as a simple HTML paragraph:

JSP and JSTL Tutorials - Tutorial Addendum - Localization Internationalization - Non ASCII Characters in JSP Pages
i(Continued from antecedent part...)/iStatic HTML Argument JSP Page in XML SyntaxIn the third test, the changeless argument is amid into a JSP page in XML syntax:br

JSP and JSTL Tutorials - Tutorial Addendum - JSP Achievement
Calculating Prime NumbersThe first breadth I wish to analysis for achievement is accumulation addition calculations. The afterward JSP page calculates prime amount starting from amo

JSP and JSTL Tutorials - Tutorial Addendum - JSP Achievement
i(Continued from antecedent part...)/iResponse Time of "Hello" PageThe next breadth I wish analysis is absolute acknowledgment time of ASP pages. To do this, I wroteth