Forums Register Login

how to load a page properly ?

+Pie Number of slices to send: Send
Hi

In my web app, I have a page getPatientDetails.jsp.
In this page i am getting patient information and editing is also allowed in this page.
Now suppose i am have edited a Patient named X something lets say height=100.
Now when i try to edit another patient there also i am getting the height value as 100.
Now suppose if i make edit the getPatientDetails.jsp(like writing anything lets say hi) then i am getting proper information.
I do not know how to solve it.

thought there is some cache problem so i use to call getPatientDetials.jsp?+new Random().nextLong())
But the problem is still the same
+Pie Number of slices to send: Send
Is your JSP included in any JSP with a static include?
Are patient attributes set in session?
Have you tried following code in your JSP?

+Pie Number of slices to send: Send
yes i include another jsp in this jsp?
What do you mean by static jsp?
yes i use session attributes
+Pie Number of slices to send: Send
Static include means JSP code is included to the parent JSP at compile time.
So, if you are making any changes to the child JSP, the parent JSP needs to be recompiled for it to reflect changes.

Can you post your JSP code here?
+Pie Number of slices to send: Send
sure i am posting the code here but it is some 2000 lines,so i am explaining the flow.
Editpatient.jsp includes patientlist.jsp


patientlist.jsp has two forms getpatientlist.jsp and viewpatientlist.jsp

if you want any screenshots then i am ready to post it

editpatient.jsp ias follows


patientlist.jsp




getpatientlist.jsp


+Pie Number of slices to send: Send
Please ask me if you need any more information
+Pie Number of slices to send: Send
 

Please ask me if you need any more information


What you posted is already way, way too much. I can't imagine anyone wanting to try and make sense of 3000 lines of code. There may be a passing chance if you delete the 90% of it that are not relevant, but even then it's a lot to ask of people. You may want to become familiar with the concept of an SSCCE (that's a link).
+Pie Number of slices to send: Send
can you please tell me how to know the which version http is my app running.
i know it is 1.1 by using get request
Inside the body i write these line

<body>
<!---->
<%
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1

response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
%>
<!-- -->
+Pie Number of slices to send: Send
I don't understand how the HTTP version would be relevant. But let's stick to one topic per thread. If you have unrelated questions, start a new topic.

Also, you need to fix your display name. See http://www.javaranch.com/name.jsp for what an acceptable display name is around here. You should do this prior to your next post.
+Pie Number of slices to send: Send
From a cursory look at the code, it seems that it is wide open to SQL injection attacks. And it seems to deal with medical data, where security is paramount. With all due respect, but if that is correct, then it is unacceptably bad practice (not to mention the bad design of a 2000 line JSP, or of mixing Java code in JSPs). Please get someone more experienced involved before you put a system in place that is not secure.
+Pie Number of slices to send: Send
do you mean to say to use MVC pattern?
+Pie Number of slices to send: Send
see i have a link editpatient which calls editpatient.jsp
editpatient.jsp includes patientlist.jsp.
I am using ajax call for searching (like acording to lastname,firstname,city)
this is the way i am calling getpatientlist.jsp
<td>
<form action="getPatientDetails.jsp?<%=new Random().nextLong() %>"><input type="hidden" name="hidden" value="<%=count%>"/><input type="submit" value="edit" style="color: #fff;background:#4d90fe" ></form>
</td>
in all the pages
i am using this

<!---->
<%
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1

response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
%>
<!-- -->
<!---->
+Pie Number of slices to send: Send
Using MVC is just one of the improvements I would advise; that means no Java code in the JSP.

Preventing SQL injection (along with XSS and all the other typical web app vulnerabilities) is another.
+Pie Number of slices to send: Send
Any Solutions for my problem?
+Pie Number of slices to send: Send
 

Ulf Dittmer wrote:I can't imagine anyone wanting to try and make sense of 3000 lines of code. There may be a passing chance if you delete the 90% of it that are not relevant, but even then it's a lot to ask of people. You may want to become familiar with the concept of an SSCCE (that's a link).

 
Where all the women are strong, all the men are good looking and all the tiny ads are above average:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 2184 times.
Similar Threads
How to speed up my site?
problem without logout, how to solve it
Bluetooth technology and finding that perfect job
Indexing using XML !!
FixedThreadPool issue: more threads then expected seems to be working
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 02:56:23.