jQuery in Action, 2nd edition*
The moose likes Struts and the fly likes page keep on refreshing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "page keep on refreshing" Watch "page keep on refreshing" New topic
Author

page keep on refreshing

vinayGuddu Pandey
Ranch Hand

Joined: Aug 02, 2012
Posts: 30


I have to get the jsp page on onload. For this I have mentioned onload function in my jsp.

below is my jsp file

this all fields I want to show in jsp. on all method...but problem is the page is keep on refreshing even I have given settimeout function in js.

please help :banghead:


vinay
jatan bhavsar
Ranch Hand

Joined: Jul 23, 2008
Posts: 296

Hi Vinya,

Problem is with javascript code remove settimeout function . you are calling the same function onload from settimeout which is goin in infinite loop. after certain time interval it again calls the onload function.
I think problem is with settimeout function.check it by removin and let me know if the problem persist.

Regards
jatan
vinayGuddu Pandey
Ranch Hand

Joined: Aug 02, 2012
Posts: 30
Hi All,

I have a situation like on onload of a page I need to display all the data on a jsp.
Earlier that data get populated on onclick on search button.
But now requirement is onload of that particular jsp page all data should come without pressing search button.

I intend to use JavaScript only
Any help would be appreciated
vinayGuddu Pandey
Ranch Hand

Joined: Aug 02, 2012
Posts: 30
jatan bhavsar wrote:Hi Vinya,

Problem is with javascript code remove settimeout function . you are calling the same function onload from settimeout which is goin in infinite loop. after certain time interval it again calls the onload function.
I think problem is with settimeout function.check it by removin and let me know if the problem persist.

Regards
jatan



thanks for the reply but while removing this, that related data page is not coming.
jatan bhavsar
Ranch Hand

Joined: Jul 23, 2008
Posts: 296

Hi Vinay,

Removing settimeout function will definately submit the form but can you explain which page dosent come? try to work javascript definately it will solve your problem.


Second things
all data should come without pressing search button

If all data should come then why dont you fetch the data before action call and then display it. you can show hide the controls on jsp page.

Regards
jatan


vinayGuddu Pandey
Ranch Hand

Joined: Aug 02, 2012
Posts: 30
Hi Jatan,

how is this JavaScript for the same :--


and I will this method in jsp below </head> what you say

like
vinayGuddu Pandey
Ranch Hand

Joined: Aug 02, 2012
Posts: 30
vinayGuddu Pandey wrote:

I have to get the jsp page on onload. For this I have mentioned onload function in my jsp.

below is my jsp file

this all fields I want to show in jsp. on all method...but problem is the page is keep on refreshing even I have given settimeout function in js.

please help :banghead:



what I did now is I divide the above(main) jsp in 2 parts , in name of mera.jsp and include the child jsp with main one
as

but here I am getting one error as:--
Multiple annotations found at this line:
- Syntax error, insert "}" to complete ClassBody
- Syntax error on token "}", delete this token
- Syntax error, insert "}" to complete Block

the content in mera.jsp is

in this jsp it is not showing any error but the main jsp is getting refresh again and again in output

the js I am using for this is:--


and in mera.jsp I am calling this function(please refer with an above mera.jsp )
but not getting the proper output
please suggest :banghead:
vinayGuddu Pandey
Ranch Hand

Joined: Aug 02, 2012
Posts: 30
At console while stopping the refreshment of page I ma getting this error


is this related with the tag closing???
jatan bhavsar
Ranch Hand

Joined: Jul 23, 2008
Posts: 296

Hi Vinay,

Have you tried to search what is the meaning of this Error?


Everyone will give you the ideas here you need to code and implement it.

Regards
jatan
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: page keep on refreshing
 
Similar Threads
In jsp page After decimal i need only 2 values(for ex:477.74)
Login Servlet
drop down list: on refresh page by default select option is not coming
JSP Page when submitted, List becomes empty
Display a Form on a button click using struts tags