xml-xsp-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ricardo Rocha <rica...@apache.org>
Subject Re: XSP Spec
Date Wed, 08 Nov 2000 14:41:51 GMT

Kevin Sonney wrote:

> Correct. I'd also like to propose the following :
> xsp:variable
>   reason: to create a variable definitions
>   context: /xsp:structure/xsp:logic/
>   results: language dependant
> Now, this *COULD* be a thread safety issue in Java, so it would be best to
> document this for "global flags" or something. I would be using it so that
> this :
> <xsp:variable name="debug_trace_info" type="boolean">true</xsp:variable>
> would result in this java code :
> private static boolean debug_trace_info = true;

While I see the need for a tag-based variable declaration mechanism (especially

to avoid name clashes inadvertedly introduced by independent logicsheets) I
think this should be part of the XSP language tagset: we can always declare
inside <xsp:logic> blocks (whether call or method-level).

Imo, the appropriate context for this is at the logicsheet level. A logicsheet
(like SLL) could provide directives for declaring and referencing variables so
they're properly name-expanded in code to avoid clashes. Example:

  <sll:declare-variable name="foo" type="MyClass">
    new MyClass(<request:parameter name="foo" default="123"/>)
  . . .
    . . .
      if (<sll:variable name="foo"/>.getValue().equals("123")) {
        . . .
    . . .

where variable names in declarations and references would be expanded by
means of prefixes/suffixes (based on the logicsheet's own namespace
prefix) to ensure that no 2 variables with the same name (and in different
logicsheets) would generate the same identifier.

Hmmm... this example looks ugly, I know. More thought is required.

What I'd like to emphasize is that is should be dealt with at a higher level
the core XSP tagset.

View raw message