From: l8storm <l8...@ar...> - 2006-06-28 13:40:15
|
Using: jetty 6.0.0beta17 myfaces 1.1.3 java 1.5.0_06 I am a jetty newbe and I am having a problem running jetty with the jsf implementation myfaces. I wrote a simple java-class that sets up jetty with a sample webapplication: ---------------------------------------------------------------------------------- public class JettyTest { public static void main(String[] args) { Server server = new Server(); Connector connector = new SelectChannelConnector(); connector.setPort(8111); server.setConnectors(new Connector[] {connector}); WebAppContext ctx = new WebAppContext(); ctx.setContextPath("/"); ctx.setResourceBase("/home/steffen/programming/java/JettyTest/SquareCalc/"); server.setHandler(ctx); try { server.start(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------------------------------- SquareCalc's web.xml: <?xml version="1.0"?> <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-app_2_4.xsd" version="2.4"> <listener> <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class> </listener> <!-- ############# Faces Servlet ############# --> <servlet> <servlet-name>JavaServer Faces Servlet</servlet-name> <servlet-class> javax.faces.webapp.FacesServlet </servlet-class> <load-on-startup>1</load-on-startup> </servlet> <!-- ############# Mapping ############### --> <servlet-mapping> <servlet-name>JavaServer Faces Servlet</servlet-name> <url-pattern>/faces/*</url-pattern> </servlet-mapping> </web-app> --------------------------------------------------------------------------------------------------- Square Calc's eingabe.jsp: <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> <html> <head> <title>Berechnung eines Fl?cheninhaltes</title> </head> <body> <f:view> <h3>JSF-Beispielanwendung zur Berechnung eines Fl?cheninhaltes:</h3> Dieses Programm berechnet aufgrund der Eingabe einer Seitenl?nge den Fl?cheninhalt eines Quadrates. <br><br> <h:form id="inputForm"> Bitte geben Sie eine Seitenl?nge ein: <h:input_text value="#{Square.length}" /> <h:command_button value="Berechnen" action="success" /> </h:form> </f:view> </body> </html> --------------------------------------------------------------------------------------------------- Running the JettyTest class above is possible without problems, but as soon as I try to access the JSP eingabe.jsp, I get an exception. Here is the jetty log: 2 [main] INFO org.mortbay.log - Logging to org.slf4j.impl.SimpleLogger@60a1807c via org.mortbay.log.Slf4jLog 76 [main] INFO org.mortbay.log - jetty 6.0.0beta17 830 [main] INFO org.apache.myfaces.config.FacesConfigurator - Reading standard config org/apache/myfaces/resource/standard-faces-config.xml 1622 [main] INFO org.apache.myfaces.config.FacesConfigurator - Reading config /WEB-INF/faces-config.xml 1756 [main] WARN org.apache.myfaces.shared_impl.util.LocaleUtils - Locale name in faces-config.xml null or empty, setting locale to default locale : en_US 2222 [main] INFO org.apache.myfaces.webapp.StartupServletContextListener - ServletContext '/home/steffen/programming/java/JettyTest/SquareCalc/' initialized. 2398 [main] INFO org.mortbay.log - Started SelectChannelConnector @ 0.0.0.0:8111 5615 [btpool0-2] WARN org.mortbay.log - EXCEPTION org.apache.jasper.JasperException: org.apache.jasper.JasperException: /eingabe.jsp(18,4) No tag "input_text" defined in tag library imported with prefix "h" at org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510) at [...] --------------------------------------------------------------------------------- So, how can I tell jetty / jasper to use the defined tags? PS: This is slightly the same question as in http://www.nabble.com/jetty-and-jsf-tf1847594.html , but it did not help me (the given solution expects two jars to include in your project, but I do not now where I can find them). -- View this message in context: http://www.nabble.com/jetty%2C-jsf-and-no-tags-found-tf1861598.html#a5084499 Sent from the Jetty Support forum at Nabble.com. |