Scot Meyer

Greenhorn
+ Follow
since Feb 17, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Scot Meyer

This is the fix for above.
Add to Server.xml
<Resources cached="false" />
Voila! Works fine now...Something about reading the !@$@!# manual...
18 years ago
JSP
Ok, I loaded all the source for tomcat and steped through the page. It appears as though if on a page reload(refresh) the code is called. I put a breakpoint at the earliest point in the tomcat source of the Http11 connector. This is a step after the thread is created.
Whats intereting is if I hit the enter key or retype the url in the address bar the page is not requested again even if I set the caching headers (in the above post). So it must be that IE doesn't resumit a request if it thinks the page is exactly the same (When it obviously isn't)
Im sure I am overlooking something obvious.
18 years ago
JSP
Ok did some additional testing. The JSP is definately not being called when the page is requested a second time. It will be called if I hit the Refresh button. So I am guessing this is an Apache setting. Currently my httpd.conf file states that the file_cache_module, headers_module, and cern_meta_modules are not loaded. Thank again for any help
I meant Tomcat 5.0 not Apache.
[ March 16, 2004: Message edited by: Scot Meyer ]
18 years ago
JSP
I just tried adding
<% response.setHeader("Cache-Control", "no-cache"); %>
<% response.setHeader("Cache-Control", "must-revalidate"); %>
<% response.setHeader("Pragma","no-cache"); %>
<% response.setDateHeader("Last-Modified",System.currentTimeMillis());%>
to my page response and this still didn't fix it. It's as though the servlet is not being called and the information is being cached in the web server. Is it possible that Apache is causing this?
18 years ago
JSP
I have not tried that. Wouldn't the user get a Page Expired message if they chose the back button? Not that this is not desireable. Is this the normal procedure for situations like this? I would have expected that a user requesting a page (servlet) would not be cached but reran.
[ March 15, 2004: Message edited by: Scot Meyer ]
18 years ago
JSP
I have a problem with caching in my new servlet. Currenly I am using Eclipse and Tomcat for development. I noticed that when I request a page the page is compiled and instantiated. The page would get data from the database and display it. I would then goto a new page to update the data expecting the prior page to display it differently. When returning to the original page (without using the back button) the value displayed is the previous one even though it was changed.
I believe this is something to do with caching. I used the praga/no-cache and Cache-control/no-cache headers without avail.
Is this something relating to the fact that the servlet eclipse generates does not contain a getLastModified function? If this is the case how would I go about fixing it? Thank you in advance
I used IE5.5 for testing
18 years ago
JSP
I am so use to doing things the MS way it is sometimes difficult to translate to the Java way. Maybe someone has this answer. In .Net and prior we have things call controls which can be referenced through the objects that contain them. They respond to events and handle their own display. It appears that JSP/Java has similar features such as Servlets, Custom Tags, and objects. I am looking for a good example of how someone would implement say a Tab Strip which can respond to events and can be referenced from the servlet for switching tabs during the business logic portion of the action. Currently my implementation of the Tab Strip is a custom tag which uses session.setAttribute to maintain its state. I believe this is good but I want proof! Thanks in advance
18 years ago
OK, I think I understand given the pseudocode example below how would you tackle this or do I have it all wrong and go back to the manual?

Personally I like the Customer.Current(sess).getAddress method. Thanks for all your help this is clearing it up.
18 years ago
JSP
Well I was trying to avoid a huge Servlet body and employ some code reuse at the same time. I find myself quite often going to the same method to get information about a users detail or current information. I like these types of calls to be fairly small and atomic (to promote reuse). I have used the session object to store session information but am leary about the amount of overhead I want to add to this object (probably because I understand asp session state better than JSPs or would that be Tomcat's?
18 years ago
JSP
In .not I would have used HttpContext.Current.Session... but I dont see any static methods in any servlet or equivalent classes that let me access it in this way. I had originally though well if I used the JspFactory and got the current factory but this didn't work out because I needed a 'this' of course that is not allowed in a static context. Sooo... I thought well if there was a way I could get the current instance from the Thread.currentThread() by casting it or inspecting another memeber.
I guess what I am trying to say is their a way through Thread.currentThread() and casting to get the current response within the stack that I am functioning?
18 years ago
JSP
Wouldn't the current call be still in the stack? For example If the executing servlet made a call to a method then the method would be part of the stack inline with the current servlet. Now passing the request would enable the method to see the current request but I would think that I should also be able to say who was my caller and what information do it have i.e request, response, etc. Sorry if this seems confusing but I am transitioning from ASP.Net to JSP so still learning, Yee haw!
18 years ago
JSP
I am trying to get the current request object within a class that is not a servlet nor a JSP page. I would like to create a static function where I can get the current Session,Request,or Response objects. Is there someway to do this by Thread.currentThread() or ServletContext? A simple example...
public class Current {
public static int UserID() {
HttpServletContext request = Current.Instance.Of.Executing.Servlet;
return (int)request.session.getAttribute("CurrentUserID");
}
}
So I could call...
int currentUserID = Current.UserID();
instead of doing a super long inline statement within my servlet or JSP code.
(int)session.getAttribute("CurrentUserID");
This is a very simplified version of what I am trying to accomplish as more complex versions would allow a object to be returned that may habe many getter methods.
[ February 17, 2004: Message edited by: Scot Meyer ]
18 years ago
JSP