aspose file tools*
The moose likes JSP and the fly likes Jsp refresh Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Jsp refresh" Watch "Jsp refresh" New topic
Author

Jsp refresh

vivek shankare gowda
Ranch Hand

Joined: Jul 13, 2011
Posts: 30
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

Joined: Apr 08, 2009
Posts: 298
In index.jsp:



In page1.jsp:

vivek shankare gowda
Ranch Hand

Joined: Jul 13, 2011
Posts: 30
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

Joined: Apr 08, 2009
Posts: 298
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

Joined: Jul 13, 2011
Posts: 30
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

Joined: Apr 08, 2009
Posts: 298
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

Joined: Jan 10, 2002
Posts: 60041
    
  65

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
vivek shankare gowda
Ranch Hand

Joined: Jul 13, 2011
Posts: 30
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

Joined: Apr 08, 2009
Posts: 298
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

Joined: Jul 13, 2011
Posts: 30
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.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Jsp refresh
 
Similar Threads
Browser Refresh - struts
back and reload
Sending data to popup window
open a popup window of a pop up window from the parent window
jsp page redirection