Steve Dyke

Ranch Hand
+ Follow
since Nov 16, 2004
Cows and Likes
Cows
Total received
1
In last 30 days
0
Total given
0
Likes
Total received
7
Received in last 30 days
0
Total given
14
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Steve Dyke

I am trying to iterate over a linked list but have not got it to work. Compile error on the 'For' line.

My code:

3 days ago
I have the following code which produces the following:

875987-405
875987-405
875987-405
875987-405
875987-405
875987-405
875987-405
875987-406
875987-406
875987-406
875987-406
875987-406
875987-406
875987-406
875987-406
875987-406
875987-406



What I need is this:

875987-405 7 Ea
875987-406 10 Ea
1 month ago

Bear Bibeault wrote:The JSP source is, er, uninteresting unrevealing. Inspect the option elements in the browser Dev Tools to see what actually ended up as the options' values.



Found this and is seems to work. Thanks for heading me in the right direction.

Bear Bibeault wrote:The JSP source is, er, uninteresting unrevealing. Inspect the option elements in the browser Dev Tools to see what actually ended up as the options' values.



This is the browser dom out put when viewing with the Dev Tools.

It looks like the double quote is being separated from the rest of the value.

Bear Bibeault wrote:You know we need to see the code for your dropdown to help... (Bear gives his best Dad look)



I have a select list with an option value of IV3-1/4"

But this code returns IV3-1/4

Ron McLeod wrote:There is probably a pure REGEX way to solve the problem, but this is how I would tackle it:
Edited to fix code typo



This would solve my challenge but we are not using Java 8 yet. Thanks.
2 months ago

Carey Brown wrote:I think that the OP knows the set of patterns he wants to accept and wants to reject everything else. Therefore we don't know if "WXYZ" will appear, or "ABCD", but if it's not one of the accepted patterns then don't include it. I can't think of a way to do this with replaceAll().



Yes, you have correctly interrupted my challenge. I will try your previous solution. Thanks.
2 months ago
This is an example of one of my strings:

SEAT AY-AAR CTR IAT IVS TPL

This is what I would like my result to be:

CTR IAT IVS TPL

My code:



Results I am getting:
SAT AAAR CTR IAT IVS TPL
2 months ago

Tim Holloway wrote:J2EE sessions work like this:

But if I open 3 Edge windows, they'll all be using the same cookie pool, so all of the windows will be talking to the same session. If one window logs off, the sessionid is now invalid for all 3 windows.



This is my situation. What if any is the best way to deal with this?
3 months ago

Tim Moores wrote:By "instance" I assume you mean "browser window connected to the same web app". It sounds as if you're talking about sessions being invalidated. Why do you need separate session for the same user?



Yes I am talking about sessions, and I do not need separate sessions for same user.

Normal application behavior:
In my web application I have set up certain criteria for invalidation.
….

Now from the users perspective:
I open an instance of the web app - all is good.
For some reason I decide to open a second instance of the same app - again all is good, at least for a bit.
Now thru my normal app process the first instance invalidates.
Oh no, since both instances share the same session handle the second instance invalidates also.
3 months ago
May be wrong forum. If so sorry.

In my web application I have set up certain criteria for invalidation.

If a user opens two instances of the same application on the same machine once the first instance invalidates
the second instance invalidates also.

Is there a way to handle this?

I would like to limit the user to one instance but from what I read that is discouraged.
3 months ago

Bear Bibeault wrote:Why the response wrapper? Just use a straight-forward servlet filter.



Articles I read said the response may already be configured and the setting not incorporated if not do this way.

Can you answer another question for me? If I am checking for session = null how do I still get an IllegalStateException on the line session.invalidate()?

3 months ago

Tim Holloway wrote:First you need to find out why all those sessions are alive at the same time. Do you have actually that many online users? If so, they may be legitimate and the only real choices are A) IBM (Install Bigger Memory), B) reduce the amount of session data being used by the offending application(s), C) Change the apps to minimize their use of an HttpSession environment (if you're using container security, that basically means making pages that don't really need the user to be logged in be unsecured - or Just In Time Login, if you prefer. D) Run a cluster. E) Convert to ReST (which is item B carried to its logical conclusion).

And F) Are these active users, or should you shorten the session timeout to drop people who left the site without logging off?

You might want to add Session Listeners to log the start and stop times (and thus durations) of the sessions, and at destroy time, look at how many/how big the collection of session-scope variables hanging onto it is.



A couple of things I have done is increase the Heap Size to 7G. I am working on code to invalidate the session if idle for a specified time.
I am using Session Listener also.
So the invalidate fires either automatically(inactivity), when the user logs off(does not shut the application down), and when the page is actually closed.

However, when either of the first two fire do I just loop back to the initial application start up?
3 months ago
I am wanting to move some repetitive code into my filter.

In every doPost method of each Servlet I have:



Here is a part of my Filter code to do this. I just want to know it this is the correct way:

3 months ago