Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Servlet context path with more than one slash not working #19807

Closed
TheRealHaui opened this issue Sep 22, 2022 · 2 comments
Closed

Servlet context path with more than one slash not working #19807

TheRealHaui opened this issue Sep 22, 2022 · 2 comments

Comments

@TheRealHaui
Copy link

TheRealHaui commented Sep 22, 2022

Setting a servlet context path containing more than one slash leads the entire application to not work anymore.

When setting

server:
  servlet:
    context-path: /dir/subdir

in the application-dev.yaml file and setting

[        new HtmlWebpackPlugin({
          template: './src/main/webapp/index.html',
          chunksSortMode: 'auto',
          inject: 'body',
          base: '/dir/subdir',
        }),](url)

in the webpack.common.js file like described in the official documentation the entire application goes out of order.
Currently React is in use for the web layer.

Obviously web resources like index.html do not get found by the Browser anymore because of obviously wrong directoy/path structures used then.
I suspect it a problem with parsing because of the second slash in any internally used library.

JHipster info:

_Welcome to JHipster v7.8.1

Welcome to the JHipster Information Sub-Generator

JHipster Version(s)
[email protected] xxxxxxxxxxxxxxxxxxx
└── [email protected]

JHipster configuration, a .yo-rc.json file generated in the root folder
.yo-rc.json file
{
  "generator-jhipster": {
    "applicationType": "monolith",
    "authenticationType": "jwt",
    "baseName": "test",
    "blueprints": [],
    "buildTool": "maven",
    "cacheProvider": "no",
    "clientFramework": "react",
    "clientPackageManager": "npm",
    "clientTheme": "none",
    "clientThemeVariant": "",
    "creationTimestamp": 1663778902672,
    "databaseType": "sql",
    "devDatabaseType": "h2Disk",
    "devServerPort": 9060,
    "dtoSuffix": "DTO",
    "enableGradleEnterprise": false,
    "enableHibernateCache": false,
    "enableSwaggerCodegen": false,
    "enableTranslation": false,
    "entitySuffix": "",
    "jhiPrefix": "jhi",
    "jhipsterVersion": "7.8.1",
    "jwtSecretKey": "YourJWTSecretKeyWasReplacedByThisMeaninglessTextByTheJHipsterInfoCommandForObviousSecurityReasons",
    "languages": ["en", "fr"],
    "messageBroker": false,
    "nativeLanguage": "en",
    "otherModules": [],
    "packageName": "com.test",
    "pages": [],
    "prodDatabaseType": "postgresql",
    "reactive": true,
    "searchEngine": false,
    "serverPort": "8080",
    "serverSideOptions": [],
    "serviceDiscoveryType": "no",
    "skipCheckLengthOfIdentifier": false,
    "skipFakeData": false,
    "skipUserManagement": false,
    "testFrameworks": [],
    "websocket": false,
    "withAdminUi": true
  }
}
JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory
JDL entity definitions

Environment and Tools

openjdk version "11.0.13" 2021-10-19
OpenJDK Runtime Environment (build 11.0.13+8-Ubuntu-0ubuntu1.18.04)
OpenJDK 64-Bit Server VM (build 11.0.13+8-Ubuntu-0ubuntu1.18.04, mixed mode, sharing)

git version 2.17.1

node: v16.14.2

npm: 8.5.0

Docker version 20.10.17, build 100c701

docker-compose version 1.17.1, build unknown

No change to package.json was detected. No package manager install will be executed._

@mheidt
Copy link

mheidt commented Mar 23, 2023

I can't confirm.
It works with two slashes for 7.9.3 if you apply the following fix:
#21534

I am not talking about additional features like swagger though. But I couldn't make those work for one-slashed context-paths anyways.

@DanielFran
Copy link
Member

Closing this issue since servlet context path have been fixed in main branch.
Please reopen in case the issue remain

@deepu105 deepu105 added this to the 8.0.0-beta.3 milestone Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants