Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
support-rkalla
Post subject: [JSP] Scriplet marks valid variable as error  PostPosted: Jul 17, 2006 - 05:01 PM
Moderator
Moderator


Joined: Jan 06, 2004
Posts: 23347

An example of this problem is outlined by the following snippet of code:
Code:

<bean:define id="myBean"/>
My Bean="<%= myBean %>"

The 2nd line will be marked as an error likely pointing to the "unknown" variable "myBean". This is actually the result of runtime behavior being different from design time behavior.

In the example above we happen to know what the Struts tag bean:define does, so we understand why the code above should work and why it works at run time (note: bean:define will create an instance of a class with the given type, so the scriplet will have access to it given it's notation above). The problem is that the syntax parser in the JSP editor has no idea what bean:define does, so it doesn't understand (without running the code) what happens why the scriplet should not be marked as an error.

This problem most likely won't be solved anytime soon as runtime evaluation of pages on the fly is an expensive operation and tricky problem to solve. Additionally using scriplets in JSP pages are considered bad practice and modifications to the JSP specification as it moves forward continue to phase that practice out. Instead of this problem being addressed in MyEclipse, it is most likely that the JEE specifications from Sun will continue to change to better suite programmer needs so they don't need to use scriplets instead.
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 6 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits