Jamie Williams

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

Recent posts by Jamie Williams

I came in to work this week and all of a sudden I'm getting data truncation errors from my MySQL database that are throwing SQLExceptions. The code hasn't changed, I've check code that works on another database with identical table structure on another server, and I'm getting the same problem. Everyone says they haven't changed any settings on the MySQL database but I'm getting these problems nonetheless.

Does anyone have any idea what could of happened? Or is one of my colleagues try to cover up a mistake they made...?
No one has any ideas? Here's the code:

First form, with checkboxes and button to submit:


Second form with selectOneMenu and valueChangeListener:


Please help, this is driving me crazy!
[ September 07, 2006: Message edited by: Jamie Williams ]
18 years ago
JSF
I've had one form with all the controls for the details to/not to show in a dataTable on a page, including multiple selectOneMenus and checkboxes and a button to press to show the data with the current settings. Now I have to move these controls to different places around the page and have them update the display every time a value is changed, with no button to submit the form, so I'll have to rely on '0nchange="subm1t()"' with every control. Not my choice - my boss's.

I tried moving one of the controls into another form but it causes all of the other values (for the controls in the original form) to go 'false' or null/unset. All of these values that define what's being shown is in a single bean - why is it changing the other values?
18 years ago
JSF
I need to display some float information in input boxes with the format 0.00000 - even if the actual value is 0.1 it has to show 0.10000 but this obviously isn't the default behaviour. A converter will only work on the form submission, right? Is there something I can use to format the float value when I fetch it? I would prefer not to have a formatting-related method in my data object (which is what I am forced to have now).
18 years ago
JSF
Thanks for that Ulf, I understand now what the problems would be.

You are right, for my application the sessions don't need to survive a server restart, and the users can easily login again. I won't be using clustering at all, so I should be fine.

Thanks to all for their help with this issue!
18 years ago
JSF
Most of what you implemented sounds much more advanced than anything I can produce right now, I've only been working with JSF & J2EE for a few months and haven't had time to look into design principles or whatever. Everything here is very rushed. I wanted a week to do memory profiling and to fix some things up before I expanded on the application, but I was told there was no time

The flaw you fnd with the basic idea is something I specifically want. This is a business setting dealing with important data and I don't want people to use eachother's accounts - yes, I am talking about a second person logging in from another terminal at the same time. They are not supposed to be shared, our clients should ask us for another account if they want someone else to be able to use the system at the same time. It might sound like an odd way of dealing with the issue, but it also solves the problem of getting rid of sessions for the same account where people have just closed their browser without logging out, then open another browser 5 mins later and try to log in again.

So... I 'm pretty much set on this idea but I need to know, will I really run into problems with storing the HttpSessions, considering that I won't be clustering?
18 years ago
JSF
If the cancel button doesn't need to do anything with the form information, I think you could just include it in a separate form, then the other one wouldn't need to be processed.
18 years ago
JSF
Haha, no worries, thanks Tim
[ August 03, 2006: Message edited by: Jamie Williams ]
18 years ago
JSF
Thanks Ram, those are interesting ideas and I have considered the DB idea before but my users need longer sessions and I want to 'bump off' the currently logged in person when another person logs in with the same id (partly a deterent to using eachother's accounts!). The only way I can think of this is with my current solution to keep track of the session and then invalidate it.

Can you tell me if I will have any problems with this under Tomcat, without using clustering? Can you suggest any precautions I should take for any problems?
18 years ago
JSF
Thanks for the info Tim.

I would like to use CBS because it seems alot simpler, but as far as I can see it won't allow me the level of control I can get with a custom solution. The requirements for this project include the ability to very, *very* finely tune what people can and can't do.

When you say you "wouldn't recommend trying to serialize/deserialize the actual Tomcat HttpSession objects", are you suggesting that I just shouldn't go with my application-scope bean storage idea at all (we won't be using clustering for this app)? It really seems to be the answer to my problems - do you have a better idea for how I can achieve the same result?
18 years ago
JSF
Ok thanks, I'll look into that!
18 years ago
JSF
Great, thanks alot for those pointers! My filter is finally working now!
18 years ago
JSF
Thanks for the reply Ulf!

I'm using Tomcat 5.5, here's my filter stuff in web.xml:



Pretty simple... I don't know what <dispatcher> is for, should I be using it?
18 years ago
JSF
I have a filter which I want to check to see if the user is authenticated every time a page is requested from within a specific url '/pages/*' and if not redirect to '/login.jsp'. I've written a filter which works and applied it to the url but the first time I request a page it doesn't check.

My welcome page is '/index.jsp' and it just contains a jsp:forward to '/pages/main.jsp'. The filter should apply to the request for 'main.jsp' but it doesn't. The page loads and only when I try to go somewhere else or reload the page do I get redirected to 'login.jsp' like I want to. I don't think it has to do with the jsp:forward because I can type in a url for a specific page that should cause a redirect but the same thing happens.

Does anyone know why this isn't working?
18 years ago
JSF
Thanks for the info, I'm not sure I understand it though... I don't know what clustering means in this context - so I'm pretty sure I'm not doing it

My sessions are stored in the application-scope bean and removed when the user logs out or is 'bumped off'. I have a crude working example of this already working, and I haven't had any problems yet. If I'm not clustering do you think I'll be ok? I need to be able to support about 20 sessions at a time, maybe more.
18 years ago
JSF