--------------------------------------- Any code is there to maintain cache explicitly in JSP. Please give any solution It is caching when i using simple html page on refreshing... i am using tomcat 5.0.19 server
If you have time go through this code and please give me your valuable suggestions.. if the code is confusing sorry..... on change function of select tag i am calling one method redirect(x). here x is selected index of country.
Could you edit your post to include the CODE UBB tags? I have the feeling that your post was supposed to include more than what I can see.
Anyway, could you tell what request.getParameter("countryId"); returns when the JSP is executed after selecting a country?
Also, wouldn't it be easier to rely on <html:select ... value="<%= countryId %>"> for retaining the selection (instead of using your own custom taglib)? [ August 16, 2004: Message edited by: Lasse Koskela ]
} since the above code work only when user selected any contry. so first time when page loads String cCountry = request.getParameter("countryId");//returns the country will be null so it is setting to zero. when selecting the country option it will call thwe redirect(option.value) and passes that value as queryString.
Hi manoj, normally if the the fields in the jsp have get and set method in your actionform class(form bean ). When you enter data into these fields and submit the page , the formbean object will hold the data which you can retrieve in your action class. I think in your case when you reload the page after selecting the country to show the correponding states, the data in the form bean object is getting lost. I dont know the exact reason. So try like this. When you submit your page for selection of states according to the country selected, get the form bean object from the form bean parameter of the actionForward method of the action class and again set to the request. You have to do some changes in your code in your jsp suppose you have a field called address So you have to give as <html:text property="address" name="formObj" /> In your action class in the method which you call while submitting the page for the selection of states you have to write as yourFormBean classname formBeanObj = (form)formBeanclassname(); request.setAttribute("formObj",formBeanObj ); When you do like this , if the formbean holds any value , it will be displayed in the jsp according the way you have given(check the above text box i have given for displaying address). This is the way i usually do. I dont think you have to use your own tag library to solve this problem.This is very simple Try like this ok all the best Poornima