Jesper Ottosson

Ranch Hand
+ Follow
since Mar 21, 2000
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Jesper Ottosson

In Java, is there any equivalence of ASP's Server.HTMLEncode method, which replaces a strings all special characters to their html counterparts (e.g "<" to "<")?
btw, yes, I know I could do it myself, but... I don't wanna
/ Jesper
23 years ago
JSP
You'll have to use JavaScript to capture the event that the browser is closing, and make it request some jsp page which tells your system that the user has logged out.
It's not a very good solution, since it's pretty browser dependent, and probably it could be solved by designing your application in some other way.
23 years ago
JSP
Perhaps this is precisely what you're trying to avoid having to do, but if I were you, I would query the database for the raw date column, then use ResultSet.getDate() to get the date, and then format it manually.
I hate it when my INSERT statements become horribly long. One thing that would solve this is querying for an empty updateable resultset from the table i want to insert into, and then use the update methods to specify the values (after doing a moveToInsertRow)
Is this a good idea, or does it have serious performance implications?
/ Jesper
I am using ResourceBundles for multilingual support on my site, and all text is in properties-files in the WEB-INF/classes directory.
My problem is that when the files are changed, the change isn't reflected on the page until some page has to be recompiled, and this doesn't necessarily happen after the file has been edited. Is there a way to tell the JSP-server to reload my classes directory when it's been updated?
btw i'm experiencing this on both Tomcat and Resin, newest versions
Thanks
Jesper
23 years ago
JSP
If you really need to use the clone method, I believe you will have to do some manual construct, but otherwise there's the handy System.arraycopy()
// Jesper
23 years ago
I'm not sure this is related, but perhaps it could give you a hint: when i've opened text-file resource's i've done it with an absolute resource path:
InputStream in = this.getClass().getResourceAsStream("/text.txt");
notice the /
// Jesper
23 years ago
I understand what you mean, but i can't see any way at all of making that look good... really, i have to have tabs that look pretty much like tabs in Swing or in Windows
23 years ago
I'm working on an applet which can't use any Swing components, and I need some component that does quite the same thing as JTabbedPane, but I seem unable to find one. Is there really no such thing in AWT, and what am I supposed to do then?
23 years ago
ok, im not really sure about this, but paint() is the old AWT method, which you shouldn't use if you're using Swing. In swing, this method calls paintComponent(), paintBorder() and paintChildren(), so if you wanna do custom painting, you should override paintComponent
24 years ago
I have recently started to learn about JavaBeans, and tried out the Beanbox today. I have experimented a lot, but I can't get even simple examples like stoping the Juggler with a button to work. When I connect an ExplicitButtons's actionPerformed-event to the Juggler's stopJuggling method, I get a messagebox that says "Generating and compiling adaptor class" and then nothing more happens, and I have to close the messagebox manually. When I disable design mode, the button doesnt work.
What am I doing wrong?
btw, im using win2000 and jdk1.3
I have recently started to learn about JavaBeans, and tried out the Beanbox today. I have experimented a lot, but I can't get even simple examples like stoping the Juggler with a button to work. When I connect an ExplicitButtons's actionPerformed-event to the Juggler's stopJuggling method, I get a messagebox that says "Generating and compiling adaptor class" and then nothing more happens, and I have to close the messagebox manually. When I disable design mode, the button doesnt work.
What am I doing wrong?
btw, im using win2000 and jdk1.3
24 years ago
save the state of the list in some Map or List somewhere, then add a MouseListener to the JList, and when you detect a mouseclick, use JList.setSelection() (I think that's what it's name is) to set it back to normal again.
Ehrr... perhaps this isnt the most beautiful solution, take another look through the api-docs before you do it
24 years ago
just use a FileInputStream to read in the lines, then compare them to the method names in a giant if-elseif statement, and call the proper methods inside this. I don't think there's an easy "magic" way of doing it, you have to do one if per method... well perhaps if you look through the reflection api (java.reflect), you may find something... the stuff there sure is magic.
24 years ago