This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 20923 - Context Root of "/" does not work
Summary: Context Root of "/" does not work
Status: VERIFIED FIXED
Alias: None
Product: serverplugins
Classification: Unclassified
Component: Tomcat (show other bugs)
Version: -FFJ-
Hardware: All All
: P3 blocker (vote)
Assignee: Milan Kuchtiak
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-02-27 02:00 UTC by jhoffman
Modified: 2006-02-20 09:34 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jhoffman 2002-02-27 02:00:28 UTC
Setting the context root on the web module to "/" causes problems when attempting to
execute the web module.  This worked previously with Tomcat 3.2.

For example, attempting to execute a web module with the structure:

mywebmodule
   parameters
        Input.jsp

Displays "http://localhost:8081/" which is correct, but when the "parameters" folder link
is clicked on, the URL in the browser's Location field becomes "http://parameters/" which
causes a 404 error.
Comment 1 Milan Kuchtiak 2002-02-27 15:08:59 UTC
Tomcat cuts the ending "/" in context URI in these cases :

- when user executes or deploys a Web module on Tomcat4.0
- in Add Context action (on Tomcat's host node)
- when user changes path attribute on Tomcat's context node

Fixed for ORION FCS.
Comment 2 Mikhail Romanov 2002-03-16 03:58:40 UTC
However it still doesn't work on some versions of
external TC (I have 4.0.2) with "" (blank) context.
Seems that suitable solution is to use "/" for blank context.

How to reproduce:
1. Deploy webmodule with some
   HTML file in the top directory (on the same level as WEB-INF) to
   the blank context
2. Open http://localhost:8081/ in the browser and click on the HTML 
file - notice that it tries to open http://<HTML file> host rather 
than http://localhost:8081/<HTML file>
Comment 3 Milan Kuchtiak 2002-03-19 15:31:14 UTC
Look at the thread about the context path (ffj-iteam-webapps).

Ana said that there are these costraints for the context path :

1. context path isn't defined (Default path - "")
2. context path should start with "/"
3. context path shouldn't end with "/"

Web module property "Context Root" should accept these constraints, 
as well as the "path" attribute of the <Context> element in the 
server.xml file.

I am going to fix this issue according to this principle.
Comment 4 Milan Kuchtiak 2002-03-19 17:05:13 UTC
Now the URI strings for :

- servlets
- web module
- web module group
- Tomcat4.0 context paths

are uniformly checked with the method WebExecUtils.isUriString(String 
uri)

The method body was made according to the "context path" thread on 
ffj-iteam-webapps mailing list.
Comment 5 Jaroslav Pospisil 2006-02-20 09:34:56 UTC
VERIFIED