I use Eclipse and I write jsp files with HTML5 content.
So I have for example this line:
<div class="test" data-role="test123">
In Eclipse I get the warning:
Undefined attribute name (data-role)
What needed to be done so these warnings won't appear anymore? In HTML5 this attribute is allowed (data-*) as you can see here: http://ejohn.org/blog/html-5-data-attributes/
It seems like Eclipse still has some problems validating HTML5 elements and attributes even now.
I'm running Mars 4.5.1 and I have had warnings about the <main> element, despite the fact that there are no warnings about the <section> element.
But there is a solution!
Window > Preferences > Web > HTML Files > Validation
Here you can tick the Ignore specified element names in validation checkbox and enter the names of any elements which Eclipse is incorrectly warning you about.
In your case, you will want to tick the Ignore specified attribute names in validation checkbox and enter the data-role attribute.
After you click 'Apply', Eclipse will ask you to do a full validation of the project. Select 'Yes' and the changes will take effect.
No more squiggly yellow lines YAY! :D
Your doctype
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
is for HTML 4.01.
data-* attributes were added in HTML 5. The doctype for HTML 5 is basically either
<!DOCTYPE html SYSTEM "about:legacy-compat">
or
<!DOCTYPE html>
Newer versions of Eclipse support HTML5 tags and the data-* attributes allowed in HTML5. However, when using the role attribute the proper syntax according to the ARIA Roles Model and XHTML Role Attribute Module is not to prefix the role attribute with data-* leaving just role and not data-role.
So <ul role="menubar"> is more correct than <ul data-role="menubar">. The validity of the syntax can be checked using the (X)HTML5 Validator. jQuery Mobile uses quite extensively the data-role attribute, though I'm not sure why.
Note: If you upgrade and you're still getting warnings on data-* attributes you may want to consider updating or removing any installed syntax-checkers such as JTidy. As of Indigo Service Release 1 the role attribute continues to trigger an undefined attribute warning in Eclipse by default.
I used this one with Aptana 3.6 when I'am coding AngularJS
Window > Preferences
I use the Aptana Studio plugin on Mac OS X; if I go Eclipse > Preferences > Aptana Studio > Validation > HTML, and create the filter *data-role* I no longer get this warning.
I believe on Windows it is Window > Preferences > Aptana Studio > Validation > HTML
Eclipse 3.6 introduced a new field under:
Validation -> HTML Syntax: Ignore specified attribute names in validation
Add the OpenGraph, RDFa or other non-HTML5 attributes you want the validator to ignore:
You will need to re-validate the project, then the warnings will be gone.
Eclipse observes the DOCTYPE declaration. In my case, the solution was using the code above at the first line of the files containing HTML code:
<!DOCTYPE html>
Related to that, there's this other question, already answered:
Why do we need DOCTYPE to the HTML/JSP pages?
Related
I am using Vue in JSP files. The software is Eclipse STS. But JSP in JSP Editor, Vue syntax is not supported.
I tried Codemix plugin. But no go. Because Codemix supports only vue files, it seems. Any help would be appreciated.
<button #click = "frmSubmit()" type="submit" class="btn btn-info pull-right">확인</button>
#click or :href="this section should be highlighted,either"
but they are just treated as string or undefined attribute.
Supporting those as attribute names has simply not been asked for, at least in a JSP. They should be recognized in the upcoming March release with the resolution to https://bugs.eclipse.org/543994 . A plug-in being able to assume responsibility for syntax coloring those attribute's values would take longer, but there's no solution for it yet, nor a feature request to work out how to do it.
I am using STS for Spring application developement. I want to use Bootstrap CSS on frontend.
The problem is that code assist does not work for css classes (JetBrains PHPStorm is doing it just fine)
So when I type
<button class="|
I would like to Ctrl+Space to get list of all available css classes (obviously fetched from CSS files in project).
How can I do this?? Code assist for tags and tag attributes works, but what about class attribute value?
Required feature comes with plugin wtp-web-resources but it has some bugs and is no longer maintained because it was supposed to be merged into WTP as core feature and its not done yet.
I have this annoying behaviour with Eclipse where it warns me about the <main> element in my JSP file.
I've got <!DOCTYPE html> at the top of my page and I'm using several other HTML5 elements, such as <header> and <footer>, but Eclipse doesn't give a warning about these.
I tried switching off HTML and JSP syntax validation but that didn't seem to work.
I just don't understand why it has a problem with the <main> tag but not other HTML5 tags and that little yellow underline is SUPER irritating.
How can I get Eclipse to ignore this tag?
Thank you in advance for your answers.
So, it seems like people were having a similar problem with HTML5 attributes according to the question linked in the comment #safin chacko.
The answers posted there show how you could get Eclipse to ignore validation of specified attributes. Since then it seems that Eclipse has the added feature of being able to also ignore validation of specified elements
I have posted an answer on that question which also answers my own question.
There appears to be a Bugzilla item for this already. Hopefully, when that is addressed, the problem will go away.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=516758
In the meantime, you can suppress the warning by going to Eclipse > Preferences > Web > HTML Files > Validation and adding main to the comma-separated list element names to be ignored.
One of the cause for this warning might be you are using footer tag without a header tag.
1.Create a separate file say "Footer.html" and write your footer content in that.
2.Include that footer.html in your main .jsp file through :
<%# include file="Footer.html"%>
You can try the same for header also.
After a server crash, I had to re-install TYPO3 using my latest database backup.
While I was at it, I upgraded TYPO3 from whatever I installed about half a year ago to 4.7.2 and, consequently, also had to use a newer tt_news module (3.2.1).
Unfortunately, none of the news sections on my site show up now. All it says where they should be in the HTML code is:
<!-- CONTENT ELEMENT, uid:24/list [begin] -->
<div id="c24" class="csc-default">
<!-- Plugin inserted: [begin] -->
<!-- Plugin inserted: [end] -->
</div>
<!-- CONTENT ELEMENT, uid:24/list [end] -->
I did update the database when I installed the plugin and clicked the link for the updater script on the plugin's configuration page, although it didn't seem to do anything.
I'm really new to TYPO3, so I can't be sure it's nothing with the HTML template, which I had to reconstruct from scratch. Also, I'm not really sure yet how you would get an idea of what's going on (or wrong) in cases like this in TYPO3.
Please check the following:
tt_news static template is included or not.
Go through the extension manual and check whether the flexform options and typoscript configuration are correct.
Make sure that the typoscrpt object browser is error free.
Check the error log and set Install tool > All configuration > displayErrors = -1 for your IP address.
I am developing a dojo application in Netbeans 7.1, however since dojo uses non standard HTML attributes, I have XHTML validation errors in every line.
Within Netbeans there is the option to completely ignore this errors for a specific line or for the whole document, bu I would like to keep basic html validation on.
Is it possible to have this errors ignored without loosing html validation ?
Dojo supports also valid data- HTML attributes, use those:
data-dojo-config not djConfig, e.g.: data-dojo-config="parseOnLoad:true,async:true"
data-dojo-type instead of dojoType
data-dojo-props e.g.: data-dojo-props="name:'start_date',required: true"
data-dojo-attach-point in widget templates
data-dojo-attach-event in widget templates
data-dojo-id instead of jsId
Edit: Since data-* attributes are valid only in HTML5 and NetBeans validates documents according to doctype you can also fine-tune validation via menu Tools » Options » Editor » Hints » HTML. There turn off or change Show As of Elements. You will need to reopen html documents to apply new validation rules