I have a project using Jakarta EE and I'm trying to set a contextual path, but I can't do it. When setting the context path in the web.xml, everything works the same as without it. If you try to get it through ServletContext.getContextPath(), then outputs an empty string. I attach screenshots web.xml file, jsp file and project structure.web config, jsp, structure
How to set context path of web application in IntelliJ IDEA
327 views Asked by Сева Касатчиков At
1
There are 1 answers
Related Questions in INTELLIJ-IDEA
- Gradle 8.7 cannot find installed JDK 22 in IntelliJ
- LiveTemplate for TODO shortcut seems not working
- Jetbrains Intellij Works but Fleet does not : "is not recognized as an internal or external command, operable program or batch file."
- Why is there no help text when i write "." in IntelliJ?
- How to enable Kotlin REPL autocomplete
- Selenium error: SessionNotCreatedException | Java, Firefox, everything is updated and should be compatible
- Ubuntu-22.04 File watcher failed repeatedly and has been disabled (External file changes sync might be slow)
- IntelliJ Typescript NoSuchElementException
- I am trying to use h2 in-memory db from my spring boot application, my spring boot version is 3.1.10, but its not connecting to h2 properly
- Is there a new way to undo and redo in the new version of intelliJ
- How to debug a Kotlin/Native application in IntelliJ?
- Why rebuild module does not recompile dependency module, but build module does in IntelliJ Idea?
- Intelij ultimate and spring boot giving me errors
- Minecraft Mod not adding content
- In IntelliJ IDEA Community Edition, can you generate a dependency tree for Maven projects?
Related Questions in SERVLETS
- java ee jdbc jstl servlet connection to db
- IOException parsing XML document from ServletContext resource What throws this exception in my SpringBoot RESTweb service?
- How can i connect my 4 objects in my jsp file so it can run perfectly
- Best Practice to skip URL pattern's from getting applied servlet filter
- How to accurately replace scripts / html before saving data from servlet to database
- Servlet not displaying data obtained from dao
- flutter Multipart file upload server side error: Unable to process parts as no multi-part configuration has been provided
- Read an image file using okhttp3.RequestBody in java and send it to client using HTTPServletResponse
- Unexpected servlet config parameter contextConfigLocation=<NONE>
- The servlets named [ClassName] and [com.example.ClassName] are both mapped to the url-pattern [/ClassName] which is not permitted
- How to Use an External JAR Offline in a Maven Project for Servlets Without Internet Access?
- session.invalidate() is sometimes not working and not destroying the session object. What should I do?
- Database ConnectionError
- In a web.xml, can the url-pattern of servlet-mapping containing more than one path component? (e.g. /path/to/*))
- How to update the resource property using the valuemap in the Sling servlet?
Related Questions in CONTEXTPATH
- How to set context path of web application in IntelliJ IDEA
- How to run the multiple react applications in a single port by Nginx with docker
- Change context path in a Spring MVC application + Tomcat
- Map controllers under a different context than actuator
- JHipster context path with two slashes
- How to align Spring Boot context path with Apache Camel context path?
- String Boot application is not loading when hitting URL with capital letter server.servlet.contextPath value
- Dynamic Context path causes issue when using path variable in spring boot
- How to have custom context Path for Swagger Url in OpenApi3 Springboot Application
- Open API (Swagger) non working in Spring Boot when adding context path
- SpringBoot having different root context-path for mvc and static files
- Spring Boot context-path doesn't return index.html in tests
- Angular: serving application on custom context-root with npm start on localhost
- Running my JSP page on Tomcat in Eclipse. Where is the problem?
- SpringBoot adds context path to Actuator endpoints
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Popular Tags
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
According to the documentation:
Which means the root context path is determined by the application server when the web application is deployed. If you do not deploy a WAR file but rather try to run the project using the embed server(tomcat etc), you can not directly set the root context path of the application in the web.xml file. Rather set it in either
application.propertiesorapplication.ymlfile like thisWhen you are deploying a WAR file in servers like GlassFish or JBoss, you have to add server-specific files in the
WEB-INFfolder.jboss-web.xmlsun-web.xmlThen in the
jboss-web.xmlfile add the following configurationNow you can access API by appending context root at the beginning.