Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

page keep on refreshing

 
vinayGuddu Pandey
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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:
 
jatan bhavsar
Ranch Hand
Posts: 299
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 299
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
At console while stopping the refreshment of page I ma getting this error


is this related with the tag closing???
 
jatan bhavsar
Ranch Hand
Posts: 299
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic