Win a copy of Head First Android this week in the Android forum!

Smith Li

Ranch Hand
+ Follow
since Jun 01, 2006
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
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 Smith Li

Hello,

I'm trying to detect user key press by using onkeypress()
that calls this method below. In Internet Explorer everything works great but not in Mozilla.
'event' value is always undefined in Mozilla.
Is there supposed to be an alternative to 'event' in Mozilla.

Thanks.

Is indexOf() in String class expensive operation? Because I imagine for example if a String has length 1000 and the last character is "a".
And I need to find an "a" in the String, it will go one by one until the 1000th character until it finds "a".

Is it better to user JAVA Regular Expression in all cases?

- Rudy -
14 years ago
I'm using MemoryRealm to protect my JSP application.

It works just fine: User will need to enter the username and password in a pop-up box before they can enter the JSP.

My question is:
Is there any built-in capability that I can put in in my web.xml/ somewhere else so that let say after some periods of inactivity, the pop-up box will show up again and the user will be required to enter username and password again?

Thanks.
14 years ago
Yes, I'm using Tomcat. What do you mean by 'container-managed connection pooling'?
14 years ago
JSP
Yes, I'm using Tomcat. What do you mean by 'container-managed connection pooling'?
14 years ago
I have some questions regarding how you maintain connection to the database when building web applications.

1.) What's the best practice to maintain connection to the database to get data from it?
Is it request-scope, session-scope, or application-scope?

2.) Currently I have a session-scope bean that maintains connections to the database. The problem is if I open the browser overnight and the came back in the morning, I get some CommunicationsLinkFailure exception. I think this is because the session has died. How should I handle this?

Thanks in advance for all the help.
14 years ago
JSP
I have some questions regarding how you maintain connection to the database when building web applications.

1.) What's the best practice to maintain connection to the database to get data from it?
Is it request-scope, session-scope, or application-scope?

2.) Currently I have a session-scope bean that maintains connections to the database. The problem is if I open the browser overnight and the came back in the morning, I get some CommunicationsLinkFailure exception. I think this is because the session has died. How should I handle this?

Thanks in advance for all the help.
14 years ago
> Do you have a problem in using log4j in another class say a Servlet?
> is it isolated down to just the JSP?
Just the JSP

> You have defined loggers in the file for ClassA and ClassB, not for
> Application.
Sorry, it supposed to be:


The JSP doesn't give any error but it doesn't seem to produce the log file.
14 years ago
JSP
Hi, I'm trying to understand what needs to be done if I want to use log4j in my JSP pages. I tried to do this below but nothing is being generated.
Could someone please advice whether I'm missing something?

1.) I have log4j.properties located inside WEB-INF/classes:
--------------------------------------

--------------------------------------

2.) In my JSP page, this is what I have:

--------------------------------------

--------------------------------------
14 years ago
JSP
Can JAVA be used to uncompress RAR file?

Thanks.
14 years ago
Based on my testing, no IOException is thrown.
14 years ago
How about 'Fallback Mechanism' described in this article?

http://e-docs.bea.com/wls/docs100/security/thin_client.html#wp1055606

I tried putting "DIGEST,BASIC" in the auth-method but doesn't seem to work..com/wls/docs100/security/thin_client.html#wp1055606

[ August 15, 2007: Message edited by: Rudy Rusli ]
[ August 15, 2007: Message edited by: Rudy Rusli ]
14 years ago
JSP
Is there anyway in a web apps I can assign two different authentication methods for different pages.

Let say I have test1.jsp and test2.jsp

For test1.jsp I need to require user to use BASIC authentication
But for test2.jsp I need to require user to use DIGEST authentication.

How do I handle this? Is it in my web.xml? If it is, how do I set it?

Thanks in advance for all the help.
14 years ago
JSP
I'm providing a JSP page to our clients.

In order to provide better control, I'm trying to find a way to detect the last IP address that accesses the page. Is there anyway I could do this using JSP?
14 years ago
JSP
Thanks for the reply.

I'll do some testing.
14 years ago