Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

web.xml Welcome File issue - Tomcat 5

Status
Not open for further replies.

delaro

Programmer
Dec 12, 2002
6
US
This is killing me.

I have a directory called portal in my webapps dir with a file default.jsp(my home file). I have the web-inf folder and my web.xml file inside. All good. Now, when I goto localhost/portal. I get a web page with "null" and a NullPointer Exception in my shell, but if I goto to localhost/portal/default.jsp all is good. It must be the web.xml file. I don't want to change to index.jsp and I already tried adding default.jsp to the web.xml in the conf dir.

Here is what I have:

<?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot; ?>
<!DOCTYPE web-app (View Source for full doctype...)>

<web-app>
<display-name>Portal</display-name>
<description>Portal</description>

<welcome-file-list>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>

</web-app>
 
tried this below, still Null on the web page when loading localhost/portal

<?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?>

<!DOCTYPE web-app
PUBLIC &quot;-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN&quot;
&quot;
<web-app>
<session-config>
<session-timeout>30</session-timeout>
</session-config>

<servlet>
<servlet-name>portal</servlet-name>
<servlet-class>portal</servlet-class>
<display-name>portal</display-name>
<description></description>
</servlet>
<servlet-mapping>
<servlet-name>portal</servlet-name>
<url-pattern>/portal</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>

</web-app>
 
Ahh, seems to be an issue with the jsp. I set the welcome file to a test default.html and it works. Any ideas?
 
I would say that your problem maybe this - your context is named &quot;portal&quot; but you have also mapped a servlet named &quot;portal&quot; to the url pattern &quot;/portal&quot; - so Tomcat maybe getting confuesed between the context and servlet mapping ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top