# Servlet



## mayer (4. Aug 2005)

Wie rufe ich durch einen Link in meiner JSF-Seite ein Servlet auf.

web.xml:


```
<?xml version = '1.0' encoding = 'windows-1252'?>
<web-app 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" xmlns="http://java.sun.com/xml/ns/j2ee">
  <description>Empty web.xml file for Web Application</description>
  <servlet>
    <servlet-name>Test-Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet>
    <servlet-name>EbBelegungReport</servlet-name>
    <servlet-class>Reports.EbBelegungReport</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>Test-Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
  </servlet-mapping>
</web-app>
```


jsf-seite:


```
<h:outputLink styleClass = "druckenlink" value = "EbBelegunfgReport">
          <h:outputText value="Drucken"/>
          <f:param name="lfbis" value="#{betrieb.lfbis}"/>
</h:outputLink>
```


Kann mir sagen wie das geht ??

Fehler:

500 Internal Server Error
java.lang.NullPointerException	at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)	at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)	at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)	at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)	at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)	at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) - Developer Preview 3].server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:61)	at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)	at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) - Developer Preview 3].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:672)	at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) - Developer Preview 3].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:378)	at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) - Developer Preview 3].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:869)	at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) - Developer Preview 3].server.http.HttpRequestHandler.run(HttpRequestHandler.java:288)	at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) - Developer Preview 3].server.http.HttpRequestHandler.run(HttpRequestHandler.java:120)	at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) - Developer Preview 3].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:299)	at java.lang.Thread.run(Thread.java:534)


mfg manuel


----------



## Bleiglanz (4. Aug 2005)

wird das zu einem relativen Link - siehst du beim drüber fahren mit der maus? dürfte nicht gehen wenn vorne /faces/ steht

schreib lieber beim link value = "/EbBelegunfgReport"


----------



## mayer (4. Aug 2005)

Hab den Fehler schon endeckt:

anstatt:
 <hutputLink styleClass = "druckenlink" value = "EbBelegunfgReport"> 

gehört
* <hutputLink styleClass = "druckenlink" value = "faces/servlet/EbBelegunfgReport"> *

mfg manuel


----------

