aspose file tools*
The moose likes JSP and the fly likes Forcebly translate and recompiling a JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Forcebly translate and recompiling a JSP" Watch "Forcebly translate and recompiling a JSP" New topic
Author

Forcebly translate and recompiling a JSP

B Mampilli
Ranch Hand

Joined: Aug 05, 2002
Posts: 61
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 ]

Boney
SCJP, SCWCD
Andres Gonzalez
Ranch Hand

Joined: Nov 27, 2001
Posts: 1561
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..


I'm not going to be a Rock Star. I'm going to be a LEGEND! --Freddie Mercury
B Mampilli
Ranch Hand

Joined: Aug 05, 2002
Posts: 61
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

Joined: Feb 10, 2001
Posts: 613
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


All desirable things in life are either illegal, banned, expensive or married to someone else !!!
B Mampilli
Ranch Hand

Joined: Aug 05, 2002
Posts: 61
no...
it doesnt work with the precompile option...
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60057
    
  65

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


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
B Mampilli
Ranch Hand

Joined: Aug 05, 2002
Posts: 61
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

Joined: Feb 10, 2001
Posts: 613
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

Joined: Aug 05, 2002
Posts: 61
how do i clear my cache from within the jsp?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60057
    
  65

Have you searched these forums for the term 'clear cache'?
bear
Praful Thakare
Ranch Hand

Joined: Feb 10, 2001
Posts: 613
In tool bar of ur browser click
Tools->internet options->delete files -> ok
cheers
Praful
Andres Gonzalez
Ranch Hand

Joined: Nov 27, 2001
Posts: 1561
The easiest solution for me is *not* to use frames. Frames are evil
B Mampilli
Ranch Hand

Joined: Aug 05, 2002
Posts: 61
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

Joined: Nov 27, 2001
Posts: 1561
Originally posted by B Mampilli:
Well.. got the solution.. the problem was in using frames...

Told ya
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Forcebly translate and recompiling a JSP
 
Similar Threads
When do includes happen?
is this two are euqal
Generated Servlet from JSP not found
reloading of JSP page
how to open a new window in jsp