• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Importing and running legacy app

 
Ranch Hand
Posts: 78
Android Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've imported an older web app from SVN into eclipse that looks to be mostly JSP and servlets. Initially the project only had three folder, branches, tags and trunk. I went into project settings -> project facets and enabled Dynamic Web Module, Java, and Javascript which appears to have modified the project structure from just the 3 folders to now showing several others, Java Resources, Javascript Resources, etc.

Now I can right click the main project and select Run As -> Run On Server and Tomcat recongizes it but nothing comes up.

I'd like to learn everything I can about this tech stack, I know the app is probably at least 10 years old. Any suggestions/resources on best how to get it up and running?

 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This isn't about JSP or servlets technology per se, but with the eclipse IDE, so this has been moved to a more appropriate forum. None of those folders have anything to do with other than the IDE imposing a structure on your project.
 
Saloon Keeper
Posts: 27816
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is one of the reasons I really despise the "built in" Tomcat plugin that comes with the JEE spin of Eclipse.

I actually don't use the "Dynamic Web Project" feature myself. Largely because I've never seen a decent into the thing, but also because I do well enough with the basic Eclipse project form. Often augmented by Maven.

I'm thinking that actually you only use the trunk part of the SVN project as your Eclipse project base, but it has been quite a few years...
 
Brian Barrick
Ranch Hand
Posts: 78
Android Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Holloway wrote:This is one of the reasons I really despise the "built in" Tomcat plugin that comes with the JEE spin of Eclipse.

I actually don't use the "Dynamic Web Project" feature myself. Largely because I've never seen a decent into the thing, but also because I do well enough with the basic Eclipse project form. Often augmented by Maven.

I'm thinking that actually you only use the trunk part of the SVN project as your Eclipse project base, but it has been quite a few years...



I've been working in PHP with a modern framework for the past few years. And recently volunteered to learn Java and work on this project - I'm struggling to get it up and running though.  I started off learning Spring Boot thinking it was an old Spring project but when I saw the code and realized there's no pom.xml or anything as far as I can tell that describes dependencies I wasn't sure where to go from there.
 
Tim Holloway
Saloon Keeper
Posts: 27816
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is there a "build.xml" file? If so, it may be an Ant project.

Projects before Maven or Ant+Ivy were on their own when it came to dependencies. You either had to include them manually as part of the project or know what they were and copy them in by hand.
 
Brian Barrick
Ranch Hand
Posts: 78
Android Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Holloway wrote:Is there a "build.xml" file? If so, it may be an Ant project.

Projects before Maven or Ant+Ivy were on their own when it came to dependencies. You either had to include them manually as part of the project or know what they were and copy them in by hand.



No build.xml - but there is a web.xml.

I'm thinking this is a fairly simple setup, maybe I just need to figure out how to tell tomcat to look for resources in the WebContent folder...
 
Tim Holloway
Saloon Keeper
Posts: 27816
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Brian Barrick wrote:
I'm thinking this is a fairly simple setup, maybe I just need to figure out how to tell tomcat to look for resources in the WebContent folder...



No, that's now how you do it.

Tomcat, like all JEE webapp servers is based on webapps, which are packaged as WARs. Technically, a WAR is a Web ARchive, which is a specialized form of java JAR file, which is itself a specialized form of ZIP file. That means that your build process has to construct a directory structure that meets the specifications of a WAR.

Tomcat by default "explodes" (unzips) WAR files when deploying webapps, and in fact, will even take them pre-exploded, but regardless, Tomcat still requires each deployed webapp to have a proper WAR structure, such as having a /WEB-IND/web.xml file to define things such as servlet URL mapping, the "welcome" page, URL security and so forth, although many of those things can now alternatively be supplied in Java source code annotations. Still, a WAR's loose classes must be located in /WEB-INF/classes and any application-specific libraries are placed in /WEB-INF/lib. Tomcat doesn't accept stuff just randomly plunked down in any format anywhere, and that includes in the TOMCAT_HOME/webapps directory. That directory doesn't contain "an" app, it contains one or more deployed WARs, each in its own .war file or directory. So no, Tomcat does not "look for" stuff, it has places where it expects to find stuff and that stuff must be properly organized.

As far as it goes, the Eclipse "web project" does, when properly set up, assist in getting the right stuff in the right configuration to Tomcat, but as I said, the WTP plugin that works with that is so horrible that I gave up on trying to use it. Which means, alas, that my ability to help on that part is very limited.
 
reply
    Bookmark Topic Watch Topic
  • New Topic