How do i assign default value in jsp

I have assign default value to a text box .But the user can enter new value and submit it.But when the user enter the back button.The value goes back to default value. the default value is assign in on load function in the body.I am currently using java , jsp and javascript. The date value is obtain using the following syntax.
function setFromDate(){
if (document.all.fromday.value ==“”){
<%
Calendar cal = new GregorianCalendar();
// Get the components of the date
int era = cal.get(Calendar.ERA); // 0=BC, 1=AD
int year = cal.get(Calendar.YEAR); // 2002
int month = cal.get(Calendar.MONTH)+1; // 0=Jan, 1=Feb, …
int day = cal.get(Calendar.DAY_OF_MONTH); // 1…
int dayOfWeek = cal.get(Calendar.DAY_OF_WEEK); // 1=Sunday, 2=Monday,
%> <%System.out.println(“month”+month);%>
if (‘<%=year%>’ < 1000)
{year+=1900;}
if (‘<%=month%>’<10)
{month=eval(“0”+month);}
if (‘<%=day%>’<10)
{day=eval(“0”+day);}

}	
	document.all.fromday.value='&lt;%=day%&gt;'+ '/' +'&lt;%=month%&gt;' +'/'+'&lt;%=year%&gt;';
	document.all.todate.value='&lt;%=day%&gt;'+ '/' +'&lt;%=month%&gt;' +'/'+'&lt;%=year%&gt;';

}
please replay me soon .I dont know how to display the default value and display the user entered value not the default value.

As I mentioned earlier , this is client dependant.
But you can overcome this issue using sessions and setting the value by value=“<% System.out.println(use-session-variable); %>”
Once the form is posted from a.jsp to b.jsp, store a.jsp’s input values in a session table in b.jsp. This way once a person hits the back button, the session variable’s value can be set in value=“”. Is the session variable doesnt exist (using if statement) set it to some default value of yours.

in jsp syntax you would use:
session.setParameter(“name”, “value”);

value=“<%=session.getParameter(“name”)%>”

with getParameter returning null if the parameter doesnt exist