You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by fred basset <fr...@gmail.com> on 2010/01/29 17:54:25 UTC
Viewing JSP's compiled code
Hi All,
Simple question, how do I keep and view the source code generated when
a JSP is compiled?
Thanks,
Fred
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: Viewing JSP's compiled code
Posted by Joseph Morgan <jo...@ignitesales.com>.
Fred, there is a directory under the tomcat directory called "work".
Follow that structure through to the end.. it will be different
depending on your apps, but it starts out with
"work->Catalina->{host}->{app}->org->apache->jsp", and even more if you
have jsp's within sub-directories. You should see the generated java
and class files there.
-----Original Message-----
From: fred basset [mailto:fredbasset1000@gmail.com]
Sent: Friday, January 29, 2010 10:54 AM
To: Tomcat Users List
Subject: Viewing JSP's compiled code
Hi All,
Simple question, how do I keep and view the source code generated when
a JSP is compiled?
Thanks,
Fred
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Viewing JSP's compiled code
Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Fred,
On 1/29/2010 12:07 PM, fred basset wrote:
> What I am trying to do is access a variable from a forEach loop. In
> the example below I want to call a java function to do some
> calculations on each "p" variable in the loop and output the results
> of the calculation in the table. How do I do this?
What do you want to do with that variable?
When you use tag libraries and beans and stuff like that, you're
supposed to kind of live in that environment exclusively. There's no
guarantee that the lcoal variable "p" will exist, so you can't just do this:
<%
p.toString();
%>
All the "variables" defined through things like <c:forEach> are likely
to be stored in the "page" context which isn't represented directly by
local variables (or, at least, isn't guaranteed to be).
Perhaps there's a tag for what you want to do with this variable.
Perhaps you'll have to develop one.
If this is all JSTL, then you may be able to just do:
${p}.toString()
..or something like that.
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAktjUosACgkQ9CaO5/Lv0PBOYgCfQTGD/BlYAaLZsmhEAfOOViaA
1hoAnRbg7s+xk15wxrx2Fb1epzKsMA5i
=NkUJ
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: Viewing JSP's compiled code
Posted by Joseph Morgan <jo...@ignitesales.com>.
If the basic functions are there, you can do something like:
<c:set var="result" value="${p.xxx + p.yyy / p.zzz}"/>
And then use:
${result}
-----Original Message-----
From: fred basset [mailto:fredbasset1000@gmail.com]
Sent: Friday, January 29, 2010 11:47 AM
To: Tomcat Users List
Subject: Re: Viewing JSP's compiled code
Yeah I would do this but the p in this case is a class auto generated
by Hibernate, and I don't know yet if it's possible to customize those
auto generated classes (but I'm going to find out).
On Fri, Jan 29, 2010 at 9:18 AM, Joseph Morgan
<jo...@ignitesales.com> wrote:
> A really "poor man's" way of doing this is to add a "getXXX" in "p"s class that calls
> The java function and returns the value. Then, you could just write something like:
>
> ${p.XXX}
>
> Replacing XXX with the name of the function.
>
>
>
> -----Original Message-----
> From: fred basset [mailto:fredbasset1000@gmail.com]
> Sent: Friday, January 29, 2010 11:07 AM
> To: Tomcat Users List
> Subject: Re: Viewing JSP's compiled code
>
> Thanks, found it.
>
> What I am trying to do is access a variable from a forEach loop. In
> the example below I want to call a java function to do some
> calculations on each "p" variable in the loop and output the results
> of the calculation in the table. How do I do this?
>
>
> <tbody>
> <c:forEach var="p"
> items="${model.projects}">
> <tr>
> <td
> class="zLarge"><div class="StdTableDataLeft"><a
> href="editproject.html?id=${p.id}" title="Open
> project">${p.groupName}</a></div></td>
> <td
> class="zSmall"><div
> class="StdTableData">${fn:length(p.travelTimeSegments)}</div></td>
> <td
> class="zSmall"><div class="StdTableData">need to call java fn on p
> here</div></td>
> <td
> class="zSmall"><div class="StdTableData">${p.modifyTime}</div></td>
> </tr>
> </c:forEach>
> </tbody>
>
>
> On Fri, Jan 29, 2010 at 8:57 AM, Caldarale, Charles R
> <Ch...@unisys.com> wrote:
>>> From: fred basset [mailto:fredbasset1000@gmail.com]
>>> Subject: Viewing JSP's compiled code
>>>
>>> Simple question, how do I keep and view the source code generated when
>>> a JSP is compiled?
>>
>> Look in Tomcat's work directory - several levels deep, organized by webapp name.
>>
>> - Chuck
>>
>>
>> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Viewing JSP's compiled code
Posted by fred basset <fr...@gmail.com>.
Yeah I would do this but the p in this case is a class auto generated
by Hibernate, and I don't know yet if it's possible to customize those
auto generated classes (but I'm going to find out).
On Fri, Jan 29, 2010 at 9:18 AM, Joseph Morgan
<jo...@ignitesales.com> wrote:
> A really "poor man's" way of doing this is to add a "getXXX" in "p"s class that calls
> The java function and returns the value. Then, you could just write something like:
>
> ${p.XXX}
>
> Replacing XXX with the name of the function.
>
>
>
> -----Original Message-----
> From: fred basset [mailto:fredbasset1000@gmail.com]
> Sent: Friday, January 29, 2010 11:07 AM
> To: Tomcat Users List
> Subject: Re: Viewing JSP's compiled code
>
> Thanks, found it.
>
> What I am trying to do is access a variable from a forEach loop. In
> the example below I want to call a java function to do some
> calculations on each "p" variable in the loop and output the results
> of the calculation in the table. How do I do this?
>
>
> <tbody>
> <c:forEach var="p"
> items="${model.projects}">
> <tr>
> <td
> class="zLarge"><div class="StdTableDataLeft"><a
> href="editproject.html?id=${p.id}" title="Open
> project">${p.groupName}</a></div></td>
> <td
> class="zSmall"><div
> class="StdTableData">${fn:length(p.travelTimeSegments)}</div></td>
> <td
> class="zSmall"><div class="StdTableData">need to call java fn on p
> here</div></td>
> <td
> class="zSmall"><div class="StdTableData">${p.modifyTime}</div></td>
> </tr>
> </c:forEach>
> </tbody>
>
>
> On Fri, Jan 29, 2010 at 8:57 AM, Caldarale, Charles R
> <Ch...@unisys.com> wrote:
>>> From: fred basset [mailto:fredbasset1000@gmail.com]
>>> Subject: Viewing JSP's compiled code
>>>
>>> Simple question, how do I keep and view the source code generated when
>>> a JSP is compiled?
>>
>> Look in Tomcat's work directory - several levels deep, organized by webapp name.
>>
>> - Chuck
>>
>>
>> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: Viewing JSP's compiled code
Posted by Joseph Morgan <jo...@ignitesales.com>.
A really "poor man's" way of doing this is to add a "getXXX" in "p"s class that calls
The java function and returns the value. Then, you could just write something like:
${p.XXX}
Replacing XXX with the name of the function.
-----Original Message-----
From: fred basset [mailto:fredbasset1000@gmail.com]
Sent: Friday, January 29, 2010 11:07 AM
To: Tomcat Users List
Subject: Re: Viewing JSP's compiled code
Thanks, found it.
What I am trying to do is access a variable from a forEach loop. In
the example below I want to call a java function to do some
calculations on each "p" variable in the loop and output the results
of the calculation in the table. How do I do this?
<tbody>
<c:forEach var="p"
items="${model.projects}">
<tr>
<td
class="zLarge"><div class="StdTableDataLeft"><a
href="editproject.html?id=${p.id}" title="Open
project">${p.groupName}</a></div></td>
<td
class="zSmall"><div
class="StdTableData">${fn:length(p.travelTimeSegments)}</div></td>
<td
class="zSmall"><div class="StdTableData">need to call java fn on p
here</div></td>
<td
class="zSmall"><div class="StdTableData">${p.modifyTime}</div></td>
</tr>
</c:forEach>
</tbody>
On Fri, Jan 29, 2010 at 8:57 AM, Caldarale, Charles R
<Ch...@unisys.com> wrote:
>> From: fred basset [mailto:fredbasset1000@gmail.com]
>> Subject: Viewing JSP's compiled code
>>
>> Simple question, how do I keep and view the source code generated when
>> a JSP is compiled?
>
> Look in Tomcat's work directory - several levels deep, organized by webapp name.
>
> - Chuck
>
>
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Viewing JSP's compiled code
Posted by fred basset <fr...@gmail.com>.
Thanks, found it.
What I am trying to do is access a variable from a forEach loop. In
the example below I want to call a java function to do some
calculations on each "p" variable in the loop and output the results
of the calculation in the table. How do I do this?
<tbody>
<c:forEach var="p"
items="${model.projects}">
<tr>
<td
class="zLarge"><div class="StdTableDataLeft"><a
href="editproject.html?id=${p.id}" title="Open
project">${p.groupName}</a></div></td>
<td
class="zSmall"><div
class="StdTableData">${fn:length(p.travelTimeSegments)}</div></td>
<td
class="zSmall"><div class="StdTableData">need to call java fn on p
here</div></td>
<td
class="zSmall"><div class="StdTableData">${p.modifyTime}</div></td>
</tr>
</c:forEach>
</tbody>
On Fri, Jan 29, 2010 at 8:57 AM, Caldarale, Charles R
<Ch...@unisys.com> wrote:
>> From: fred basset [mailto:fredbasset1000@gmail.com]
>> Subject: Viewing JSP's compiled code
>>
>> Simple question, how do I keep and view the source code generated when
>> a JSP is compiled?
>
> Look in Tomcat's work directory - several levels deep, organized by webapp name.
>
> - Chuck
>
>
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: Viewing JSP's compiled code
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: fred basset [mailto:fredbasset1000@gmail.com]
> Subject: Viewing JSP's compiled code
>
> Simple question, how do I keep and view the source code generated when
> a JSP is compiled?
Look in Tomcat's work directory - several levels deep, organized by webapp name.
- Chuck
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org