• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Jsp refresh

 
vivek shankare gowda
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Namaste...
There are two jsp pages namely index.jsp and page1.jsp

-- In index.jsp I have to create a hyperlink to page1.jsp
-- In page1.jsp, i Have to keep a refresh button.. If i click that button ..it has to refresh index.jsp


----How can i achieve this ?? please help..

 
Albareto McKenzie
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In index.jsp:



In page1.jsp:

 
vivek shankare gowda
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi..
Thank you for reply..

But in page1.jsp

<input type="button" name="refresh" value="refresh">

if you click the above button.. it should refresh index.jsp page.. like F5..
 
Albareto McKenzie
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The point is that you don't want to refresh the current page, you want to navigate to other page (in this case index.jsp), you can do something like this:

 
vivek shankare gowda
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mean time it should refresh index.jsp..

Also I wanted to know.. navigating to index.jsp ..means it refresh index.jsp and navigates to index.jsp ???
 
Albareto McKenzie
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are in index and navigate to page1, index is gone, you cannot "refresh" it, you can invoke it again and it will be loaded. Did you try what I told you? I think it is what you wanted, isn't it?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64615
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Each request is separate from the rest. Once you've left the first page it's gone. Dead. Kaput.

So there's no such thing as "refreshing" a page that does not exist.

Navigating back to a previous page simply loads the page no differently than the first time.
 
vivek shankare gowda
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ya thanks again..

But i was told.. It could be achieved using java script .. I wrote the same code but he said.. i was just redirecting to index.jsp, when i click the button..instead of refreshing index.jsp
 
Albareto McKenzie
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to have clear what do you want and how. I suppose "he" is your boss/teacher, ask him what he wants to achieve, if he just wants to see index.jsp again... voila, if he wants a fancy pants website might be that you have to share with us more information if you want us to be of help.
 
vivek shankare gowda
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks again..

Ya i should be more clear to ask questions.

sorry for that.

Actually we are learning things. Someone gave this scenario.. We started blindly without collecting all necessary info.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic