Skip to main content



      Home
Home » Newcomers » Newcomers » Java class files for tomcat, where?(Web server development learning issue.)
Java class files for tomcat, where? [message #1735581] Tue, 21 June 2016 06:11 Go to next message
Eclipse UserFriend
Learning web server programming (java, tomcat) using the tutorial found on jsptut.com. When I come to 'Beans and Forms Processing' I run into trouble: Where in the project should I store the java class UserData.java definition file? And how to compile it within Eclipse? Finally, where should teh UserData.class file go?

A working solution found by trial-and-terror is to store the .java file under Java Resources/src/<package name>, mark the .java file and hit Run. This creates a .class file in the build/classes/<package name> directory. I copy this .class file to WEB-INF/classes and restart the server.

I run Eclipse Mars.2, JDK 1.8 and Tomcat 8 on a CentOS 6 host.

/jason
Re: Java class files for tomcat, where? [message #1735612 is a reply to message #1735581] Tue, 21 June 2016 08:33 Go to previous messageGo to next message
Eclipse UserFriend
It's probably better to ask on the Web Tools forum. Maybe this helps:

http://stackoverflow.com/questions/30905947/how-to-compile-and-run-a-jsp-beans-project-using-eclipse


On 21.06.2016 08:22, Jens Andersson wrote:
> Learning web server programming (java, tomcat) using the tutorial
> found on jsptut.com. When I come to 'Beans and Forms Processing' I run
> into trouble: Where in the project should I store the java class
> UserData.java definition file? And how to compile it within Eclipse?
> Finally, where should teh UserData.class file go?
>
> A working solution found by trial-and-terror is to store the .java
> file under Java Resources/src/<package name>, mark the .java file and
> hit Run. This creates a .class file in the build/classes/<package
> name> directory. I copy this .class file to WEB-INF/classes and
> restart the server.
>
> I run Eclipse Mars.2, JDK 1.8 and Tomcat 8 on a CentOS 6 host.
>
> /jason
Re: Java class files for tomcat, where? [message #1735740 is a reply to message #1735612] Wed, 22 June 2016 07:24 Go to previous message
Eclipse UserFriend
Ed Merks wrote on Tue, 21 June 2016 12:33
It's probably better to ask on the Web Tools forum.


Maybe. Actually I have found at least one working solution: When creating a new class in the package folder, the type should be Servlet, not Class. Another workaround (if type is set to class) is to copy the .class file (found in the build folder) to the WEB-INF/lib folder.

Any comments on that are most welcome.

Quote:

Maybe this helps:

http://stackoverflow.com/questions/30905947/how-to-compile-and-run-a-jsp-beans-project-using-eclipse


Seams to me like another problem.

/jason

[Updated on: Wed, 22 June 2016 07:25] by Moderator

Previous Topic:Regexp MULTILINE mode to find & delete a multi line XML stanza
Next Topic:Unfortunately (app name), Stopped.
Goto Forum:
  


Current Time: Mon Jul 21 13:48:11 EDT 2025

Powered by FUDForum. Page generated in 0.27499 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top