- This topic has 10 replies, 7 voices, and was last updated 18 years, 9 months ago by
henk.
-
AuthorPosts
-
eskapeMemberI’ve upgraded MyEclipse to:
MyEclipse Enterprise Workbench
Version: 5.0.0
Build id: [build id]Now I get several “cannot be resolved” errors on my JSP pages in my project.
When I open one of these files in my browser, I do not get the “cannot be resolved” errors.For example:
<logic:iterate name="list" id="item"> <% MyClass obj = (MyClass)item; %> </logic:iterate>
The following error occurres in my project: “item cannot be resolved”
Another example:
<logic:messagesPresent message="error"> <html:messages id="error"> <%=error%><br /> </html:messages> </logic:messagesPresent>
The following error also occurres in my project: “error cannot be resolved”
Can anyone help me resolving this problem?
Thanks!
August 15, 2006 at 2:28 pm #256854
Riyad KallaMemberYour code is technically fine, the error is incorrect and it stems from the inability of the JSP parser to extract run-time behavior of taglibs at design time. More details here:
http://www.myeclipseide.com/PNphpBB2+file-viewtopic-t-13364.htmlAugust 21, 2006 at 7:10 am #257234
Bernd MaierhoferMemberIs there any way to rewrite such a JSP snippet so no error is displayed? Or any way to disable this error?
Bernd
August 21, 2006 at 9:04 am #257241
Riyad KallaMemberBernd,
The ultimate goal of the JSP spec is to remove all the uses of scriplets (<% %> segments of code), so if you can avoid that, you shouldn’t get markers.August 30, 2006 at 2:07 pm #257838
warrenthebrownMemberUsing MyEclipse 5.0.1 I see the same problem as reported by the previous person. Although I might ‘understand’ your response, I don’t understand why a capability that was working with MyEclipse 4.x no longer works, and thus now causes development hardships if a number of jsp files make use of
<logic:iterate … id=”xxx” …>
<% xxx.something %>
</logic:iterate>Thank you.
August 30, 2006 at 6:55 pm #257853
Riyad KallaMemberWarren,
The problem is that the JSP editor got smarter, where as before it just ignored it. So now it’s trying to be (too helpful?) and marking what used to be valid, invalid. We agree it’s not a stellar state and have a ways to go to improve the validation controls. Hopefully this should get rectified soon.September 5, 2006 at 5:15 am #258113
shieroiMemberHello everybody!
The same problem here, a solution is eagerly awaited.September 18, 2006 at 7:39 pm #258728
Max VilnerMembersupport-rkalla wrote in the FAQ (referenced in the link above):
“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.”In my oppinion, it shouldn’t be too difficult to include beans in design time validation without going into runtime evaluation. All that needs to be done is collecting all id attribute values of tags like <useBean>, <bean:define>, <nested:define>, <logic:iterate> etc. and have the validator check the name of new jsp variable against that collection.
Thanks.
MaxSeptember 19, 2006 at 9:28 pm #258787
Riyad KallaMemberMax,
That is most likely the best approach to making this problem go 80% away, but take a tag like:
<mytag blah=”arg”>
</mytag>The evaluator has no idea what mytag does. But I think you are right that some generic way to extend a variable collector and compare it to the new var is going to be what the dev team decides to do.
September 20, 2006 at 1:28 pm #258878
Max VilnerMemberRiyad,
Of course there’s no way to validate custom bean-producing tags (if I uderstood correctly your point). However as long as all known JSP tags are covered we’ll be OK.
Thanks,
Max
September 21, 2006 at 5:02 am #258934
henkMemberOf course there’s no way to validate custom bean-producing tags (if I uderstood correctly your point). However as long as all known JSP tags are covered we’ll be OK.
Why would there be no way? The most logical solution is to have a myeclipse config file somewhere in which you can define what any tag does in term of introducing variables into scope.
e.g.
<taglib uri="someuri" > <tag name="sometag> <variables> <attribute name="somevar" defaultvalue="myvar" scope="page" /> </variables> </tag> </taglib>
This would say that sometag from taglib someuri has an attribute somevar that injects a variable into page scope. Furthermore, a defaultvalue would be handy incase the attribute is set by an EL expresion which may be difficult or impossible to evaluate at design time. I think the myeclipse team already has this sort of file somewhere internally; i.e. they have to keep the information of what the standard tags do somewhere (like the jsf loadbundle tag). Now all they have to do is make this DB of tag information accesible and editable by the end user.
-
AuthorPosts