Java code - source code search

I have this Java code that was written by another person, in particular JSP. I'm trying to figure out where everything is.

In my index.jsp (loadable main file) it imports a specific namespace (I suppose tomcat does all the compilation, I don't know):

 <%@ page import="org.sgrp.SearchResults"%> 

This physical location does not exist in my CLASSPATH, so I believe this refers to the namespace inside the .jar code structure (correct me if I am wrong).

So how can I find the source code for this? Does Tomcat set a specific CLASSPATH location for each project?

EDIT

I'm trying to figure out if Tomcat should follow a specific structure, so I can find where the source code for this stuff is.

+6
java jsp tomcat
source share
5 answers

From the point of view of the Internet, downloading applications, classes or resources looks in the following repositories, in the following order:

 * Bootstrap classes of your JVM * System class loader classes * /WEB-INF/classes of your web application * /WEB-INF/lib/*.jar of your web application * $CATALINA_HOME/lib * $CATALINA_HOME/lib/*.jar 

from Tomcat docs .

The most likely class locations specific to your application are WEB-INF/lib/*.jar and WEB-INF/classes . However, as others have noted, this will contain compiled class files, and you wont be able to see the exact source of java (even after decompilation)

+6
source share

banks are compressed with javabyte code. To get sources, you have to decompile them. There are several utilities, but working with decompiled code is a bit of a nightmare, if you ask me, I would not recommend it, especially if you did not know it yet .: D

The source code will usually be stored elsewhere.

As for your specific questions about Tomcat, I don't know, never before working with Tomcat.

+1
source share

You can search banks in two places:

  • /web-inf/lib directory (it has all the user banks used by the application)
  • Assembly file (mvn, ant, etc.)
+1
source share

The source code may not be available at all. So, first of all, you need to find which jar this particular imported class has. Then just search the web for the project / API website. There you can search for a source if its an open source library. Otherwise, decomposition will be the only option, and this may not be very useful.

+1
source share

the class, in my experience, is usually set in the ant build file of each project

0
source share

All Articles