Hallo,
ich wollte mittel JSF eine LOGIN-Seite basteln. Soweit so gut. Leider kann ich diese Seite nicht ausführen, weil http status 500 mit folgendem inhalt wiederbekomme:
Die dazugehörige web.xml sieht so aus:
Die Datei die aufgerufen werden soll sieht so aus:
Mir ist bekannt, was der code 500 besagt. Ich weiß nun aber nicht, was er mit ein Fehler in Zeile 8 hat. Damit kann ich leider nichts anfangen.
Wäre klasse wenn mir da jemand helfen kann.
Danke!
Pichi
ich wollte mittel JSF eine LOGIN-Seite basteln. Soweit so gut. Leider kann ich diese Seite nicht ausführen, weil http status 500 mit folgendem inhalt wiederbekomme:
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: An exception occurred processing JSP page /homepage.jsp at line 8
5: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
6: <html>
7: <body>
8: <f:view>
9: <h:form id="form" style="margin: 100px;">
10: <hanelGrid columns="2" styleClass="borderTable" headerClass="panelHeading">
11: <f:facet name="header">
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:524)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:435)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
root cause
javax.faces.FacesException: Faces context not found. getResponseWriter will fail. Check if the FacesServlet has been initialized at all in your web.xml configuration fileand if you are accessing your jsf-pages through the correct mapping. E.g.: if your FacesServlet is mapped to *.jsf (with the <servlet-mapping>-element), you need to access your pages as 'sample.jsf'. If you tried to access 'sample.jsp', you'd get this error-message.
javax.faces.webapp.UIComponentTag.setupResponseWriter(UIComponentTag.java:926)
javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:313)
org.apache.myfaces.taglib.core.ViewTag.doStartTag(ViewTag.java:73)
org.apache.jsp.homepage_jsp._jspx_meth_f_005fview_005f0(homepage_jsp.java:117)
org.apache.jsp.homepage_jsp._jspService(homepage_jsp.java:92)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.13 logs.
Apache Tomcat/6.0.13
Die dazugehörige web.xml sieht so aus:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!--
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* [url]http://www.apache.org/licenses/LICENSE-2.0[/url]
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
-->
<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 http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<display-name>Onlineshop für das Fach BIM</display-name>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
</context-param>
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>/WEB-INF/faces-config.xml</param-value>
</context-param>
<servlet>
<servlet-name>FacesServlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<!--
<servlet-mapping>
<servlet-name>FacesServlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
-->
<servlet-mapping>
<servlet-name>FacesServlet</servlet-name>
<url-pattern>*.faces</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
Die Datei die aufgerufen werden soll sieht so aus:
Code:
<%@ page session="false" contentType="text/html;charset=utf-8"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<body>
<f:view>
<h:form id="form" style="margin: 100px;">
<h:panelGrid columns="2" styleClass="borderTable" headerClass="panelHeading">
<f:facet name="header">
<h:outputText value="Anmeldung Onlineshop"/>
</f:facet>
<h:outputLabel for="kundennummer" value="Kundennummer:" />
<h:inputText id="kundennummer" required="true" value="#{kundenHandler.kundennummer}" />
<h:message for="kundennummer"/>
<h:outputLabel for="kennwort" value="Kennwort:" />
<h:inputSecret id="kennwort" required="true" value="#{kundenHandler.kennwort}" />
<h:message for="kennwort"/>
<h:commandButton action="#{kundenHandler.login}" value="Anmelden" />
<h:panelGroup />
</h:panelGrid>
</h:form>
</f:view>
</body>
</html>
Mir ist bekannt, was der code 500 besagt. Ich weiß nun aber nicht, was er mit ein Fehler in Zeile 8 hat. Damit kann ich leider nichts anfangen.
Wäre klasse wenn mir da jemand helfen kann.
Danke!
Pichi