[Bug 56516] VariableInfo doesn't handle scope changes correctly

2021-09-21 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=56516

--- Comment #8 from Mark Thomas  ---
It has been a long time comping but the move to Eclipse and Jakarta EE means I
can now propose changes to the JSP spec to address this.

Given the circumstances, the proposed changes are very modest and aim to
provide a workable solution with the minimal amount of change.

The current location for the issue is:
https://github.com/eclipse-ee4j/jsp-api/issues/42

Please add any comments there.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 56516] VariableInfo doesn't handle scope changes correctly

2014-05-16 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56516

--- Comment #6 from ad...@moparisthebest.com ---
I also tend to agree that declaring the variable once at the beginning
*probably* isn't the right solution, however I think the way this is currently
handled is still wrong.

Right now the variable is only declared once, but in whatever scope it is used
in first, so if it's in a small scope at the beginning and you declare the tag
anywhere else later it breaks.  I think a better behavior would be to declare
it everytime the tag is used, so if people need to put smaller scopes around
their tags it's at least a decent work around.

I also don't know exactly why variables aren't just declared whenever
VariableInfo.getDeclare() is true, it is always in my test case, yet it never
gets declared a second time.

-- 
You are receiving this mail because:
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 56516] VariableInfo doesn't handle scope changes correctly

2014-05-16 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56516

Mark Thomas ma...@apache.org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |INVALID

--- Comment #5 from Mark Thomas ma...@apache.org ---
Specification issue:
https://java.net/jira/browse/JSP-42

-- 
You are receiving this mail because:
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 56516] VariableInfo doesn't handle scope changes correctly

2014-05-16 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56516

--- Comment #7 from Remy Maucherat r...@apache.org ---
I also think this is invalid, although I am not the biggest expert on JSPs.

The Javadoc for scopes says:
/**
 * Scope information that scripting variable is visible only within the
 * start/end tags.
 */
public static final int NESTED = 0;

/**
 * Scope information that scripting variable is visible after start tag.
 */
public static final int AT_BEGIN = 1;

/**
 * Scope information that scripting variable is visible after end tag.
 */
public static final int AT_END = 2;

So for NESTED, declaring at the beginning cannot be right, and Konstantin's
example should probably work. For the other two, it's about the same, there's
nothing which indicates the variable should be visible before the tag, and
since the scriptlets nesting is not visible, there's no solution to that.

Note: In the example given, the scope is 1 (AT_BEGIN).

-- 
You are receiving this mail because:
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 56516] VariableInfo doesn't handle scope changes correctly

2014-05-16 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56516

--- Comment #4 from Mark Thomas ma...@apache.org ---
(In reply to Konstantin Kolinko from comment #3)
 Re: r1594715
 
 I think this report is invalid.

I'm leaning towards that conclusion.

snip/

 For 2.,3. declaration of variables is illustrated in ch.JSP.9.4.4 Actions
 page 1-196 (234 of 594). 

This is probably the clearest argument against the fix applied in r1594715. It
is a stronger argument than JSP.1.8 

 It also says:
 Their visibility is affected by other constructs, for example scriptlets.

I'm not sure what that means for the current approach that ensures variables
are only declared once when multiple instances of the same tag are used.

I'm going to revert this patch, resolve this issue as INVALID and write up the
problem for the JSP EG to discuss.

-- 
You are receiving this mail because:
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 56516] VariableInfo doesn't handle scope changes correctly

2014-05-15 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56516

--- Comment #3 from Konstantin Kolinko knst.koli...@gmail.com ---
Re: r1594715

I think this report is invalid.

In JSP specification (JSP2.3MR.pdf) there are three occurrences where an action
defines a variable:
1. A jsp:useBean action (chapter JSP.5.1)
2. A custom action returning a VariableInfo with declare=true from its TEI
class
3. A tag file declaring a variable declare=true

For 1. there is explicit example on visibility of declared variables. See
ch.JSP.5.1 jsp:useBean page 1-95 (133 of 594)/

For 2.,3. declaration of variables is illustrated in ch.JSP.9.4.4 Actions
page 1-196 (234 of 594).  It also says:
 Their visibility is affected by other constructs, for example scriptlets.

For 3. in ch.JSP.8.5.3 The variable Directive on page 1-183 (221 of 594)
description of declare attribute says:
 declare (optional) Whether the variable is declared or not in the
 calling page/tag file, after this tag invocation. true is the
 default.

I see no provision for declaring the variables prematurely.


Also Re: r1594715
1) I see no test example
2) I am certain that it is wrong to prematurely declare NESTED variables.

Regarding NESTED variables, iff c:forEach declared NESTED variables I expect
the following to fail with r1594715 because of duplicate declaration of i:
[[[
c:forEach var=i begin=1 end=10 ${i} /c:forEach
% for (int i=0; i  10; i++) {
  out.println(i);
   }
%
]]]
Actually JSTL tags do not work that way. They expose information only as JSP
scoped attributes. They do not expose them as scripting (java) variables.

-- 
You are receiving this mail because:
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 56516] VariableInfo doesn't handle scope changes correctly

2014-05-15 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56516

--- Comment #2 from Mark Thomas ma...@apache.org ---
This has been fixed in 8.0.x for 8.0.7 onwards. Given the history of
instability around changes in the this area I plan to give folks a chance to
test and review this fix in 8.0.x before I back-port it to 7.0.x.

-- 
You are receiving this mail because:
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 56516] VariableInfo doesn't handle scope changes correctly

2014-05-13 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56516

--- Comment #1 from Konstantin Kolinko knst.koli...@gmail.com ---
Do you expect a variable to be declared each time when
VariableInfo.getDeclare() returns true?
When JSP java code is generated the java scriptlets are treated as opaque. One
does not analyze what curly braces you may have in that code.


Just a quick note:
The last attempt to review variables declaration (4 years ago with bug 42390
and bug 48616 ) was somewhat painful, with regressions and reverts.

For reference:
- See places that call javax.servlet.jsp.tagext.VariableInfo.getDeclare()
- r910792

Fortunately, we have test cases for 42390 and 48616 in trunk
(TestScriptingVariabler, bug42390.jsp, bug48616*.jsp).

-- 
You are receiving this mail because:
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org