I am testing a web application (Apache Wicket Based) via Intellij IDEA Tomcat integration. There I noticed that the webapp consider its running in bin folder of the tomcat. Also when I called the ServletContext.getContext("/") it returns null. But when I deploy the same webapp manually in tomcat it works fine. How can solve this in Intellij IDEA?
How to deploy tomcat/webapps folder from IntellijIDEA
2.4k views Asked by andunslg At
2
There are 2 answers
0
Chaim Leib Halbert
On
In IntelliJ (I'm using Ultimate 2017), the context directory is set through File > Project Structure. Under the Web Resource Directories list, IntelliJ had filled in a path ending with /webapp by default, which didn't exist and was in red. I changed that to the folder enclosing my root-level index.jsp. After a rebuild, my JSPs were rendering and the CSS and JS (stored in the same tree as the JSPs) were loading perfectly.
Related Questions in TOMCAT
- Unable to compile the class for JSP in tomcat 8.5.95
- detect catalina.out log path from a running tomcat on non-Windows
- Tomcat 9.0.80 with Open JDK (JRE only) v16.0.2 crashing/unresponsive several times a day with load: Thread Count hits Max and All Threads are Busy
- JAX-RS webapp deployed to Tomcat returns HTTP 404 error while it works fine in Eclipse
- Illegal access: this web application instance has been stopped already. Could not load [org.apache.logging.log4j.message.SimpleMessage]
- File Upload Handling: Inconsistent HTTP Response Codes for Different File Sizes with Exception in Tomcat
- Don't get any public folder when deployment in svelte kit app
- Accessing solr web interface behind reverse proxy returns "Content Encoding Error"
- java.lang.UnsatisfiedLinkError: org.apache.tomcat.jni.SSL.renegotiatePending(J)I
- Cannot decrypt the password in application.yml properly if war file in the tomcat/webapps
- how to deploy mock json data api's(json-server) and angular 17 application in apache tomcat server 9 version
- version compatibility issue between spring boot, struts2-core and tomcat-embed-jasper in web application
- Is there any possibility to use JTA with Spring Framework 6 and Tomcat or Payara?
- Eclipse issue with publishing to Tomcat server
- null in Camunda variables
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 TOMCAT7
- I can't find server.xml?
- Tomcat crashes over a period of time when run 24/7
- Sending regular GET requests to Tomcat 7.0.x yields a 403 response for every other request - any idea why?
- Context.xml dont set environmet value
- I am trying to upgrade a soap based web service which is using tomcat 7 and jdk 1.7 to tomcat version 8.5 and same jdk version
- Getting HTTP/1.1 500 Internal Server Error in Tomcat 7 for requests having large pdf file
- org.apache.jasper.JasperException: org.apache.jasper.JasperException: java.lang.ClassNotFoundException: org.apache.jsp.WEB_002dINF.jsp.login_jsp
- Clone of AWS ElasticBeanstalk giving tomcat error on startup The AJP Connector is configured with secretRequired="true"
- Threads hang on getCallerClass (Native method)
- Exception loading sessions from persistent storage java.io.InvalidClassException: com.vaadin.server.AbstractClientConnector; local class incompatible:
- tomcat server 7 ssl was not enabeling
- Test performance between Tomcat BIO and NIO connectors
- Transative Dependency is not present, causing the app to fail with a Class Not Found error
- Startup times for different versions of tomcat
- JasperReport PDF displayed unrecognized binary after hardening Tomcat 7 web.xml
Related Questions in WICKET
- wicket/Jetty: avoid creation of new Http Sessions for liveness requests
- Missing form-action csp directive in CSPDirective
- Wicket 8: How to start a download and switch page/replace panel at the same time?
- Apache Wicket : How to do the mapping between checkbox and backend values right?
- Change CSS on AJAX request in Wicket throws exception in dev mode
- Problem with TinyMCE on Wicket when using addOrReplace
- ApacheWicket Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClas
- How to load Wicket CSS and Icon resources correctly?
- How to enable Apache Wicket debugging
- Working through examples, I don't see a MyBorder class in Navomatic Example
- Configure content security policy according to office uri scheme
- Wicket setResponsePage calls constructor multiple times
- How can I return different values in a FormComponent method?
- Accessing @ConfigurationProperties from Wicket
- Formatting of flash feedback messages in Apache Wicket
Related Questions in WICKET-1.5
- Apache wicket 7: how to add a behavior to a label inside enclosure?
- CSRF implementation in a Spring + Wicket project
- Is possible to add a javascript library from backend multiple time using wicket framework without refreshing the page?
- Add add same javascript file multiple time in single page using apche wicket framework. Is it possible?
- File upload issue if more than 2GB, request body exceeds maximum size (2147483647) for SSL buffer
- LoadableDetachableModel is not refreshed onSubmit and the model is removed from the page
- How to refresh label after changing color in wicket
- Multiple Buttons Link under the same column in wicket
- org.apache.wicket.protocol.http.PageExpiredException--On closing of modal window(window.close(target)) in apache wicket
- after selecting 'Choose one' in drop-down in wicket
- Handling simultaneous action
- Wicket 1.5 Servlet API dependency
- Display records in the read area of Screen
- Wicket: How to change contents of PageableListView dynamically?
- Java Wicket 1.5.6: File name on download is url encoded, converting spaces to plus signs
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?
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)

Ok. Let's try.
1) Create IntellijIdea project via WebApplication template. Idea should be Ultimate version, not Community edition
2) Go to Run-Edit configutaion and set up Tomcat location folder, so Idea will know about your tomcat server
3) Go to Deployment tab and select Artifact. Apply
4) In src folder put your servlet (you can try my example for testing purpose)
5) Go to web.xml file and link your's servlet like this
6) In web folder put your's .jsp files (for example hey.jsp)
7) Now you can start you app via IntellijIdea. Run(Shift+F10) and enjoy your app in browser:
- to jsp files: http://localhost:8080/hey.jsp (or index.jsp by default)
- to servlets via virtual link you set in web.xml : http://localhost:8080/st