Stylesheets not getting sent to browser.
Windows 7 Eclipse 4.5.2 (Dynamic Web project) tomcat 7.0.69 (instance is local to workstation)
[Eclipse workspace screen capture][1]
The web site is backed with servlets. I have tried... -- XHTML
out.println("<?xml-stylesheet href="/style/mystyle.css" type="text/css"?>");
-- XHTML
out.println("<?xml-stylesheet href="style/mystyle.css" type="text/css"?>");
-- Changing from XHTML to HTML
-- Using the
out.println("<base href=' http://localhost:8080/My_Website03/'>");
*(This method is not scalable to a server, I know. Just trying things.)*
-- Using request.getContextPath()
out.println("<link rel='stylesheet' href='" + request.getContextPath()
+ "/style/style.css' type='text/css' />");
out.println("<link rel='stylesheet' href='" + request.getContextPath()
+ "/style/blue.css' type='text/css' />");
-- Using no leading forward slash
out.println("<link rel='stylesheet' href='style/style.css' type='text/css' />");
out.println("<link rel='stylesheet' href='style/blue.css' type='text/css' />");
-- Using a leading forward slash
out.println("<link rel='stylesheet' href='/style/style.css' type='text/css' />");
out.println("<link rel='stylesheet' href='/style/blue.css' type='text/css' />");
-- Using a leading dot slash
out.println("<link rel='stylesheet' href='./style/style.css' type='text/css' />");
out.println("<link rel='stylesheet' href='./style/blue.css' type='text/css' />");
-- Using a leading double dot slash
out.println("<link rel='stylesheet' href='../style/style.css' type='text/css' />");
out.println("<link rel='stylesheet' href='../style/blue.css' type='text/css' />");
And nothing works to get the .css files over to the browser.
In order to get servlets working the logging issue needed to be fixed and Eclipse had to be given control of the TomEE-Plume conf. I don't know why but fixing just one of the two would not correct the problem. My skills in Eclipse & TomEE are to weak to understand why.
Fixing the logging issue is written up on this wiki page. More information on: http://wiki.eclipse.org/WTP_Tomcat_FAQ#How_do_I_enable_the_JULI_logging_in_a_Tomcat_5.5_Server_instance.3F Even though the wiki section is written for Tomcat 5.5 it still applies to Tomcat 7.0.69. Long time for a bug to not get fixed if you ask me.
This http://tomee.apache.org/tomee-and-eclipse.html page, in the "Advanced installation" section, step 9, gives the impression that configuring for Eclipse to take control is optional. As said above, this step is not optional to get TomEE-Plume to work for servlets. I had to let Eclipse take control of the TomEE installation.
One more note on step 9. The instruction say "Use Workspace Metadata" but the option needed is called "Add External Web Module..." not "Use Workspace Metadata".
There is one last discrepancy to mention. There is no /webapps/tomee directory anymore. I guess this changed since the documentation was written. I used "\host-manager" instead. I hope this does not come back to bite me latter.
O, yea, one other thing, there is no "Save" button on the Web Modules or Overview pages. Do a CTL+S to save the changes.
Hope that helps others.