Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

jsp loading info from a bean in a new jsp page

Status
Not open for further replies.

dexter195

Programmer
Jun 18, 2003
220
EU
hi,

i have some info in a bean. when i click on a page thats using this bean i have to refresh the page in order for the info to be displayed on the screen. is this something im doing wrong or is there something i need to be do at the start of the page to tell it to refresh the page?

pages that are opened when i click submit buttons have the info displayed. its the pages that i click on manually that require a refresh to display the info.

thanks for your help
 
// the method getInfo() in javabean MySql return a String
<%@ page import="java.util.*" %>
<jsp:useBean class="MySql" id="mySqlObj" scope="session"/>
<% String output = mySqlObj.getInfo();
out.println("output1"+output);
%>
output2<%=output%>
 
thanks prosper.

i tried the code you gave me, it works but only if im opening the page using a form or the jsp-forward command.

ive got some if statements that check boolean variables in the beans to see if an error has occured. if they're true red text appears in the table, if the variable is false, the text doesnt appear.

any time an error occurs and i fix the appropiate error, when i go back to the page it still tells me the error is there, so i have to manually refresh the page for it to show the page as it should look.

it seems as if the page is being stored in a buffer of some sort and being called rather than reloaded when i click the link.

is there a way to force a reload of the webpage when its called?

thanks for your help

dex




<TD><INPUT type="text" name="town" VALUE="<%=adminOutput.getTown() %>" ></TD>
 
sorry, i just read the thread you posted on the same topic. i added the three lines of code you posted and they did the trick.

Code:
<%
			response.setHeader("Cache-Control","no-store"); //HTTP 1.1
			response.setHeader("Pragma","no-cache"); //HTTP 1.0
			response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
	%>

cheers

dex
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top