False positive 'Add a <title> tag to this page.' in jsf xhtml file

742 views
Skip to first unread message

thomas....@gmail.com

unread,
Sep 9, 2015, 3:43:35 AM9/9/15
to SonarQube
Hello everyone,

my JavaEE project consists of several xhtml files as views for JSF. They contain an <html> tag and even a <title> tag which is itself inside a <h:head> tag. Sonarqube (with the Web plugin) reports that a head tag is missing. I would expect it to recognize the existing JSF head tag with the containing title.

Best regards,
Thomas

thomas....@gmail.com

unread,
Oct 2, 2015, 8:05:47 AM10/2/15
to SonarQube, thomas....@gmail.com
I wonder nobody has an opinion about this.

Actually this case goes even further. I would expect Sonarqube to detect an xhtml file being a template and thus part of a root xhtml file which itself may contain a title tag. Now all files are expected to have a title tag by Sonarqube.

Massimo Paladin

unread,
Oct 5, 2015, 3:33:23 AM10/5/15
to Thomas McWork, SonarQube
Hi Thomas,

can you provide a reproducer for the "Add a <title> tag to this page."?
About recognizing templates and excluding some files from this rule you can try to propose a solution.
You can always disable this rule if it doesn't fit your environment,
the web plugin tries to cover many web languages and cannot suit all the cases.

Cheers,


Massimo PALADIN | SonarSource
Software Developer @ Language Team
http://sonarsource.com

--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/56e47b54-9fbe-4499-a02a-66c001c4dd3f%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

jason.j...@gmail.com

unread,
Feb 14, 2017, 12:05:04 PM2/14/17
to SonarQube, thomas....@gmail.com
I have similar issue here. JSF composite component xhtml  page has  <html> tag while should not have <header> and <title> as it's only part of the page.

For example:

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:cc="http://xmlns.jcp.org/jsf/composite"
    xmlns:h="http://xmlns.jcp.org/jsf/html"
    xmlns:f="http://xmlns.jcp.org/jsf/core"
    xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
    xmlns:p="http://primefaces.org/ui">
   
<!-- INTERFACE -->
<cc:interface componentType=".....">
    <cc:attribute  ..../>
....
</cc:interface>
<!-- IMPLEMENTATION -->
<cc:implementation>
......

I would suggest if the html tag include http://xmlns.jcp.org/jsf/composite then skip the rule.

For reproduce the issue, you can check:

https://sonarqube.com/dashboard?id=org.tiefaces%3Atiefaces%3Asrc%2FMETA-INF%2Fresources%2Ftiefaces%2Fwebsheet.xhtml


Thanks
Jason
Reply all
Reply to author
Forward
0 new messages