• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Forcebly translate and recompiling a JSP

 
B Mampilli
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a jsp which i need to forceible translate and recompile everytime it is accessed. Is there any method of doing that?
Regards,
Boney
[ October 30, 2003: Message edited by: Bear Bibeault ]
 
Andres Gonzalez
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by B Mampilli:
Hi,
I have a jsp which i need to forceible translate and recompile everytime it is accessed. Is there any method of doing that?
Regards,
Boney

You can call the jsp with the parameter jsp_precompile. Have a look at it in the specification.
I'm just wondering the reason of why you want to do that. It'll mean that every request will behave as if it is the very first one. And you know that the container will have to translate/compile/load (if it hasn't) the jsp again. This will become really slow..
 
B Mampilli
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
The jsp_precompile option is used to precompile a jsp before its use so that subsequent accesses to the jsp would not result in a time delay. But this is exactly what I want. I want that every time a JSP is requested for it should be re-translated and recomplied.
I will explain the scenario where I need it. It's a bit long and complicated but stay with me.
I have a main page. The name of the main page is mainframe.jsp. mainframe.jsp contains three frames in it. The three frames have source (src) specified as topframe.jsp, middleframe.jsp, and bottomframe.jsp. So whenever mainframe.jsp is called, it inturn calls topframe.jsp, middleframe.jsp, and bottomframe.jsp and loads them in the mainframe page.
In topframe.jsp, I have an text field. Whenever the user enters text into it, and submits the form, the form goes to a servlet for some database entries and then comes back and loads mainframe.jsp. This time, there is some scriptlet in middleframe.jsp which retireves the values from the database and displays it.
Now the problem:
When middleframe.jsp is called, there is no change in the middleframe.jsp so the new values from the database are not displayed. It displays the previously displayed mainframe.jsp page again.
So, I need some method by which I can forcebile, translate and compile mainframe.jsp everytime it is accessed.

Regards,
Boney
 
Praful Thakare
Ranch Hand
Posts: 642
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I really wonder if it is problem of recompiling jsp,if value is picked from database then just refreshing jsp will do the needful :roll: .
I m eager to know if it is working fine with precompile option
Cheers
Praful
 
B Mampilli
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no...
it doesnt work with the precompile option...
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64717
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You probably have a caching problem. Causing the JSP to re-translate is like using nuclear weapons to crack walnuts. Find out why your page is not updating with the new data and fix the real problem.
bear
 
B Mampilli
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how do i refresh a jsp?
if it is by calling it, then it is not working..
Wandering thoughts...
The problem could be cause I am using frames, but i have to use frames so no option... logically i feel that using frames should not cause a problem.
 
Praful Thakare
Ranch Hand
Posts: 642
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As Bear said u should try with clearing ur cache.
And I agree with ur logic,using frames should not cause a problem
cheers
 
B Mampilli
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how do i clear my cache from within the jsp?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64717
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you searched these forums for the term 'clear cache'?
bear
 
Praful Thakare
Ranch Hand
Posts: 642
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In tool bar of ur browser click
Tools->internet options->delete files -> ok
cheers
Praful
 
Andres Gonzalez
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The easiest solution for me is *not* to use frames. Frames are evil
 
B Mampilli
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well.. got the solution.. the problem was in using frames...
In frames if we have a form then when we specify the action element of the form, we also need to specify an element target. The target element specifies where the output should be displayed. so i set the target of topframe.jsp to the mainframes.jsp and pronto.. it works....
Spent more than half a day on this .. but i good learning....

Thanks for all your quick suggestions and help. Appreciated.
 
Andres Gonzalez
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by B Mampilli:
Well.. got the solution.. the problem was in using frames...

Told ya
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic