Forward to a faces jsp page doesn't work via servlet

I get Null pointer exception when I am trying to forward to a faces jsp page from a servlet. In the servlet, I am using RequestDispatcher method

RequestDispatcher rd;

rd = getServletContext().getRequestDispatcher("/Test.jsp");

rd.forward(req, res);

First I forwarded to a jsp page which had content in it from database and I thought it resulted in Nullpointer but now I created a fresh new faces jsp file Test.jsp, with just a small sentence in it and even then I get nullpointer exception.

Is it something to do with the web.xml?

Thanks for any help

[619 byte] By [slata] at [2007-11-27 8:45:14]
# 1
You need to forward through the FacesServlet.
rlubkea at 2007-7-12 20:46:18 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

Do you mean adding the foll. code in web.xml. I already did that. If there is anything else, can you please let me know

Thanks

<servlet>

<servlet-name>faces</servlet-name>

<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>

<load-on-startup>1</load-on-startup>

</servlet>

<servlet-mapping>

<servlet-name>faces</servlet-name>

<url-pattern>*.faces</url-pattern>

</servlet-mapping>

slata at 2007-7-12 20:46:18 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
Given the mapping you have put in your web.xml, you need to redirect to the page "/Test.faces" not "/Test.jsp".
RaymondDeCampoa at 2007-7-12 20:46:18 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4

I'll try to help here, maybe you can use:

ExternalContext externalContext = getFacesContext().getExternalContext();

HttpServletRequest request = (HttpServletRequest) externalContext.getRequest();

HttpSession session = request.getSession();

String myUrl = externalContext.getRequestContextPath() + "/test.faces";

externalContext.redirect(myUrl);

iamleia at 2007-7-12 20:46:18 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...