Geoff Tate

Ranch Hand
+ Follow
since Feb 06, 2001
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 Geoff Tate

Take a look at the POI project at jakarta.apache.org - also I remember seeing someone had written some routines to generate a csv file - ostermiller was his name I think. Google that and see if you can up with it. I have used POI and works pretty well. What I did was build some templates in Excel and then used POI to create files from the templates by copying the file and populating the copy of the template. This is with a J2EE app. You can then download the file using a servlet (examples on the 'net abound) to download the csv file.
17 years ago
JSP
Thats what I was thinking but thats a lot of duplication to have an asp for each app that does the same thing. Incidently, sessions are getting mangled without the redirect. Something is up with JRun - I have found people reporting the same problem on the forum. scary.
19 years ago
using jsp/servlet apps on IIS (intranet) we want to be able to capture the currently logged in NT user (NTLM). getRemoteUser() as we all know does not support this. We tried redirecting from a JSP to an ASP that grabs the ServerVariables("LOGON_USER"), drops it in a cookie and redirects back to the JSP. Problem was that the ASP was causing the sessions (this with JRun) to be returned incorrectly, i.e. the clients were getting the wrong session allowing them to see each others data. I also wrote a bean to do a socket connection to the ASP, but an authentication error occurs because there is no way to respond to the NTLM request the ASP requires. We are not fully integrated with AD so LDAP is not a real option at this point. The goal is not to require the users to enter a new set of credentials to get to the apps. Any ideas out there?
19 years ago
the cookie is response level - in the ASP the line is:
Response.Cookies("acct") = someField.
it addes the cookie then redirects back to the jsp page that called it:
Response.Redirect(referer)
19 years ago
JSP
I have come across a funky problem. I have jsp app that is running on JRun. One jsp does a redirect to an ASP which then builds a cookie and then redirects back to the calling jsp. the jsp checks for the presence of that cookie.If it is there it skips the redirect to the ASP and continues. The thing is that different users(browser sessions) are getting the same session back allowing them to see each others data!!! I have tried redirecting to the asp before the session is created and after and the results are the same. I haven't exactly nailed it down...any ideas
19 years ago
JSP
Mark,
the reason is the way java handles strings. When you create a string literal, java adds it to an internal table. Since strings are immutable, there is no need to keep multiple copies of the same data. So since you already created "hello", it is added to the table. "hello" is again looked up and found in the table when you add a reference to b. since a & b now point to the same reference to "hello", they are indeed equal. I believe that if you were to have said b = new String("hello"), then you would have received false because a new strinq object would have been created. There is a little used method on the String object called intern() which would add the value of the string object to the interal string table.
How about automated transaction and persistence services? Rersource management? Yes things aren't all rosy with EJB however the things I mention can all be handled by the application server, freeing the programmer from having to code them.
If you are doing any sort of serious enterprise programming at all you will soon find that putting jdbc calls (or a lot of java code for that matter) in JSP/Servlets becomes an unmanagable nightmare
[This message has been edited by Geoff Tate (edited September 11, 2001).]
Amit,
I think the correct answer is that the all math operands are promoted to at least an int before being used in an operation. The operands are both promoted to ints causing the result to be an int which clearly will not fit in a byte. casting it should work. I don't see what final has to do with it.
19 years ago
10/10 - The app doesn't recover gracefully when I screw around with the query string...
19 years ago
isn't the implementation of .equals() up to the authors discretion? equals should be used for a practical comparison of the class in question. Think of the how the string class implements equals - it tests the VALUE, not the reference. I think the only restriction is that an equals() should test that the comparison is against an instance of the same class that the equals() method belongs to.
for my own programming, the best thing I ever did was start to use the XP method of testing using JUnit. After every change, run your tests. After a while you have a test suite that tests every method, then you can see what was broken by your changes. This is great for developing classes and beans for JSP when you don't have an integrated IDE. By thoroughly testing before you add the class to the web-app u can be assured it is working the way u expect. Be sure to make the test fail the first time you write it so that u can be sure it is actually executing.
the easiest way is to put the properties file in a directory on the classpath of your servlet. Check the docs on how to load properties from a file. The convention is to the name the file something like yourapp.properties.
19 years ago
would you want to extend Thread on every class that may be accessed by multiple threads? This way any class (object) can protect itself from multiple thread access
19 years ago
I did RPG for years - you can't get more procedural than that!
Anyway I found the patterns books by Mark Grand very helpful in not only learning the patterns but also illustrating how OO concepts actually produce a superior product than procedural code. A big help in solidifying concepts was the Complete Java Cerfitication study guide from Sybex.
19 years ago
Yeah, thats what I meant ;-)