• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

JSF problem. XML file does not appear to have any style information associated with it [duplicate]

 
Ranch Hand
Posts: 219
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm initiating in java jsf, I created an xhtml simple to show table in localhost but I am receiving this error "This XML file does not appear to have any style information associated with it. The document tree is shown below." I don't have any idea of to solve this.
My project is very simple is only to display a jsf table with records of mysql table.
Below is my project.
Especialidade:

EspecialidadesDAO:

JSF to display table:

Dependencies:

Result of the execution:


Thanks in advance.
 
Saloon Keeper
Posts: 22989
156
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's because your page isn't coming from JSF. The error message is a stock message produced by your browser when it receives raw XML without any associated presentation (styling) information.

In other words, you're requesting the "display table" directly, not through JSF.

For JSF to work, you have to send your URL requests to the FacesServlet. The FacesServlet then locates the appropriate View Template and uses it as the basis to generate an HTML response back to you.

For this to work properly, you need to name the View Template file appropriately. For example "displayTable.xhtml". Then you have to map ".xhtml" URLs to go to the FacesServlet. That is, in your web.xml, you make the following associations:

URL-pattern: *.jsf -> Logical Servlet ID: FacesServlet
Logical Servlet ID: FacesServlet -> FacesServlet class

Like so:


Then, if you invoke your URL something like this: http://localhost:8080/mywebapp/displayTable.jsf, JSF will properly route your request and - barring errors - render the page in the way you expect to see it.
 
Cezar Apulchro
Ranch Hand
Posts: 219
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
After update web.xml the problem still the same.
My web.xml:

Thnks.
 
Tim Holloway
Saloon Keeper
Posts: 22989
156
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the URL that you are submitting?
 
Cezar Apulchro
Ranch Hand
Posts: 219
2
 
Cezar Apulchro
Ranch Hand
Posts: 219
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry:
 
Tim Holloway
Saloon Keeper
Posts: 22989
156
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Cezar Apulchro wrote:Sorry:

 
Cezar Apulchro
Ranch Hand
Posts: 219
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Now is HTTP Status 404 after change to:
 
Tim Holloway
Saloon Keeper
Posts: 22989
156
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Cezar Apulchro wrote:Now is HTTP Status 404 after change to:



Your WAR is named ITC_Systems_ClientesMedicos?

Your view template file is located in the root of the WAR and named TabelaEspecialidade.xhtml?
 
Cezar Apulchro
Ranch Hand
Posts: 219
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, how to confirm for you?
 
Tim Holloway
Saloon Keeper
Posts: 22989
156
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Cezar Apulchro wrote:Yes, how to confirm for you?



I trust you. Although it is very strange if you get a 404 error from TabelaEspecialidade.jsf but a display from TabelaEspecialidade.xhtml. You should be seeing either both or neither.

Perhaps you could take a screen capture of the "404" page for me.
 
Cezar Apulchro
Ranch Hand
Posts: 219
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I try to send image of screen for you.
 
Cezar Apulchro
Ranch Hand
Posts: 219
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to send image?
 
Saloon Keeper
Posts: 6795
161
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can attach it to a post. See the tab "Attachments" underneath the text field when you're writing a reply.
 
Cezar Apulchro
Ranch Hand
Posts: 219
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HTTP Status 404 – Não Encontrado
Type Status Report

Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.

Apache Tomcat/9.0.14
 
Cezar Apulchro
Ranch Hand
Posts: 219
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.
Imag_ITC.jpg
[Thumbnail for Imag_ITC.jpg]
 
Tim Holloway
Saloon Keeper
Posts: 22989
156
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK. The mystery continues. Can your provide me with a directory tree listing of the TOMCAT_HOME/webapps directory? In linux, you'd use the "tree" utility. I think that DOS has an option like DIR /T.
 
Cezar Apulchro
Ranch Hand
Posts: 219
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, just now I noticed a message from the maven.

content of maven-archiver:
 
Tim Holloway
Saloon Keeper
Posts: 22989
156
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's some Maven snippets. They're old, but should still work: Or at least indicate what you might need if you upgrade them.


Note that the core JEE jars are "provided", not "compile" scope. Using compile scope would put copies of those JARs into the WAR and cause problems because they'd hide the copies that are build into Tomcat (in the TOMCAT_HOME/lib directory).

Tomcat is not full-stack JEE compliant, which is why in Tomcat the jsf-impl JAR is "compile" scope. For full-stack servers like Wildfly and Websphere, jsf-impl would be "provided" as well, since JSF is built into them.
 
Cezar Apulchro
Ranch Hand
Posts: 219
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, after download jstl 1.2 and install manually the problem was solved.
Thanks and best regards.
 
Cezar Apulchro
Ranch Hand
Posts: 219
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The correct is, after download jstl-api 1.2 and install manually the problem was solved.
Thanks and best regards.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic