You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Steve Ingraham <si...@okcca.net> on 2007/02/06 20:41:44 UTC

Need help finding a Java class

I am not sure if I am asking the right group of people but I need some
assistance with a problem finding where a specific output in a web
application is coming from.  I have inherited this system so please be
aware that I am not too familiar with this application nor am I really
too familiar with how Tomcat operates.  Let me explain if I can.  I
don't know how much detail is needed to explain my problem so if I leave
something out please let me know what further information I can provide.
 
I am managing a MySQL database that has a web front end that was
developed in Java and is running in Tomcat.  The front end allows our
users to input data into the MySQL database fields.  The problem I am
currently dealing with involves the input of an assigned person to the
case on the screen.  There is a link that if clicked on will take the
user to a page where they can choose a person from a dropdown list.
Once they assign the person to a case that name will show up on the main
page as the assigned person for the case and a record is created in a
table called ASSIGN in the database.
 
My problem is this.  If a person is assigned there is a record created
in the ASSIGN table with a primary key (ASSIGN.ID) and the subsequent
information for that assignment.  In a normal assignment I can see the
ASSIGN.ID and other pertinent ID data in the address field of the web
browser while viewing that case or if I hover the mouse over the name
field for the assigned person.  If no person is assigned to the case the
phrase "NO ASSIGNMENT" shows up on the front page of the application
where the person's name should have been and there is no record created
in the ASSIGN table in the MySQL database for the case and subsequently
no ASSIGN.ID that shows up in the web browser for that case.
 
I am attempting to create a report that will return all instances where
a person has not been assigned to a case.  There is nothing in the
database in any fields that the NO ASSIGNMENT phrase is related to so in
attempts to do a query on any tables of the database is not returning
the data I need.  So my thoughts are that there must have been something
coded in the application that tells it to return the phrase NO
ASSIGNMENT if an ASSIGN record was not created.  I have been trying to
track down within the code for the web page where this NO ASSIGNMENT
phrase is coming from in hopes of understanding how the application
knows to return this statement.  My theory is that if I can see how the
application is returning this I can figure out how to query the database
to show me all instances where this has occurred.
 
Can someone give me some direction on where I can search for this type
of code?  There is a Java class titled "occadefault" where I have been
trying to look but I cannot as of yet find where that class resides.  If
it is of any help, below is the source code for this particular section
of the page that is returning the NO ASSIGNMENT phrase on one particular
case.  I have noted that at the end of the <a href=. . . line just
before the phrase "NO ASSIGNMENT" there is no reference to an ID number.
In the case where a person is assigned the line would end with ". . .
caseMasterId=95972&amp;id=89417"> (the bold text is an example of the
number that would appear).
 
    <form name="none" method="post" action="/occa/model.do"><div
id='caseAssigned' >        
            <table cellspacing="0" cellpadding="2" border="0">
                <tr>
                    <td class="occalabel">
                        
                        Judge Assigned:&nbsp;
                    </td>
                
                    <td class="occadefault">

                             <a
href="/occa/model.do?model=oscn.seq.prompt-Assignment&amp;assignType=1&a
mp;data=95972&amp;caseMasterId=95972">
NO ASSIGNMENT</a></td>
                    <td>&nbsp;&nbsp;</td>
If this question is better answered outside the Tomcat community please
let me know and I will not waste your time any further.  Thank you in
advance for any assistance you can provide.
Steve
 

Re: [OT] Need help finding a Java class

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Steve,

This might be off-topic, but there's really not a good forum for
"general webapp what-the-heck-is-going-on discussion". But hey, we're
nice folks ;)

Steve Ingraham wrote:
> If no person is assigned to the case the phrase "NO ASSIGNMENT" shows
>  up on the front page of the application where the person's name 
> should have been and there is no record created in the ASSIGN table 
> in the MySQL database for the case and subsequently no ASSIGN.ID that
>  shows up in the web browser for that case.

Okay.

> I am attempting to create a report that will return all instances 
> where a person has not been assigned to a case.  There is nothing in
>  the database in any fields that the NO ASSIGNMENT phrase is related
>  to

This is not surprising. I'll bet that the code looks for an assignment
and, finding none, displays this message.

> I have been trying to track down within the code for the web page 
> where this NO ASSIGNMENT phrase is coming from in hopes of 
> understanding how the application knows to return this statement.  My
>  theory is that if I can see how the application is returning this I 
> can figure out how to query the database to show me all instances 
> where this has occurred.

This sounds reasonable. Unfortunately, web application can grow to
significant complexity, and sometimes things like strings displayed in a
page can come from unlikely sources. Are you familiar with Java at all?
That might be helpful for your forensic reconstruction, here.

> Can someone give me some direction on where I can search for this 
> type of code?

Well, it's unlikely that the phrase "NO ASSIGNMENT" will appear in any
of your Java source code (that is, files with the ".java" extension).
You're more likely to find it in either a JSP file (ending in ".jsp") or
in a properties file (ending in ".properties").

You can search everything on a UNIX system using something similar to
the following:

$ grep -l "NO ASSIGNMENT" `find /path/to/application -type f`

(Note the use of back ticks).

This will display a list of files that contain that phrase.

> <a 
> href="/occa/model.do?model=oscn.seq.prompt-Assignment&amp;assignType=1&a
>  mp;data=95972&amp;caseMasterId=95972"> NO ASSIGNMENT</a>

Can you determine which file generated this output? Usually Java web
applications will use JSP or some other technology to generate the
actual HTML that the user sees. By locating the file that generates this
output, you can probably figure out how the decision is made that there
is no judicial assignment.

Otherwise, you'll have to start searching through code and basically
backtrack through the process.

I can probably take a stab at a query that might work. You mentioned
that you have tables like this (well, I'm guessing for most of this)

CASE
- ----
id

ASSIGN
- ------
case_id  (points to case.id?)
id       (points to assignee.id?)

If an assigned case has a record in the ASSIGN table, then an unassigned
case would probably have /no/ records in the ASSIGN table.

You could find those cases using a query like this:

SELECT case.id
FROM case
     LEFT OUTER JOIN assign ON assign.case_id=case.id
WHERE assign.id IS NULL

This should pull all CASE records who have no matching ASSIGN records in
the database.

Just a thought, but I have /no/ idea how your database is laid out or if
there's a better way to do this.

> If this question is better answered outside the Tomcat community
> please let me know and I will not waste your time any further.  Thank
> you in advance for any assistance you can provide.

This list typically deals with Tomcat-specific issues, but, as I said,
there's no really good forum for asking for this type of thing. Just
leave "OT" in the subject line and you'll generally be forgiven ;)

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFyOBy9CaO5/Lv0PARAnpmAJ0ex2v8/jInKRZHHs9giVbC2ON1FACfZRvM
DqW5S1Ed/7vN7jfeRI+ln1g=
=7/cp
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org