You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by "John Neffenger (Jira)" <ji...@apache.org> on 2020/01/31 16:32:00 UTC

[jira] [Commented] (NETBEANS-2835) Assign context equal to project name in newly created Gradle Web Application projects

    [ https://issues.apache.org/jira/browse/NETBEANS-2835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17027646#comment-17027646 ] 

John Neffenger commented on NETBEANS-2835:
------------------------------------------

I thought the _context.xml_ file, if any, goes under the _META-INF_ directory. See [The Context Container|https://tomcat.apache.org/tomcat-9.0-doc/config/context.html].

I'm looking into this now because it seems the latest Tomcat 8 and 9 changed something that's breaking the NetBeans deployment with Ant projects. Tomcat now requires that there be no {{path}} attribute in the {{Context}} element defined by the _context.xml_ file embedded in an application. On that page, it says:

{quote}Consequently, the context path may not be defined in a META-INF/context.xml embedded in the application ...{quote}

and further down where it defines the {{path}} attribute:

{quote}This attribute must only be used when statically defining a Context in server.xml. In all other circumstances, the path will be inferred from the filenames used for either the .xml context file or the docBase.{quote}

In fact, in a NetBeans Ant project, Tomcat actually fails to set up the webapp classpath correctly when the {{path}} attribute is present. If I delete the {{path}} in the _context.xml_ file, leaving the {{docBase}}, it works.


> Assign context equal to project name in newly created Gradle Web Application projects
> -------------------------------------------------------------------------------------
>
>                 Key: NETBEANS-2835
>                 URL: https://issues.apache.org/jira/browse/NETBEANS-2835
>             Project: NetBeans
>          Issue Type: Improvement
>          Components: projects - Gradle Java EE
>    Affects Versions: 11.1
>            Reporter: Alessandro Falappa
>            Assignee: Laszlo Kishalmi
>            Priority: Minor
>
> Newly created Gradle Web Application projects have by default an empty context path inĀ {{src/main/webapp/WEB-INF/context.xml}}:
> {code:xml}
> <?xml version="1.0" encoding="UTF-8"?>
> <Context path=""/>
> {code}
> I think it would be better to use the project name prepended with a slash.
> {code:xml}
> <?xml version="1.0" encoding="UTF-8"?>
> <Context path="/project-name"/>
> {code}
> This is more consistent with the analogous maven web application project and moreover it is a saner default when multiple projects are deployed on the same application server.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists