Re: JspServlet Issue

2009-10-11 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Mercy,

On 10/10/2009 11:01 AM, Mercy wrote:
 I has implemented this requirement,but still do not know the reason why
 the whole operation can't be separated.

The whole thing should be able to be implemented with no code written on
your part. You should be able to force a recompile of a JSP page by
making a request to http://host/path/yourPage.jsp?jsp_precompile=true

This request should compile the page and load it into the ClassLoader
(or not, it doesn't matter since the updated class should be loaded into
the ClassLoader on demand if not explicitly after the compilation).

A second request, without the jsp_precompile parameter, should actually
execute the page. If this technique does not work, then Tomcat has
chosen not to implement this optional portion of the JSP specification.
Since Mark Thomas, a committer on the Tomcat project, has indicated that
JSP.11.4.2 /is/ implemented, then it should work.

If it does not work, please describe exactly what you are doing, and
exactly how your webapp is behaving. Remember to throw-out whatever
broken JSP compilation code you were writing and restore the real JSP
servlet to operation.

Otherwise, there's nothing else we can really do for you.

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

iEYEARECAAYFAkrR7AsACgkQ9CaO5/Lv0PBjrgCfeVdNALERct7Ngx1YwP++l84p
KdQAoIlDDN5Tqrgomgcjn1lm+FCiWKCq
=ZPfs
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: JspServlet Issue

2009-10-10 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Mercy,

On 10/9/2009 10:06 PM, Mercy wrote:
  My JSP compiler is based on JspServletWrapper(Jasper compiler).

Again, why not simply remove the requirement that development=false?
There is nothing stopping you from recompiling JSP files explicitly with
this configuration, right?

 My JSP compiler use JspServletWrapper ,thus, it will compile and
 load(ClassLoader works fine) once,

Sounds good.

 here is recompiled operation,and then a new request (by JspServlet) to
 load that compiled JSP,

Why the second request? The compile/load step should be all handled in a
single request!

 the ClassLoader can't find class.

Where is the class (in a file? where?) and how are you trying to load it?

 ClassLoader loadClass method can find
 the class that it loaded before

Okay, then where is /that/ class? Are you simply not writing the .class
file into the right place?

, thus I think JapserLoader should load
 that class,but it can't find.

I'm sorry, my brain can't make any sense out of that sentence.

  Should it pass the recompiled ClassLoader to loader ClassLoader as
 parent ClassLoader? :-)

Wait, you're recompiling ClassLoaders on the fly, now, too?

None of this makes any sense. You are completely wasting your time
trying to do something that is completely unnecessary.

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

iEYEARECAAYFAkrQhvkACgkQ9CaO5/Lv0PAYWACgoxdbR+iYYUOurB5tH+POjGPm
X0UAoKh9Ff90LuQa9APeXdN5KXhniTwJ
=unUf
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: JspServlet Issue

2009-10-10 Thread Mercy

Hi,


Again, why not simply remove the requirement that development=false?

There is nothing stopping you from recompiling JSP files explicitly with
this configuration, right?

The production application will not accept it.



Why the second request? The compile/load step should be all handled in a

single request!

 The second request is used to execute JSP page.



Where is the class (in a file? where?) and how are you trying to load it?


The class file is placed at 
$CATALINA_HOME/work/localhost/_/org/apache/jsp/test/_1_jsp.class.


I'm sorry, my brain can't make any sense out of that sentence.


The first request has loaded it ,if my compiler set precompile=false, it will 
execute that page well,but if precompile=true,and the class loader can't found 
it in next request.


Wait, you're recompiling ClassLoaders on the fly, now, too?None of this makes 
any sense. You are completely wasting your time

trying to do something that is completely unnecessary.

You can image that there are 1 pages,99.9% of them do not need to 
recompile, but a little needs to do,that's way the development parameter 
unnecessaryly set true.

I has implemented this requirement,but still do not know the reason why the 
whole operation can't be separated.

 Thank you for your time. :-) 
	

Kind regards,
Mercy








Christopher Schultz 写道:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Mercy,

On 10/9/2009 10:06 PM, Mercy wrote:
  

 My JSP compiler is based on JspServletWrapper(Jasper compiler).



Again, why not simply remove the requirement that development=false?
There is nothing stopping you from recompiling JSP files explicitly with
this configuration, right?

  

My JSP compiler use JspServletWrapper ,thus, it will compile and
load(ClassLoader works fine) once,



Sounds good.

  

here is recompiled operation,and then a new request (by JspServlet) to
load that compiled JSP,



Why the second request? The compile/load step should be all handled in a
single request!

  

the ClassLoader can't find class.



Where is the class (in a file? where?) and how are you trying to load it?

  

ClassLoader loadClass method can find
the class that it loaded before



Okay, then where is /that/ class? Are you simply not writing the .class
file into the right place?

  

, thus I think JapserLoader should load
that class,but it can't find.



I'm sorry, my brain can't make any sense out of that sentence.

  

 Should it pass the recompiled ClassLoader to loader ClassLoader as
parent ClassLoader? :-)



Wait, you're recompiling ClassLoaders on the fly, now, too?

None of this makes any sense. You are completely wasting your time
trying to do something that is completely unnecessary.

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

iEYEARECAAYFAkrQhvkACgkQ9CaO5/Lv0PAYWACgoxdbR+iYYUOurB5tH+POjGPm
X0UAoKh9Ff90LuQa9APeXdN5KXhniTwJ
=unUf
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


  




Re: JspServlet Issue

2009-10-09 Thread Mercy



Hi Mark, In my view, the JSP 11.4.2 spec says that if client adds the jsp_precompile parameter, the request will not execute the jsp page's service method,what's more, JspServlet just compiles and loads new generated jsp servlet class, it's right, JspServlet works fine when JspServlet compiles and loads the Jsp at the same time, however, if the JSP page is compiled and loaded by two part, that means, My compiler compiles a JSP page and than JspServlet loads it, JspServlet can't find that page, so I'm confuse here.       Again, why it's Ok when two operations is executed at time time , it's wrong when separates them.Kind regards,Mercy	On Thu, 08 Oct 2009 20:26:33 +0800, Mark Thomas ma...@apache.org wrote: Mercy wrote: Hi, Yes, it just does on the first time request,I need to compile the page when I need. What is wrong with the process described in JSP.11.4.2? Mark Kind regards, Mercy On Thu, 08 Oct 2009 20:00:50 +0800, Konstantin Kolinko knst.koli...@gmail.com wrote: 2009/10/8 Mercy techme...@gmail.com: Hi Kolinko,In order to implement requirement is that our application can't set development=true and needs to compile little of pages without restart need. Even if development=false, it compiles new pages. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org-- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

Re: JspServlet Issue

2009-10-09 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Mercy,

On 10/9/2009 2:49 AM, Mercy wrote:
   In my view, the JSP 11.4.2 spec says that if client adds the 
 *jsp_precompile 
 *parameter, the request will not execute the jsp page's service method

Correct. It merely (re-)compiles the JSP page.

 JspServlet works fine when JspServlet compiles and loads the Jsp at the 
 same time

Did you mean compiles and /executes/ the JSP?

 however, if the JSP page is compiled and loaded by two part, that
 means, My compiler compiles a JSP page and than JspServlet loads it, 
 JspServlet 
 can't find that page, so I'm confuse here.

Huh? Are you saying that if you compile the JSP with one request then a
second request to execute the JSP fails with a 404?

 Again, why it's Ok when two operations is executed at time time , it's 
 wrong when separates them.

Please define wrong: does it fail (and generate some type of message),
or does it not meet your requirements (please describe what way).

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

iEYEARECAAYFAkrPXicACgkQ9CaO5/Lv0PAgJwCggb1eJnXSfJeomu79gHcSz0DM
DIoAnjmrEFr/jQc4XZDcttINCyR6T5J3
=GuHR
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: JspServlet Issue

2009-10-09 Thread Mercy


Hi chris,

* Did you mean compiles and /executes/ the JSP?

  No,here means compiles and loads the JSP.

*Huh? Are you saying that if you compile the JSP with one request then a
 second request to execute the JSP fails with a 404?

 Yes

* Please define wrong: does it fail (and generate some type of message),
or does it not meet your requirements (please describe what way).

  I need to compile Jsp on one request, and then load on another one.

  The JspServlet throws an exception of ClassNotFoundException.


Kind regards,
Mercy





On Sat, 10 Oct 2009 00:00:39 +0800, Christopher Schultz  
ch...@christopherschultz.net wrote:



Mercy,
On 10/9/2009 2:49 AM, Mercy wrote:
  In my view, the JSP 11.4.2 spec says that if client adds the  
*jsp_precompile

*parameter, the request will not execute the jsp page's service method

Correct. It merely (re-)compiles the JSP page.


JspServlet works fine when JspServlet compiles and loads the Jsp at the
same time

Did you mean compiles and /executes/ the JSP?


however, if the JSP page is compiled and loaded by two part, that
means, My compiler compiles a JSP page and than JspServlet loads it,  
JspServlet

can't find that page, so I'm confuse here.

Huh? Are you saying that if you compile the JSP with one request then a
second request to execute the JSP fails with a 404?


Again, why it's Ok when two operations is executed at time time , it's
wrong when separates them.

Please define wrong: does it fail (and generate some type of message),
or does it not meet your requirements (please describe what way).
- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkrPXicACgkQ9CaO5/Lv0PAgJwCggb1eJnXSfJeomu79gHcSz0DM
DIoAnjmrEFr/jQc4XZDcttINCyR6T5J3
=GuHR
-END PGP SIGNATURE-



--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: JspServlet Issue

2009-10-09 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Mercy,

On 10/9/2009 1:53 PM, Mercy wrote:
 * Did you mean compiles and /executes/ the JSP?
 
   No,here means compiles and loads the JSP.

When you say load, do you mean loads the new Class object into memory?

 *Huh? Are you saying that if you compile the JSP with one request then a
  second request to execute the JSP fails with a 404?
 
  Yes

Why do you think the 404 has anything to do with failed compilation
and/or loading? Is it possible you just have a broken URL or something?
You *have* been messing around writing your own JSP compiler...

 * Please define wrong: does it fail (and generate some type of message),
 or does it not meet your requirements (please describe what way).
 
 I need to compile Jsp on one request, and then load on another one.

Why does it matter when it gets loaded into the ClassLoader? Why would
you want the JSP to be compiled during one request and then loaded in a
separate one?

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

iEYEARECAAYFAkrPizsACgkQ9CaO5/Lv0PC9RgCggw2MTWlpEu2rmSqY7dZ5d5CZ
yS0AoKGOtn7oMpMvZpCaKBQjfsKZXry0
=xnQw
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: JspServlet Issue

2009-10-09 Thread Mercy

Hi,

When you say load, do you mean loads the new Class object into memory?

Yes.

Why do you think the 404 has anything to do with failed compilation
and/or loading? Is it possible you just have a broken URL or something?
You *have* been messing around writing your own JSP compiler...

 My JSP compiler is based on JspServletWrapper(Jasper compiler).

Why does it matter when it gets loaded into the ClassLoader? Why would
you want the JSP to be compiled during one request and then loaded in a
separate one?

 My JSP compiler use JspServletWrapper ,thus, it will compile and 
load(ClassLoader works fine) once,
here is recompiled operation,and then a new request (by JspServlet) to 
load that compiled JSP,
the ClassLoader can't find class.ClassLoader loadClass method can find 
the class that it loaded before, thus I think JapserLoader should load

that class,but it can't find.

 Should it pass the recompiled ClassLoader to loader ClassLoader as 
parent ClassLoader? :-)


Kind regards,
Mercy




Christopher Schultz 写道:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Mercy,

On 10/9/2009 1:53 PM, Mercy wrote:
  

* Did you mean compiles and /executes/ the JSP?
  

  No,here means compiles and loads the JSP.



When you say load, do you mean loads the new Class object into memory?

  

*Huh? Are you saying that if you compile the JSP with one request then a
 second request to execute the JSP fails with a 404?
  

 Yes



Why do you think the 404 has anything to do with failed compilation
and/or loading? Is it possible you just have a broken URL or something?
You *have* been messing around writing your own JSP compiler...

  

* Please define wrong: does it fail (and generate some type of message),
or does it not meet your requirements (please describe what way).
  

I need to compile Jsp on one request, and then load on another one.



Why does it matter when it gets loaded into the ClassLoader? Why would
you want the JSP to be compiled during one request and then loaded in a
separate one?

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

iEYEARECAAYFAkrPizsACgkQ9CaO5/Lv0PC9RgCggw2MTWlpEu2rmSqY7dZ5d5CZ
yS0AoKGOtn7oMpMvZpCaKBQjfsKZXry0
=xnQw
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


  




Re: JspServlet Issue

2009-10-08 Thread Konstantin Kolinko
2009/10/7 Mercy techme...@gmail.com:
 Hi Mark,

        I just want to compile the pages what i need, not all. Actually,the
 most pages ware compiled by ANT,thus, our application does not set the
 development parameter is true.

        What's more , I did not re-invent the wheel rather than I re-use the
 JspServlet and its correlative classes.

        Thank you for your time.


What part of your application does not work for you when you have
development=false? What are your requirements?

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: JspServlet Issue

2009-10-08 Thread Mercy


Hi Kolinko,

	In order to implement requirement is that our application can't set  
development=true and needs to compile little of pages without restart need.
If I use the JspServlet , it compiles JSP Pages and loads them class and  
works fine, but If use my compiler to compile and load, the JspServlet  
can't find the class.
I debuged it and found that JapserLoader can't find it,so I suspect that  
it's a problem about class loader.


Thank you for your response.

Kind regards,
Mercy



Mercy wrote:

Hi Mark,
 Thank you for your response, actually, I has found a way to fulfill
my requirement that it can compile the JSP pages when development
parameter is false.
My question is that why my compiler using JspServletWrapper has been
compiled some class files of Jsp file, the JasperLoader can't find
them,at the same time,
The other pages that were compiled by JspServlet in first time could be
found by JapserLoader.
 The exception told me that org/apache/jsp/_1_jsp class can't be
found,but it still exists and its modified time is latest.
 Is it a bug of JapserLoader or URLClassLoader?




On Thu, 08 Oct 2009 19:07:14 +0800, Konstantin Kolinko  
knst.koli...@gmail.com wrote:



What part of your application does not work for you when you have
development=false? What are your requirements?



--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: JspServlet Issue

2009-10-08 Thread Konstantin Kolinko
2009/10/8 Mercy techme...@gmail.com:

 Hi Kolinko,

        In order to implement requirement is that our application can't set
 development=true and needs to compile little of pages without restart need.

Even if development=false, it compiles new pages.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: JspServlet Issue

2009-10-08 Thread Mercy

Hi,

	Yes, it just does on the first time request,I need to compile the page  
when I need.


Kind regards,
Mercy

On Thu, 08 Oct 2009 20:00:50 +0800, Konstantin Kolinko  
knst.koli...@gmail.com wrote:



2009/10/8 Mercy techme...@gmail.com:


Hi Kolinko,

   In order to implement requirement is that our application can't  
set
development=true and needs to compile little of pages without restart  
need.


Even if development=false, it compiles new pages.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: JspServlet Issue

2009-10-08 Thread Mark Thomas
Mercy wrote:
 Hi,
 
 Yes, it just does on the first time request,I need to compile the
 page when I need.

What is wrong with the process described in JSP.11.4.2?

Mark

 
 Kind regards,
 Mercy
 
 On Thu, 08 Oct 2009 20:00:50 +0800, Konstantin Kolinko
 knst.koli...@gmail.com wrote:
 
 2009/10/8 Mercy techme...@gmail.com:

 Hi Kolinko,

In order to implement requirement is that our application
 can't set
 development=true and needs to compile little of pages without restart
 need.

 Even if development=false, it compiles new pages.

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org

 
 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: JspServlet Issue

2009-10-07 Thread Mark Thomas
 From: Mercy Ma techme...@gmail.com
 To: users@tomcat.apache.org
 Sent: 07/10/09, 06:42:17
 Subject: JspServlet Issue
 
 Hi there,
 
 I did write some code to create dynamic compiler for JSP pages, because our
 application sets development options parameter to be false for JspServlet.

Surely much simpler to change the app so it doesn't do that.

Mark

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: JspServlet Issue

2009-10-07 Thread Mercy

Hi Mark,

What did you mean change the app? Could you give more information?

Thank you.

Kind regards,
Mercy


On Wed, 07 Oct 2009 15:50:28 +0800, Mark Thomas ma...@apache.org wrote:


From: Mercy Ma techme...@gmail.com
To: users@tomcat.apache.org
Sent: 07/10/09, 06:42:17
Subject: JspServlet Issue

Hi there,

I did write some code to create dynamic compiler for JSP pages, because  
our
application sets development options parameter to be false for  
JspServlet.


Surely much simpler to change the app so it doesn't do that.

Mark

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: JspServlet Issue

2009-10-07 Thread Mark Thomas
 --- Original Message ---
 From: Mercy techme...@gmail.com
 To: Tomcat Users List users@tomcat.apache.org
 Sent: 07/10/09, 08:57:24
 Subject: Re: JspServlet Issue
 
 Hi Mark,
 
   What did you mean change the app? Could you give more information?

Don't set the development parameter of the JspServlet to false.

Mark

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: JspServlet Issue

2009-10-07 Thread Mercy

Hi Mark,

	Thank you for your response, actually, I has found a way to fulfill my  
requirement that it can compile the JSP pages when development parameter  
is false.
My question is that why my compiler using JspServletWrapper has been  
compiled some class files of Jsp file, the JasperLoader can't find them,at  
the same time,
The other pages that were compiled by JspServlet in first time could be  
found by JapserLoader.


	The exception told me that org/apache/jsp/_1_jsp class can't be found,but  
it still exists and its modified time is latest.


Is it a bug of JapserLoader or URLClassLoader?

I expect you response, thank you. :)

Kind regards,
Mercy

On Wed, 07 Oct 2009 16:13:41 +0800, Mark Thomas ma...@apache.org wrote:


--- Original Message ---
From: Mercy techme...@gmail.com
To: Tomcat Users List users@tomcat.apache.org
Sent: 07/10/09, 08:57:24
Subject: Re: JspServlet Issue

Hi Mark,

What did you mean change the app? Could you give more information?


Don't set the development parameter of the JspServlet to false.

Mark

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: JspServlet Issue

2009-10-07 Thread Mark Thomas
Mercy wrote:
 Hi Mark,
 
 Thank you for your response, actually, I has found a way to fulfill
 my requirement that it can compile the JSP pages when development
 parameter is false.
 My question is that why my compiler using JspServletWrapper has been
 compiled some class files of Jsp file, the JasperLoader can't find
 them,at the same time,
 The other pages that were compiled by JspServlet in first time could be
 found by JapserLoader.
 
 The exception told me that org/apache/jsp/_1_jsp class can't be
 found,but it still exists and its modified time is latest.
 
 Is it a bug of JapserLoader or URLClassLoader?

Neither. It is a bug of your custom re-compilation code. I still don't see why
you are trying to re-invent the wheel. Just don't set development=false.

Mark

 
 I expect you response, thank you. :)
 
 Kind regards,
 Mercy
 
 On Wed, 07 Oct 2009 16:13:41 +0800, Mark Thomas ma...@apache.org wrote:
 
 --- Original Message ---
 From: Mercy techme...@gmail.com
 To: Tomcat Users List users@tomcat.apache.org
 Sent: 07/10/09, 08:57:24
 Subject: Re: JspServlet Issue

 Hi Mark,

 What did you mean change the app? Could you give more information?

 Don't set the development parameter of the JspServlet to false.

 Mark

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org

 
 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: JspServlet Issue

2009-10-07 Thread Mercy

Hi Mark,

	I just want to compile the pages what i need, not all. Actually,the most  
pages ware compiled by ANT,thus, our application does not set the  
development parameter is true.


	What's more , I did not re-invent the wheel rather than I re-use the  
JspServlet and its correlative classes.


Thank you for your time.

Kind regards,
Mercy

On Wed, 07 Oct 2009 18:15:29 +0800, Mark Thomas ma...@apache.org wrote:


Mercy wrote:

Hi Mark,

Thank you for your response, actually, I has found a way to fulfill
my requirement that it can compile the JSP pages when development
parameter is false.
My question is that why my compiler using JspServletWrapper has been
compiled some class files of Jsp file, the JasperLoader can't find
them,at the same time,
The other pages that were compiled by JspServlet in first time could be
found by JapserLoader.

The exception told me that org/apache/jsp/_1_jsp class can't be
found,but it still exists and its modified time is latest.

Is it a bug of JapserLoader or URLClassLoader?


Neither. It is a bug of your custom re-compilation code. I still don't  
see why

you are trying to re-invent the wheel. Just don't set development=false.

Mark



I expect you response, thank you. :)

Kind regards,
Mercy

On Wed, 07 Oct 2009 16:13:41 +0800, Mark Thomas ma...@apache.org  
wrote:



--- Original Message ---
From: Mercy techme...@gmail.com
To: Tomcat Users List users@tomcat.apache.org
Sent: 07/10/09, 08:57:24
Subject: Re: JspServlet Issue

Hi Mark,

What did you mean change the app? Could you give more  
information?


Don't set the development parameter of the JspServlet to false.

Mark

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org







-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



JspServlet Issue

2009-10-06 Thread Mercy Ma
Hi there,

I did write some code to create dynamic compiler for JSP pages, because our
application sets development options parameter to be false for JspServlet.
In order to fulfill the requirement, I viewed the correlative code of Japser
engine.

At first, I implemented the Options , JspRuntimeContext , and created a new
Servlet to interpret and compile the JSP page,it works fine, and the class
file was created in work directory, but JspServletWrapper does not reload
it,I checked the source of JspServletWrapper, and found the field reload is
false ,thus , did not reload it. It's correct.

However, I tried one way to find the JspServlet instance in tomcat, and
register a Servlet Filter to map all *.jsp and *.jspx. I know the singleton
instance of JspServlet (it works) services for all *.jsp and *.jspx in one
container, the FilterChain implemention
class(org.apache.catalina.core.ApplicationFilterChain) can be taken
advantage of retrieving this JspServlet instance, Luckly, I successfully
retrieved that one, and than I'd like to set the reload is true by
invocation JspServletWrapper#setReload(true) method.

Although the reload is true,unfortunately , The JasperLoader can't find the
class file,for instance, the class file that is placed in
${CATALINA_HOME}/work/localhost/catalina/_/org/apache/jsp/test/_2_jsp.class
is a new created class by my code sucessfully,the
JasperLoader#loadClass(String name) can't load it, another JSP pages that
are created by application work fine in the same directory, is it caused by
ClassLoader? In fact , my compiler invokes the
JspServletWrapper#service(request,response,true), it was loaded once,so I'm
confused. :-(

The version of My tomcat is Apache Tomcat/6.0.18 under jdk1.6.0_16, IDE is
Eclipse 3.4 JEE

Thank you in advanced. :-)

Kind regards,
Mercy