Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Frits Walraven
Bartenders:
  • Carey Brown
  • salvin francis
  • Claude Moore

How do I run maven-based web app JSP?  RSS feed

 
Ranch Hand
Posts: 491
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This question should appear stupid but really i just can't run my jsp page after did the proper maven configuration.

When I start my tomcat, it just gives me a HTTP 404 error and said the resources are not found.

I hope someone can tell me what could be the cause.

Another strange thing is, now after started tomcat, when I right click on the jsp, Eclipse just shows run configuration, and the usual run java Application is missing.

BTW, I did not add in other java classes and other mvc stuff cos I just want to see if the bootstrap template will render on the jsp.

Hope to get some advice here.

Tks.
 
Saloon Keeper
Posts: 5389
143
Android Firefox Browser Mac OS X Safari Tomcat Server VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the Maven angle on this? Maven would just create the war file, which you would then deploy. It isn't involved at runtime.

What we need to know is what URL you're trying to access, and how the resource behind it is mapped.
 
tangara goh
Ranch Hand
Posts: 491
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Managed to resolve this.

But, I find it puzzling cos I have to pull out all the Bootstrap template's css font etc and put it under src/main/webapp, along with all the jsps.  It is just not able to work with all these files placed in a Bootstrap folder and reference from there, even though it is also under the same directory - src/main/wepp.

Any idea Tim?
 
Saloon Keeper
Posts: 20635
122
Android Eclipse IDE Java Linux Redhat Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this for a stand-alone Tomcat, or a Spring Boot Tomcat?

Not that I expect that much difference, but obviously there's some - Spring Boot webapps are self-deploying.
 
tangara goh
Ranch Hand
Posts: 491
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Tim Holloway wrote:Is this for a stand-alone Tomcat, or a Spring Boot Tomcat?

Not that I expect that much difference, but obviously there's some - Spring Boot webapps are self-deploying.



This is using stand-alone Tomcat, and here's a snippet of the .war file generated by Maven :

Please find attached.

I wonder if it is correct ?

.war-how-bootstrap-files-appear.jpg
[Thumbnail for .war-how-bootstrap-files-appear.jpg]
 
Saloon Keeper
Posts: 2504
321
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rather than opening the war file in the editor as a text file, use the jar command from the command line to show the contents of your war file

For example:
 
Tim Holloway
Saloon Keeper
Posts: 20635
122
Android Eclipse IDE Java Linux Redhat Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think that your Bootstrap files should go directly under /src/main/webapp, but that's just an intelligent guess, since I don't know the product.

Your screenshot doesn't show any JSPs at all, so we can't tell. Also we'd need to know what the URL is that you are using to try and get the JSP.

The best way to list the index of your WAR is to use the JAR utility program to list the JAR directory and copy/paste the text from that listing between Code tags in our message editor. Raw graphic snapshots can be very hard to read.
 
If we don't do the shopping, we won't have anything for dinner. And I've invited this tiny ad:
Create Edit Print & Convert PDF Using Free API with Java
https://coderanch.com/wiki/703735/Create-Convert-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!