]
Thomas Heute updated GTNPORTAL-762:
-----------------------------------
Fix Version/s: 3.0.0-GA
Invalid HTML tag format when using javax.portlet.MimeResponse /
response.addProperty API
-----------------------------------------------------------------------------------------
Key: GTNPORTAL-762
URL:
https://jira.jboss.org/jira/browse/GTNPORTAL-762
Project: GateIn Portal
Issue Type: Bug
Security Level: Public(Everyone can see)
Affects Versions: 3.0.0-CR01
Environment: CR1 tomcat Bundle
MacOSX
OS FF3.5, Safari4,Chrome
Reporter: Tugdual Grall
Assignee: Matt Wringe
Fix For: 3.0.0-GA
In my portlet I have the following code in my portlet:
...
@Override
protected void doHeaders(RenderRequest request, RenderResponse response) {
Element description = response.createElement("meta");
description.setAttribute("name", "description");
description.setAttribute("content", "Some Content about GateIn
project");
response.addProperty(MimeResponse.MARKUP_HEAD_ELEMENT, description);
Element keywords = response.createElement("meta");
keywords.setAttribute("name", "keywords");
keywords.setAttribute("content", "exo,
gatein,portal,portlet");
response.addProperty(MimeResponse.MARKUP_HEAD_ELEMENT, keywords);
Element cssFile = response.createElement("link");
cssFile.setAttribute("type", "text/css");
cssFile.setAttribute("href", request.getContextPath() +
"/resources/my-portlet.css");
cssFile.setAttribute("rel","stylesheet");
response.addProperty(MimeResponse.MARKUP_HEAD_ELEMENT, cssFile);
super.doHeaders(request, response);
}
...
The HTML code generated looks like (do a view source on a page):
------- CODE -----
<?xml version="1.0" encoding="UTF-8"?>
<meta content="Some Content about GateIn project"
name="description"/>
<?xml version="1.0" encoding="UTF-8"?>
<meta content="exo, gatein,portal,portlet" name="keywords"/>
<?xml version="1.0" encoding="UTF-8"?>
<link href="/lab-010-portlet-html-header/resources/my-portlet.css"
rel="stylesheet" type="text/css"/>
-------- /Code -----
We should remove the blank between lines and the XML definition to have something that
looks like
------- CODE -----
<meta content="Some Content about GateIn project"
name="description"/>
<meta content="exo, gatein,portal,portlet" name="keywords"/>
<link href="/lab-010-portlet-html-header/resources/my-portlet.css"
rel="stylesheet" type="text/css"/>
-------- /Code -----
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: