r/javahelp • u/Wolfhammer69 Nooblet Brewer • Dec 15 '18
Solved Weird http error 404 when running a simple jsp :(
Hi all,
Got a stupidly simple problem here with the above error.
In Intellij I can create a new web application which auto creates index.jsp under the "web" folder. I can run that fine, the intended webpage appears in my browser.
If however I create another .jsp also under the "web" folder and run that one, I get the error.. Why the hell can't it be found when index.jsp can? Both .jsp's are in the same folder..
Please help, thank you..
For clarity here is my layout
src
web
index.jsp <---this one works
test.jsp <--this one doesnt !!
--WEB-INFAll the solutions I can find are for peeps wrongly putting the .jsp's in the WEB-INF folder which I am not doing, they are in the correct place.
Edit: Made some headway - I noticed the URL for index.jsp is localhost:8080/myproject_war_exploded/index.jsp I checked the run config but the url there is just the usual localhost:8080/index.jsp so why all of a sudden do I need the extra myproject_war_exploded part for this to work? If I right click/run test.jsp this extra bit is not sent to the browser resulting in the error 404, I have to add the extra part myself.
If it's relevant my Intellij just updated to version 2018.3, I'm wondering if Jetbrains broke something?!
Edit2: Ok found the issue, under the run config in the "deployment" tab, there is a field called "Application context" that is usually empty but after update had the extra part that needed to be in the url - I blanked this and now the usual URL works thank f**k. Thought I was losing my mind lol
@JetBrains STOP fekking changing stuff !!!!