This week's book giveaway is in the Java in General forum.
We're giving away four copies of Helidon Revealed: A Practical Guide to Oracle’s Microservices Framework and have Michael Redlich on-line!
See this thread for details.

Scott Maclary

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

Recent posts by Scott Maclary

Sure, it could. In most real-world systems, people assume that situations where two clients are going to attempt to register the same user at exactly the same instant will be extremely rare and (therefore) not worth worrying about.



This "should" be extremely rare...except we are seeing it on our system with 5 million users. The USERS.TIMESTAMP is always the same so my guess is that their browser goes into some crazy state making the same request over and over again within an instant.

If I moved the two statements into a stored procedure - would this help?
I have a struts action "CreateUserAction" which calls a DAO method "createUser" method which contains two SQL statements:

SELECT * FROM USERS WHERE USER_NAME=?

(if it does not exist)

INSERT INTO USERS ....

My question is, couldn't the DAO method "createUser" thread stop (sleep whatever) right after the "SELECT * FROM USERS WHERE USER_NAME=?" for a brief moment before running the "INSERT INTO USERS ...." SQL executes...meaning that another user could come along and register with the same USER_NAME before the "INSERT INTO USERS ...." runs?

This would result in duplicate users with the same USER_NAME.

Is my threading assumption correct?


PS - I can't put a database UNIQUE constraint on USERS.USER_NAME.
Just wanted to get my fellow ranchers' opinions - how valuable do you think CA SiteMinder knowledge/experience is?

I ask this because I've spent the last year working with the product and I am wondering if it adds any value to my resume.

Have you all been on projects using this product before? What are your thoughts?
16 years ago
If I have the following entry in struts-config.xml:



...what page will be displayed when the url is "login_page.do"?

I can see what would happen if someone were to submit a form to this URL how it would react (code would be processed and if there was a "failure" it would display the "Failure" case - same with the success case).

But what about just displaying the url which maps to the action (without a post to the action)?
16 years ago

2. What is the government of US and big companies are doing to rescue the economy and the dollar value?



Nothing. They are letting the value drop until we see a reverse trend, Indian/Malaysian jobs being outsourced to the United States.

5. Outsourcing of IT jobs to emerging countries � Will it increase or decrease?



See answer above.

Keeping one's skills/knowledge/experience current, relevant, and sharp is the way to have a real IT job security in uncertain situations like this.



This is the only real way to ensure success.
16 years ago
How much of a performance hit are we talking when doing a JDBC lookup versus a properties file lookup?

We have a simple property that needs to be looked up, either from the database or a properties file. A lookup on the file system is probably faster than a JDBC lookup, but the question is is it worth it?

We have 8 app servers - so that means one change to a property means updating 8 files (one on each server). Whereas if we put the property in the databae we only have to change it in one spot.

In my opinion, the slight performance hit associated with the JDBC option is worth it to avoid maintaining 8 files. What do you all think?
17 years ago
I am developing a typical Web Server to App Server to DB application for a small business that will have a few hundred users logging in through the web. We won't have a ginormous budget...is there an "unlimited users" license that I can buy within a reasonable price? If I am looking to install the network deployment, according to this page,
it is going to cost me 155 per user...obviously with 300 users this could be prohibitively expensive fast.

Am I wrong in what I am defining as a user?
17 years ago
It's because I am stuck with somebody else's code...which I don't have the authority to rewrite in full. When a page breaks here or there or we need a fix here or there I can then update that page or module...but since it's already using a bad design (tons of business logic in JSP, Scriptlets mingled with JSTL, disastrous HTML) and I can't just redo the whole thing...I would like to slowly switch it to good design. At this point I guess you are right...flushing the buffer using JSTL instead of scripltets doesn't buy me anything but I am kind of not sure how we'll ever get the site to using a good design.

Its kind of like walking into a house that is (or should be condemmed), and trying to fix one board...when you remove that one board to fix it...the whole thing could come crashing down...and the people inside the house (customers) can't understand why it came crashing down and assume that you broke the board.
17 years ago
JSP
I know from a scriptlet I can do this inside a JSP:




...but I'd prefer to stick to JSTL or EL. Any suggestions?

Thanks,
Scott
17 years ago
JSP

You seem (rightly) concerned about the design badness of mixing JSTL and scriplets, and yet you seem cavalier about emitting HTML from inside beans. Strange dichotomy.



I know this is a strange requirement, but we have some very complicated logic that is difficult and time consuming to trace. Every time we see this one scenario happening that we don't want...we find ourselves running query after query to debug and find out why it is happening. I thought it would be easier when certain conditions are met just show why they are met by printing out certain DB flag values in the comments.

Why do you feel the need to emit HTML from code? Do you have a good reason to not employ a custom tag file for such purposes?





We are using an ancient app server and we've seen performance issues from custom tags. I can't explain why but I would be willing to guess it has something to do with how old this app server is.

Perhaps a little more info on the scenario would help clarify...



I didn't design this...if it were up to me, all the logic would be done in a controller and the JSP would just have to display stuff. But...I inherited it like this...where the JSP is responsible for a lot of the business logic.

Can you give me an example of a setProperty where it is passing in an object?
17 years ago
JSP
I have a JSP and a Java Bean (class). In this JSP I have some values that are already available to me via JSTL. In the Java Bean I would like to be able to access the "out" PrintWriter object to print out some html comments to the users.

So how do I include the Java Bean on the JSP page? If I use useBean, I can't pass the bean the "out" object (since setProperty only takes Strings). If I revert to scripting...I'll have this ugly combination of JSTL and scripting. Is there any other option?

Thanks,
Scott
17 years ago
JSP
Is it considered bad practice to mix JSTL and scriptlets? For instance the following code appears to work fine:



...but are there situations when this could NOT work?

Thanks,
Scotty
17 years ago
JSP
I have a large static html page that never changes and needs to be on the web server instead of the app server (where it currently resides).

The problem is the main page, header, footer, sidebar and a couple of other included pages are all dynamic JSP pages. So...how to I do include a static html page that resides on the web server from a JSP page on the app server?

I have read other posts where they suggested c:import and I tried that...but I am getting an error "java.io.IOException: Server returned HTTP response code: 403 for URL: http://urltowebserver/index.html"

Is the standard practice to use c:import? If so, what was the standard before that tag was avaialable because it hasn't been around that long...?

Thanks,
Scott
17 years ago
JSP
So is it considered bad practice to include HTML in your custom tag?
18 years ago
JSP
Bear,

I know the post is old...but I have a question. You wrote:

... would be more like



which would do the appropriate thing depending upon context. The distinction is that from the page-point-of-view, the do-I-include-it-or-not decision is completely abstracted away.



I like abstracting things ...but then where is the jsp to include this page? Do you actually write out the html/jsp from within your custom tags using out.print statements? That doesn't seem right...
18 years ago
JSP