[Logo] Enterprise Client Community
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Message in Eclipse: Can not find the tag library descriptor for "http://java.sun.com/jsf/core"  XML
Forum Index -> Development
Author Message
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5510
Offline

When creating projects via the Maven project archetypes, then there might come up a validation error with ".jsp" pages of your project:

Code:
Can not find the tag library descriptor for "http://java.sun.com/jsf/core"


To overcome do the following: add the following to your pom.xml:

Code:
 		<dependency>
 		    <groupId>javax.servlet.jsp.jstl</groupId>
 		    <artifactId>jstl-api</artifactId>
 		    <version>1.2</version>
 		    <scope>provided</scope>
 		</dependency>        
 


We added it to our project archetypes.

Regards, Björn

Björn Müller, CaptainCasa GmbH
jeder



Joined: 12/11/2021 06:59:59
Messages: 2
Offline

Hi,
I have created a Spring Boot project in Eclipse. Unfortunately, the hint about the missing dependency does not help. When running the application, an error occurs as soon as the start page is called.

Error message:
Code:
 ...
 2021-11-26 18:45:09.655  INFO 11944 --- [           main] springbootstartup.SBApplication          : Started SBApplication in 13.708 seconds (JVM running for 14.931)
 2021-11-26 18:45:14.123  INFO 11944 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring DispatcherServlet 'dispatcherServlet'
 2021-11-26 18:45:14.123  INFO 11944 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
 2021-11-26 18:45:14.138 DEBUG 11944 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Detected StandardServletMultipartResolver
 2021-11-26 18:45:14.146 DEBUG 11944 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : enableLoggingRequestDetails='false': request parameters and headers will be masked to prevent unsafe logging of potentially sensitive data
 2021-11-26 18:45:14.146  INFO 11944 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Completed initialization in 8 ms
 2021-11-26 18:45:14.177 DEBUG 11944 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : GET "/", parameters={}
 2021-11-26 18:45:14.198 DEBUG 11944 --- [nio-8080-exec-1] o.s.b.a.w.s.WelcomePageHandlerMapping    : Mapped to ParameterizableViewController [view="index"]
 2021-11-26 18:45:14.213 DEBUG 11944 --- [nio-8080-exec-1] o.s.w.s.v.ContentNegotiatingViewResolver : Selected 'text/html' given [text/html, application/xhtml+xml, image/avif, image/webp, application/xml;q=0.9, */*;q=0.8]
 2021-11-26 18:45:14.213 DEBUG 11944 --- [nio-8080-exec-1] o.s.web.servlet.view.JstlView            : View name 'index', model {}
 2021-11-26 18:45:14.234 DEBUG 11944 --- [nio-8080-exec-1] o.s.web.servlet.view.JstlView            : Forwarding to [/WEB-INF/jsp/index.jsp]
 2021-11-26 18:45:14.394 ERROR 11944 --- [nio-8080-exec-1] o.a.c.c.C.[.[localhost].[/].[jsp]        : Servlet.service() for servlet [jsp] threw exception
 
 org.apache.jasper.JasperException: The absolute uri: [http://java.sun.com/jsf/core] cannot be resolved in either web.xml or the jar files deployed with this application
         at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:55) ~[tomcat-embed-jasper-9.0.38.jar!/:9.0.38]
         at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:294) ~[tomcat-embed-jasper-9.0.38.jar!/:9.0.38]
         at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:81) ~[tomcat-embed-jasper-9.0.38.jar!/:9.0.38]
         at org.apache.jasper.compiler.TagLibraryInfoImpl.generateTldResourcePath(TagLibraryInfoImpl.java:251) ~[tomcat-embed-jasper-9.0.38.jar!/:9.0.38]
         at org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:122) ~[tomcat-embed-jasper-9.0.38.jar!/:9.0.38]
 ...
 


Indexpage:
Code:
 <%@page contentType="text/html"%>
 <%@page pageEncoding="UTF-8"%>
 
 <%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
 <html lang="en">
 <body>
 	<div>
 		<div>
 			<h1>Spring Boot JSP Example</h1>
 			<h2>Hello !!</h2>
 			
 			Click on this <strong><a href="next">link</a></strong> to visit another page.
 		</div>
 	</div>
 </body>
 </html>


I have provide the pom.xml, which corresponds to the standard of the Spring Boot CaptainCasa archetype.

I use Eclipse IDE for Enterprise Java Developers.
Version: 2018-12 (4.10.0)
Build id: 20181214-0600
OS: Windows 10, v.10.0, x86_64 / win32
Java version: 11.0.13


I am grateful for any advice.

Kind regards,
Johann
 Filename pom.xml [Disk] Download
 Description
 Filesize 5 Kbytes
 Downloaded:  140 time(s)

CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5510
Offline

Hi,

this is not a CaptainCasa-layout! ;-)

Place the following layout into src/main/webapp/test1.jsp:
Code:
 <%@page contentType="text/html"%>
 <%@page pageEncoding="UTF-8"%>
 
 <%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
 <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
 
 <%@taglib prefix="t" uri="/WEB-INF/eclnt"%>
 
 
 <!-- ========== CONTENT BEGIN ========== -->
 <f:view>
 <h:form>
 <f:subview id="test1g_sv">
 <t:beanprocessing id="g_1" beanbinding="#{d.Test1UI}" />
 <t:rowtitlebar id="g_2" text="#{d.Test1UI.title}" />
 <t:rowheader id="g_3" />
 <t:rowbodypane id="g_4" />
 <t:pageaddons id="g_pa"/>
 </f:subview>
 </h:form>
 </f:view>
 <!-- ========== CONTENT END ========== -->
 


Add the following code to your src/main/java/managedbeans/Test1UI:
Code:
 package managedbeans;
 
 import java.io.Serializable;
 
 import org.eclnt.editor.annotations.CCGenClass;
 import org.eclnt.jsfserver.pagebean.PageBean;
 
 @CCGenClass (expressionBase="#{d.Test1UI}")
 
 public class Test1UI
     extends PageBean 
     implements Serializable
 {
     public Test1UI()
     {
     }
 
     public String getPageName() { return "/test1.jsp"; }
     public String getRootExpressionUsedInPage() { return "#{d.Test1UI}"; }
 
     String m_title = "Harry";
     public String getTitle() { return m_title; }
     public void setTitle(String value) { this.m_title = value; }
 
 }
 


Both files are attached.

Call...
Code:
 mvn clean install spring-boot:run
 

...from your project directory.

Then hopefully... things will start up.

Use URL "http://localhost:8080/test1.risc" in the browser.

The JSF version coming with the delivery is a reduced one - that fits to exactly CaptainCasa's needs. So do not use for any other pages. (You may of course embed the reference implementation of JSF as well - but first check that things are working with the two files I mention in this post...).

I just did exactly the same and had no problem... I also used version 20211124 of CaptainCasa, the same that you use.

Please feed back the result, so that I can sleep well. ;-)

Kind regards! Björn



 Filename test1.jsp [Disk] Download
 Description
 Filesize 605 bytes
 Downloaded:  152 time(s)

 Filename Test1UI.java [Disk] Download
 Description
 Filesize 604 bytes
 Downloaded:  168 time(s)


Björn Müller, CaptainCasa GmbH
jeder



Joined: 12/11/2021 06:59:59
Messages: 2
Offline

Hi Björn,

Thanks for the quick reply. Now it works and starts without an Exception.

Kind regards,
Johann
 
Forum Index -> Development
Go to:   
Powered by JForum 2.1.6 © JForum Team