We are trying to run Bootsfaces on Jsf2.1/Jsp 1.3. We are working on migrating a legacy jsp application which has more than 1500 Jsp files(JSF1.2) to JSF2.1, migrating to Facelets will be lot of effort as we have to convert each .jsp file to .xhtml .
So , I have started with a demo web application as you suggested and created a facelets login page which uses bootsfaces. It works fine and I am able to see bootsfaces content rendering. Now as I want to use bootsfaces with Jsp servlets , I create a new Jsp page
when I try to add bootsfaces tag lib
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://bootsfaces.net/ui" prefix="b" %>
I get an exception at line number 3 :
the absolute uri "http://bootsfaces.net/ui” cannot be resolved in either web.xml or jar files loaded with application
I look into bootsfaces-b.taglib.xml file in bootsfaces jar file , I see
<?xml version="1.0" encoding="UTF-8"?>
<facelet-taglib xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facelettaglibrary_2_0.xsd"
version="2.0">
<namespace>http://bootsfaces.net/ui</namespace>
<tag>
<tag-name>accordion</tag-name>
....
So I figured out the problem might be because bootsfaces jar is using faceless tag library and I am trying to use servlet tag library to use it and its not able to find it. So I wanted to experiment on this and manually created a tld file which has servlet tag
<?xml version="1.0" encoding="ISO-8859-1"?>
<taglib xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd"
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.1">
I tested by adding one tag (inputText) description in .tld file , the format I changed to match the servlet tag lib format,
<!--made changes like replaced<tag-name> with <name>-->
<tag>
<name>inputText</name>
<tag-class>net.bootsfaces.component.inputText.InputText</tag-class>
<attribute>
<description><![CDATA[Access key to transfer focus to the input element.]]></description>
<name>accesskey</name>
<required>false</required>
<type>java.lang.String</type>
</attribute>
<attribute>
<description><![CDATA[Activates AJAX. The default value is false (no AJAX).]]></description>
<name>ajax</name>
<required>false</required>
<type>java.lang.Boolean</type>
</attribute>
There is no compile time exception shown on login.jp page, but when I try to run the project I get this exception
PWC6197: An error occurred at line: 28 in the jsp file: /jsp/login/login2.jsp PWC6199: Generated servlet error: method get in class org.apache.jasper.runtime.TagHandlerPool cannot be applied to given types;
We get this error when trying to run this application
required: java.lang.Class found: java.lang.Class
reason: inferred type does not conform to upper bound(s) inferred: net.bootsfaces.component.inputText.InputText upper bound(s): javax.servlet.jsp.tagext.JspTag PWC6197: An error occurred at line: 28 in the jsp file: /jsp/login/login2.jspPWC6199: Generated servlet error: We get this error when trying to run this application cannot find symbol symbol: method setPageContext(javax.servlet.jsp.PageContext) location: variable _jspx_th_b_inputText_0 of type net.bootsfaces.component.inputText.InputText
Could you please suggest any alternate way of getting bootsfaces working on jsp