FacesContext error and Tomcat

Out of interest to other users, I posted this thread in the Sun Java System Portal Server 6: http://forum.java.sun.com/thread.jspa?threadID=5182884&tstart=0

Seeing that I am getting a FacesContext error, and as I'm not sure that the previous forum was the correct area to voice my problem, I resorted to this forum. I do apologize if I have inonvenienced anyone. Again, if this is not the correct forum, please direct me to such. Thanks1

I have given my administrator the WAR file of my portlet which I developed and had him deploy it to Tomcat 5.5.17. However, when I tried to access the portlet, I got a javax.servlet.jsp.JspException, stating it cannot find FacesContext.

What can I do to resolve this error?

I tried accessing the portlet using the following syntax:

http://www3.servername:[port#]/username/PortletWelcomePage.jsp *

Is this the correct way? The point up to username/ is the URL my administrator said I should use. Is it correct to specify the portlet's initial page (using the.jsp extension) to activate the portlet?

I am using JDBC in my portlet, if that info is in any way needed.

Kind regards,

Reformer...

* - In other words, using a fictitious but quasi example,http://www3.fnl.ac.uk:8443/dsc065/PortletWelcomePage1.jsp

[1333 byte] By [da_wannabesa] at [2007-11-27 7:15:16]
# 1
I'm just guessing, but should you include the context root between the username/ part of the URL and the welcome page?
Illua at 2007-7-12 19:05:14 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Add a url-mapping on *.jsf for the FacesServlet and rename the URI's to *.jsf.
BalusCa at 2007-7-12 19:05:14 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

> Add a url-mapping on *.jsf for the FacesServlet and

> rename the URI's to *.jsf.

Forgive me, but although I am developing a grid portal using WS, and should be familarized with many technical details, I don't know what to make of what you advise. Don't get me wrong! I'm not lashing out at you, just asking you to explain in simpler terms exactly what it is I should do.

Thanks for the quick responses, and will be rewarding the appropriate adviser in due time.

Kind regards,

Reformer...

da_wannabesa at 2007-7-12 19:05:14 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
> ...but should you include the context> root between the username/ part of the URL and the> welcome page?I'll try that. Thanks!
da_wannabesa at 2007-7-12 19:05:14 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5

> Add a url-mapping on *.jsf for the FacesServlet and

> rename the URI's to *.jsf.

Should I do that before/after I create/hve created the WAR file? Remember also, i don't have direct access to the server and have to go through an administrator, who is not familiar with using Grid Portals or portlets, but oversees Tomcat (v5.5.17), the server i am hoping to run the app on.

Just letting you know should in case...

Kind regards

da_wannabesa at 2007-7-12 19:05:14 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 6

> > Add a url-mapping on *.jsf for the FacesServlet

> and

> > rename the URI's to *.jsf.

>

>

> Should I do that before/after I create/hve created

> the WAR file? Remember also, i don't have direct

> access to the server and have to go through an

> administrator, who is not familiar with using Grid

> Portals or portlets, but oversees Tomcat (v5.5.17),

> the server i am hoping to run the app on.

Do you that in your WAR file configuration. You need to find a basic tutorial on JSF and take a look.

RaymondDeCampoa at 2007-7-12 19:05:14 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 7

I think what Balus means is that you should include some code like below to your web.xml in your faces application. Then navigate to your files with a .jsf extension instead of a .jsp one so that the faces servlet will handle it.

<servlet>

<servlet-name>Faces Servlet</servlet-name>

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

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

</servlet>

<servlet-mapping>

<servlet-name>Faces Servlet</servlet-name>

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

</servlet-mapping>

Illu

Illua at 2007-7-12 19:05:14 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 8

> I think what Balus means is that you should include

> some code like below to your web.xml in your faces

> application.

As my code is nowhere near me, I'll attend to it later and respond with my comments and hopefully appropriate the points accordingly.

Kind regards

Reformer

PS In the emantime, does anyone know how to reward points to multiple posters?

da_wannabesa at 2007-7-12 19:05:14 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...