File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes preserving/locating java files created from JSPs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "preserving/locating java files created from JSPs" Watch "preserving/locating java files created from JSPs" New topic
Author

preserving/locating java files created from JSPs

Tyson Lindner
Ranch Hand

Joined: May 16, 2012
Posts: 172
I'm new to JSP, and am trying to follow along with a textbook in which we look at the differences between JSP files and the java files created from them. I'm using Tomcat and IntelliJ IDEA, both recent versions. Whenever I compile my project (which is just downloaded code from the textbook) everything works fine, I get accurate results in my browser. The problem is I can't for the life of me find the .java files that are supposedly created. It seems like they're supposed to be in the tomcat directory but they aren't, and I can't find them anywhere else and am coming up empty on windows search. So I'm thinking the files are getting deleted. So how would I stop this from happening?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60975
    
  65

Look in the work folder under wherever you installed Tomcat.

As a newcomer to JSP, you might also want to read this article.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60975
    
  65

Also, this one. it might be a bit advanced at the moment, but it should give a good idea where you should be heading, and you can bookmark it to read again later.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60975
    
  65

P.S. If you are running Tomcat under the IDE -- which I do not recommend -- it might be configured differently. But by default it creates the generated files under work.
Tyson Lindner
Ranch Hand

Joined: May 16, 2012
Posts: 172
Thanks for the links, yeah its not under work and doesn't seem to be anywhere else in my tomcat directory.

Other thought, is it possible for the java files to be saved/used as some other type of file?

edit: and I am running tomcat through the IDE :(
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60975
    
  65

Tyson Lindner wrote:Other thought, is it possible for the java files to be saved/used as some other type of file?

Like what?

edit: and I am running tomcat through the IDE

And this kind of nonsense is one of the reasons I don't recommend it. Too much IDE-specific goop and complexity.

I use IntelliJ as an advanced text editor and run a standalone version of Tomcat that I have complete control over.
Tyson Lindner
Ranch Hand

Joined: May 16, 2012
Posts: 172
Bear Bibeault wrote:
Like what?


I'll take that as a no.


And this kind of nonsense is one of the reasons I don't recommend it. Too much IDE-specific goop and complexity.


Yeah configuring IntelliJ to Tomcat seemed overly complex and I probably put it on some obscure setting by accident. Its not really urgent, so I'll probably just follow along with the textbook as best I can and use Tomcat separately whenever I try to build something myself.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60975
    
  65

To be honest, you are not missing much. It used to be more instructive to see the generated Java code, but in modern JSP engines, it ends up being mostly calls to container-specific methods that don't mean very much to the JSP author.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: preserving/locating java files created from JSPs