Standard or XML syntax?

Which syntax is more "trendy"? And what's so special about XML syntax? All the fuss about the <jsp:text> and CDATA when writing output... And what does the jsp:text do in the first place? I read it preservs whitespace, but I didn't see the difference. And why is ${expression} said to be invalid in the J2EE tutorial? Sorry if these are funny questions but I'd really like to know it :-)

You can find lots of example in this forum.
Here are some of the recent ones:
xmlp conditional region if statement inlist
choose when syntax

Similar Messages

  • XML syntax for tags

    It has always been a habit of mine to use XML syntax for CF tags since I've been working with XHTML. For instance, I will do <cfset var myVar = "" /> However, I noticed when doing <cfdump var"#myvar#" />, the output is displayed twice. So now I am wondering if whenever I use a /> on something such as cfset, is the tag actually executing twice? How does this affect performance?
    I just happened to notice that in CFBuilder, when I do <cfargment name="myVar" required="true" type="string" default="" />, when I go to the next line and start typing <cfarg auto-suggest will select the cfargument tag, but this is only if I use a />. If I omit the ending forward-slash, auto-suggest does not work. That may be a setting specific to CFBuilder, but that wasn't the scope of this question.
    What syntax is correct and how does it affect performance?

    According to the document I've linked to below; using self-closing CF tags, such as <cfset myname="Bob" /> is permissible.  The document also notes exceptions to this such as CFIF and custom tags as examples where a self-closing tag shouldn't be used.
    http://livedocs.adobe.com/wtg/public/coding_standards/style.html
    Althoguh it doesn't look like it, that's an internal coding standard for one of Adobe's (well: it was Macromedia at the time) internal teams, and is not supposed to be a suggested standard for everyone.  I've had this same discussion with them, too.
    As Owainnorth (and many others) observe, it's completely doable.  My only challenge to it (and it's a challenge I state in an unduly heavy-handed fashion sometimes!) is the nonsensical rationales people use for doing it: making it more like XML, it's good if the CFML blends in better with the XHTML mark-up it's generating, it's tidier, etc.
    I hasten to add that Owainnorth's position that he finds it easier to read and assists with code navigation, whilst leaving me with a blank look on my face, is a completely reasonable basis for doing it.  I personally don't believe it, but there's no reason why that should bother him (and I'm sure it doesn't).
    I think it was reasonable of me to challenge his wording that it's easier to identify where CF code blocks are by looking at the closing slash rather than the tag name; but having explained himself better, I reckon it's not quite so much tosh as it originally sounded.  I mean: I still can't see it, but obviously he can, so fair enough.
    Adam

  • XML syntax error in a JSP page.

    Hi,
    i was trying to include xml syntax in a jsp page in stead of core jsp syntax. it didn't work.But the jsp document with the core jsp syntax works. I'm wondering what's the problem.any help would be really helpful. I'm using Tomcat 3.2.1.
    Thanx in adv,
    Ganesh
    JSP file - NOT WORKING
    <jsp:directive.page import="java.util.Date"/>
    <jsp:declaration>
    private static String loadTime = new Date().toString();
    private static String getLoadTime() { return loadTime; }
    private static String getCurrentTime() { return new Date().toString(); }
    </jsp:declaration>
    <HTML>
    <HEAD><TITLE>XML and JSP</TITLE></HEAD>
    <BODY>
    JSP page is created using XML syntax...<BR>
    This page was loaded into memory at <%= getLoadTime() %>.<BR>
    The current time is <%= getCurrentTime() %>
    </BODY>
    </HTML>
    ERROR :
    Error: 500
    Location: /test/declarations.jsp
    Internal Servlet Error:
    org.apache.jasper.JasperException: Unable to compile class for JSPC:\tomcat321\tomcat\work\localhost_8080%2Ftest\_0002fdeclarations_0002ejspdeclarations_jsp_6.java:59: Method getLoadTime() not found in class _0002fdeclarations_0002ejspdeclarations_jsp_6.
    out.print( getLoadTime() );
    ^
    C:\tomcat321\tomcat\work\localhost_8080%2Ftest\_0002fdeclarations_0002ejspdeclarations_jsp_6.java:65: Method getCurrentTime() not found in class _0002fdeclarations_0002ejspdeclarations_jsp_6.
    out.print( getCurrentTime() );
    ^
    2 errors

    Hi,
    any help on this question would be really appreciated..
    Thanx in adv,
    Ganesh

  • XML  syntax for  MULTI checkboxes

    Another XML question :
    how do I indicate multi-checkboxes?
    Meaning, instead of ticking one box, you can tick several boxes for the same field/attribute?
    Example :
    *<Field name='WhatKindOfGuy'>*
    *<Display class='???????'*
    *<Property name='Title' value='What kind of guy is Michael?'*
    Let's say I want to present a variety of options : *(a) Cheerful (b) Friendly (c) Openminded (d) Ambitious (e) Dedicated (f) Brash,* etc, etc,etc
    Obviously, Michael can be several of these things.
    So, I want to have several checkboxes.
    What's the correct XML syntax?

    In your case u have to take that many checkboxes, and finally evaluate the checkboxes selected or not on the basis of their values is true or false

  • XML syntax to revoke all the AccessControlEntry

    Hi all!!!
    I would like to know if there is an XML syntax to revoke all the AccessControlEntry of an ACL
    Thanks

    Fran wrote:
    do you know the different between PRIVATE and PUBLIC Synonym?
    Public synonyms are accessible to all users.
    Private is accessible only within its schema.
    if you don't want that this user, uses this synonym drop it and create a private synonym in the others schemas where the users need it.That doesn't fix the privilege issue though. The user can still access the table by prefixing the table with the schema name.
    You need to find out who granted the privileges on that table to the user (ie which schema) and then revoke all the privileges that were granted to that user.
    Log in as the user and execute :
    select * from user_tab_privs
    where table_name = 'YOURTABLENAME'or
    select * from dba_tab_privs
    where grantee = 'YOUR USER THAT YOU WANT TO REVOKE PRIVILEGES FROM'
    and table_name = 'TABLE_NAME that you want to revoke privileges from'Edited by: Keith Jamieson on Dec 21, 2012 2:16 PM

  • XML syntax

    I've tried to write several simple pages using the XML syntax, but I can't solve the following problem. I have a form, where I want to prefill some values (for example the values filled in before), but I'm not able to do this using the XML syntax. Using classic JSP syntax it looks like
    <input type="text" name="firstName" value="<%=formHandler.getFirstName()%>">
    But in the XML syntax
    <input type="text" name="firstName" value="<jsp:expression>formHandler.getFirstName()</jsp:expression>">
    the compiler still complains:
    index.jsp [39:-1] Use "<" for "<" in attribute values.
    I'm sure it's pretty trivial, but I still can't solve it. I've tried several ways to escape the lt, gt signs, but that doesn't work for me.

    Hello FuzzyMac,
    In this special case, you might use EL (expression language) from JSP 2.0 (of course this might only be an option for non-production developing); in this case it might look like:
    <input type="text" name="firstName" value="${formHandler.getFirstName()}">You second example is not XML valid, because it uses also nested elements (< and > within an attribute is not allowed).
    Please have a look to an intorduction here on java.sun.com on JSP 2.0 where they explain wrinting .jspx files without EL; that might also apply to JSP 1.2 (sorry do not have the link, just search for JSP 2.0).
    Greetings, Timo

  • XML Syntax Highlighting

    Hi, I need help with XML Syntax Highlighting. I try to create simple XML editor, but I have probleblems with Syntax Highlighting.
    Is there anyone who can help me?

    Here is personal recommendation, this 3rd party syntax highlight component works quite well for many JTextComponents
    Check out: http://ostermiller.org/syntax/
    ICE

  • XML Syntax highlighting (again :)

    Hi there,
    I know, that there have been quite a view posts about this topics, but as far as I see, there has been no solution to this.
    So I wanted to ask if someone has implemented a XML Syntax highlighting or knows where to get a tutorial from to accomplish so (inheriting from DefaultStyledDocument...?)
    Sincerely
    Charly

    Hi!
    I have the same need: an XML Syntax Highlighting (coloring).
    I don't need an XML editor, I have a JTextPane that shows XML code and I would like it to be done with a syntax coloring.
    If you have a solution I will really appreciate!
    Thanks
    Gio :-)

  • Char into balise jsp:scriptlet in jsp with xml syntax

    hello,
    i met a trouble with coding jsp with xml syntax,
    i use wsad to develop the jsp, and it's not allowed to put characters < or > into the balise scriptlet
    for example i cant do a loop (as i did easily with html syntax <% %> ) :
    this his the header of my jsp:
    <jsp:directive.page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" />
    <jsp:text>
    <![CDATA[ <?xml version="1.0" encoding="ISO-8859-1" ?> ]]>
    </jsp:text>
    <jsp:text>
    <![CDATA[ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> ]]>
    </jsp:text>
    and the code which dont work:
    <jsp:scriptlet>
    for (int i=0;i<10;i++){
    System.out.println(i);
    </jsp:scriptlet>
    i get a compilation error, did someone could help me to code dynamic content jsp ?
    ps: excuse me for my english.

    I don't use xml, so I may be way off the wall, but did you try using the CDATA sections again?
    <jsp:scriptlet>
    <![CDATA[
    for (int i=0;i<10;i++){
    System.out.println(i);
    ]]>
    </jsp:scriptlet>

  • Mixing XML syntax w/JSP syntax

    As I understand it, you can use either the JSP-specific syntax or an XML-based syntax for code in a JSP page. For instance you can use either
      <%= expresssion %>(JSP-specific syntax)
    or
      <jsp:expression>
        expression
      </jsp:expression>(XML-based syntax)
    to do much the same thing. But I think once I heard somewhere that the two syntaxes cannot be mixed on the same JSP page. Two questions about that:
    (1) Is it true?
    (2) If it is true, what about a page of one syntax that includes (using include directive) a page of the other syntax -- there will be inconsistency here.
    Thanks if you can answer this.

    A jsp source file(.jsp) should be in either Xml syntax or Jsp syntax.

  • IMG tag and XML syntax

    Hi,
    I want to dynamically embed image url into the IMG tag as follows:
    <jsp:useBean id="image" scope="request" class="mybeans.ImageBean" type="mybeans.ImageBean" />
    <img src='<jsp:getProperty name="image" property="imagePath"/>'    />The problem arises because of confusion with closing/opening tags getting mixed up.. How do I get this code to work if i'm using xml syntax in my jsp pages? Any solutions?
    P.

    It would be complaining about using a tag as an attribute to another tag.
    ie nesting a tag within the tag, rather than between open/close tags for it.
    Solution? Don't nest tags like this. I'm figuring you have to use an expression of some sort.
    either <img src='<%= image.getImagePath %>'/>
    or using EL in a JSP2.0 container:
    <img src='${image.imagePath}'/>
    I can't say I have done strict xml stuff, so I might be a little off, but thats the general idea.
    Hope this helps,
    evnafets

  • How can we change the standard RSS XML of WPC pages

    What are the properties of the standard RSS XML of the pages those are created with Web Page Composer and how can we change the XML?

    Decided to do not use.

  • Cann't run the examples in dir "webapps\standard-examples\xml" of jstl1.1.2

    i'm learning jstl.
    fisrtly i downloaded the jstl1.1.2 zip file and upziped it, then i put the standard-examples.war file to the webapps dir of tomcat5.5 to run the examples.
    now i could run some of those examples, but strangely i could not run the example of the directory of "standard-examples\xml". if i try to run, an error as follows will emerg:
    javax.servlet.ServletException: org/apache/xpath/VariableStack
    org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848)
    org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781)
    org.apache.jsp.xml.Parse_jsp._jspService(org.apache.jsp.xml.Parse_jsp:90)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    java.lang.NoClassDefFoundError: org/apache/xpath/VariableStack
    org.apache.taglibs.standard.tag.common.xml.ExprSupport.doStartTag(ExprSupport.java:63)
    org.apache.jsp.xml.Parse_jsp._jspx_meth_x_out_0(org.apache.jsp.xml.Parse_jsp:168)
    org.apache.jsp.xml.Parse_jsp._jspService(org.apache.jsp.xml.Parse_jsp:76)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    Could anyone give me some advices to deal with this problem? Thanks

    LOL.... i ran into the same problem with Tomcat 5.5... it's quite an idiotic problem cuz like you gotta hunt everywhere to figure out why it don't work... reason is cuz those brainchildren at Apache.org who make Tomcat also make the missing Jar file but forgot to include it with Tomcat... duh... :-p
    any way... visit this site... http://xml.apache.org/xalan-j/
    download the zip file and extract it (follow the instructions)
    you only need to copy the xalan.jar file to your Tomcat 5.5's <installpath>\common\lib folder...
    then that problem will be fixed...
    have fun... :-p
    - MaxxDmg...
    - ' He who never sleeps... '

  • Standards for XML

    Hi,
    Like we have ANSI standard for EDI
    for example EDI 850 for a P.O. or S.O.
    do we have any standards for XML transcations.
    Where can I get them?
    I appreciate any help.
    Thanks

    hi,
    IDOC-XML
    BTW
    >>>>xCBL for e-commerce 
    xCBL is a whole set of documents - like orders etc.
    I don't see any reason why it could not be used for FMCG companies
    (from the business document types point of view)
    >>>>xBRL for Insurance Industry
    this one is not only for insurance it's more for XML reports
    (I believe it's consortium also holds government agencies for example)
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

  • Migapp.xml syntax to include Firefox 10* in USMT

    I am currently using USMT and Microsoft Deployment Toolkit to upgrade/deploy Windows7. My efforts to include Firefox 10* in the migapp.xml have been unsuccessful. It refuses to capture the Firefox data. I am sure it's a syntax issue. It works for version 4, eg: <!-- Mozilla Firefox 4 -->
    <component context="UserAndSystem" type="Application">
    <displayName _locID="migapp.firefox4">Mozilla Firefox 4</displayName>
    <environment name="GlobalEnv"/>
    <environment name="GlobalEnvX64"/>
    <role role="Settings">
    <detection>
    <conditions>
    <condition>MigXmlHelper.DoesObjectExist("Registry","%HklmWowSoftware%\Mozilla\Mozilla Firefox 4.*\bin [PathToExe]")</condition>
    </conditions>
    </detection>
    <rules context="User">
    <destinationCleanup>
    <objectSet>
    <pattern type="File">%CSIDL_LOCAL_APPDATA%\Mozilla\Firefox\Profiles\*\Cache\* [*]</pattern>
    </objectSet>
    </destinationCleanup>
    <include>
    <objectSet>
    <pattern type="File">%CSIDL_APPDATA%\Mozilla\Firefox\* [*]</pattern>
    <pattern type="File">%CSIDL_LOCAL_APPDATA%\Mozilla\Firefox\Profiles\* [*]</pattern>
    </objectSet>
    </include>
    <exclude>
    <objectSet>
    <pattern type="File">%CSIDL_APPDATA%\Mozilla\Firefox\Crash Reports\* [*]</pattern>
    <pattern type="File">%CSIDL_APPDATA%\Mozilla\Firefox\Profiles\*\ [pluginreg.dat]</pattern>
    <pattern type="File">%CSIDL_LOCAL_APPDATA%\Mozilla\Firefox\Profiles\*\Cache\* [*]</pattern>
    </objectSet>
    </exclude>
    <merge script="MigXmlHelper.SourcePriority()">
    <objectSet>
    <pattern type="File">%CSIDL_APPDATA%\Mozilla\Firefox\* [*]</pattern>
    <pattern type="File">%CSIDL_LOCAL_APPDATA%\Mozilla\Firefox\Profiles\* [*]</pattern>
    </objectSet>
    </merge>
    </rules>
    </role>
    </component>

    A good place to ask advice about web development is at the MozillaZine "Web Development/Standards Evangelism" forum.
    *http://forums.mozillazine.org/viewforum.php?f=25
    The helpers at that forum are more knowledgeable about web development issues.<br>
    You need to register at the MozillaZine forum site in order to post at that forum.

Maybe you are looking for

  • Problem with rollovers

    Hi. I'm building an app in Flash cs6 in which I have several buttons that represent monuments on a map and some buttons are on top/beneath others. I've already made it so that any button being moused over jumps to front using addChild, but then when

  • How do I reset ipad in apple configurator

    trying to configure ipads in configurator, cant get it to work correctly. it there a way to delete existing profile and wipeout ipad to start new again. I cant get configurator to see ipad in prepare mode. thanks.

  • Excise capture in import PO with sub transction Type

    Hi Gurus Can anyone tell me how to make the settings  while capturing Excise Duties for import PO in J1iex sceen. I am unable to get the Sub Transaction type IP when trying to capture excise for import PO. I have made all the config settings for impo

  • Program not found in ECC 6.0 for manual reposting of primary cost

    Hi exps, The program SAPMLK23F1 is not found in Ecc 6.0. the program SAPMK23B is replacing the program. now this program is using anywhere else or toally removed by sap in ecc6.0? is any programs which is not in ecc 6 kindly list out for me. points w

  • How to move documents, favorites, and downloads from a windows to a mac?

    I have some of these things in a USB but when I try to move them to where I think they are supposed to be they are not the same like with documents it just tells me it came from a Hewlett Packard and when the last time I used it was, favorites doesn'