This week's giveaway is in the JDBC forum.
We're giving away four copies of Java Database Connections & Transactions (e-book only) and have Marco Behler on-line!
See this thread for details.
Win a copy of Java Database Connections & Transactions (e-book only) this week in the JDBC forum!
  • 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
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

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

 
Ranch Hand
Posts: 511
  • 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: 5508
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: 511
  • 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?
 
Bartender
Posts: 20777
124
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: 511
  • 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: 2595
328
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
Bartender
Posts: 20777
124
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.
 
I got this tall by not having enough crisco in my diet as a kid. This ad looks like it had plenty of shortening:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!