Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "MoDisco/Components/JSP/Documentation/0.9"

< MoDisco‎ | Components‎ | JSP
(MetaModel Limits)
Line 21: Line 21:
  
 
==MetaModel Limits==
 
==MetaModel Limits==
Because JSP language is used to generated some content, it can be placed almost anywhere in the file
+
Because JSP language is used to generated some content, it can be placed almost anywhere in the file, which imply certain limitations:
isTagFragment : EBoolean
+
 
 +
 
 +
This is why the "isTagFragment : EBoolean" attribute was added. In fact, everything contain in a tag declaration as in its body is considered as children. It is indeed necessary to be able to differentiate whether the JSP tag  is used to generate the tag description, or its body.
 +
 
 +
Some way of implementing JSP might cause some problem with the parser, especially for tag's attributes evaluation. What is expected to be found is some kind of syntax like :
 +
 
 +
<code> name="value" </code> or <code> name='value' </code>  and even <code> name=value </code>
 +
 
 +
Sometimes we faced implementations like :
 +
<code><nowiki> <tag name=" <% if(condition){ %>  value1" <% }else{ %>  value2" <% } %> > </nowiki> </code>
 +
 
 +
The parser finds the opening double quote for the attribute's value, then looks for the closing one.
 +
 
 +
Returned value will be:
 +
[[Image:JSP_Metamodel_Limit_1.png]]
 +
with an exception raised on the last double quote, because '=' is expected.

Revision as of 03:57, 21 April 2010

JSP Metamodel

The Modisco JSP Metamodel inherits from the Modisco XML one : JSP Metamodel.png


Inheritance was chosen because a JSP page uses the tag mechanism, attributes and comments, and is nearly well formed regarding the XML Metamodel.

Metamodel Architecture

According to the "Java Server Pages Specifications Version 1.2", JSP content is divided into 4 categories :

  • JSP Scripts :
    • JSP Scriplet : <% int variable = 0;%>
    • JSP Expression : <%= variable %>
    • JSP Declaration : <%! int variable = 0; %>
  • JSP Actions : <myPrefix:myAction arg1="value" />
    • JSP Standard Action : <jsp:getProperty name="beanName" property="propertyNamef" />
  • JSP Directive : <%@ include file="myFilePath" %>
    • JSP TagLib : <%@ taglib prefix="myPrefix" uri="taglib/mytag.tld" %>
  • Comments : code> <%-- This is a JSP comment --%> </code>

MetaModel Limits

Because JSP language is used to generated some content, it can be placed almost anywhere in the file, which imply certain limitations:


This is why the "isTagFragment : EBoolean" attribute was added. In fact, everything contain in a tag declaration as in its body is considered as children. It is indeed necessary to be able to differentiate whether the JSP tag is used to generate the tag description, or its body.

Some way of implementing JSP might cause some problem with the parser, especially for tag's attributes evaluation. What is expected to be found is some kind of syntax like :

name="value" or name='value' and even name=value

Sometimes we faced implementations like : <tag name=" <% if(condition){ %> value1" <% }else{ %> value2" <% } %> >

The parser finds the opening double quote for the attribute's value, then looks for the closing one.

Returned value will be: JSP Metamodel Limit 1.png with an exception raised on the last double quote, because '=' is expected.

Back to the top