Win a copy of Spring Boot in Practice this week in the Spring forum!

K Nally

Greenhorn
+ Follow
since Sep 30, 2003
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 K Nally

Hi:

Speaking of writing wsadmin scripts, I am encountering a problem on only one cell using the $AdminControl stopServer command. I am receiving the following error:

javax.management.ListenerNotFoundException: Did not find listener com.ibm.ws.scripting.AdminControlClient@4464c914

I can issue other $AdminControl commands such as getCell, getHost, etc. Again, it is only on one cell - the other three cells work.

Anyone out there experience this one? Thanks very, very much.

Karen
17 years ago
Try using the Request object instead of the ServletContext:

RequestDispatcher dispatcher = request.getRequestDispatcher(page);
dispatcher.include(request, response);

This worked for me.
17 years ago
Hello:

Does anyone know when javax.servlet.http.HttpSession.getValue(String) (deprecated in version 2.2) will be formally "dropped" i.e. no longer available for use?

Thanks.

Karen
17 years ago
What would make a session.setAttribute() work on one server, but when moved to another server, it suddenly returns null on a session.getAttribute()? This is occuring in a JSP. The exact same code is executing in both places and we are running with WebSphere 4.0 z/OS and the settings for sessions is the same in both configuration files: session.enable=true

Thanks.

Karen
17 years ago
Thank you Paul and Bear. Currently the class only makes sense in the web environment. However, I think the idea of keeping it a non-servlet is a good one. I will have the JSP access the ServletContext for the attribute and use a setter method in the Java class to set this parameter.
Thanks for your help.
Karen
18 years ago
Hi:
I have a JSP that instantiates an object from a Java class. I now need to pass a parameter from a properties file to the Java class, but I realize that the Java class has no access to the ServletContext (a good and a bad thing I guess). Is it wise to import the servlet package into the Java class? Would it be better to create a method in the Java class that sets this parameter and let the servlet access the ServletContext for the parameter? Any other ideas?
Thanks much.
Karen
18 years ago
Hi:
I have a basic question on when memory is allocated for an object and if that memory is "shared" between the class that instantiates it and the class itself. I am using "class" and "objects" interchangeably here.
In the following example, do we have one memory allocation of Statement st or two memory allocations (myServlet's and DBConnect)?
myServlet:
DBConnection dbconnect = new DBConnection();
Statement st = dbconnect.setConnection();
Java Class:
public class DBConnect implements Serializable {
private Connection conn = null;
private Statement st = null;
public DBConnection() {
}
public Statement setConnection() {
<other statements>
conn = ds.getConnection(...);
st = conn.createStatement();
return st;
}
}

Thanks!
[ January 30, 2004: Message edited by: K Nally ]
[ January 30, 2004: Message edited by: K Nally ]
[ January 30, 2004: Message edited by: K Nally ]
18 years ago
Thank you so much!
18 years ago
I know. Java is strictly typed. However, I have an int that needs to be a String. Does someone have a way around this?
Thanks.
Karen
18 years ago
I found the tag that will prevent browser caching:
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
I added it and this fixed by session variable problem.
18 years ago
JSP
Bear:
It was a caching problem - not at the webserver, but at the browser. I didn't realize that browsers cache .jsp pages also. I guess a good practice may be to add a unique value on the post parameter after the URL?
Thanks.
Karen
18 years ago
JSP
I have two JSPs and one Class file that is serializable (I call that my "bean") that I use to store values for JSP #1 and JSP#2.
JSP #1 sets a value in my "bean" using a setter method. It does not matter that the value is char, string, or boolean. The user can click on a hyperlink that passes a value back to JSP #1 - and, as a result, I reset the value using the setter method. So far, so good. Now, the user clicks the hyperlink again, so I pass a different value back to JSP #1, and again, I reset the value in the bean. We do this two more times before the user hits the update button and I go to JSP #2 - BUT the value in the bean is the PREVIOUS value - not the one I just set.

In short: this is the sequence:

JSP#1
value = "current"
JSP#1
value = "next"
JSP#1
value = "current"
JSP#1
value= "next"

User presses UPDATE to go to JSP #2. The value JSP#2 picks up is "current". If I hit the "refresh" button before the UPDATE button, the value is CORRECT! This is driving me nuts!

Here is my bean setting in JSP#1 and JSP#2:

<jsp:useBean id="mySession" class="SessionBean" scope="session" />
Thanks for any assistance.
18 years ago
JSP
Is there a way in Java to display everything that is going on during the execution of a Java program? I have a Java program that is accessing a 3rd party's APIs and I'm encountering non-Java errors. Is there a verbose debugging command?
Thanks.
K
18 years ago