sachin pathak

Greenhorn
+ Follow
since Jun 05, 2002
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
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 sachin pathak

Hi,
I am not sure whether this is right thread to ask for some help. Since this topic( threading and related issues for an EJB environment) is very important, can somebody point me to a resource which discusses this thouroughly?

thanks in advance

Sachin
Hi all,

I am debugging a web application from inside eclipse. I have written a servlet which has following piece of code inside the doPost method.


RequaestDispatcher's forward is forwarding to another simple JSP which renders HTML.
When debugger stops at breakpoint1 I do not see any output in the browser, but when debugger completes the execution of the breakpoint1 and stops at breakpoint 2, the response is flushed and I see the output in the browser.

My question is, if that is happening, that means, after the request was forwarded to the new request handler, it must spawn another thread to service that request, in other words, response is being commited in another thread.

I am confused because of this peculiar behaviour, can anybody comment on the exact behaviour ??


Thanks in advance
Sachin
[ June 08, 2005: Message edited by: sachin pathak ]
15 years ago
How much time will it take for the book to be available in India once its out there in States ? Last time it happened only after 5-6 months. I wish this time its less.

Sachin
I have created a TextField (NumericTextField) component which allows only numbers to bt typed in. Using this component I have created a TAbleEditorComponent (EvenNumberEditor) which allows only even numbers to be entered. I install EvenNumberEditor as a default editor for a testTable componenet which extends JTable.

This code is supposed to allow entry of only characters when the editing starts in the first column (0th) of the JTable. Evrything works fine if you properly invoke editing by either pressing f2 or by double-clicking on the Table Cell.

But problem arises when cell has focus, but editubg has not started and user starts typing directly. The NumericTextField seems to be not working. The TableCellEditor invoked is not using the NumericTextField component. User can type even text also for the field.



Can somebody please help out ??

Thanks in advance
Sachin
16 years ago
Hi all
I am trying to implement a table with alternating row colors. For the purpose I have written following code

The problem with this code is as soon as I set the renderer for boolean fields to my custom renderer it starts showing values tru and false instead of the check boxes. I have not even over -ridden the method getTableCellRendererComponent(...) (please notice that I have commented it out in the Boolean renderer.). The same thing happens for the Iteger renderes as well, instead of showing the default right alignment it starts showing the left alignment for the text.


Can anybody spot out where I am goinf wrong ?

Thanks and regards
Sachin Pathak
16 years ago
Hi there
Hope follwing code inside the class implementing applet helps.
16 years ago
Hi

I need to allow only English character input in JTextField. Can anybody help. The complexity is increased because the Text can be pasted also in the textField. It is ok if anybody knows how to disable the paste action for the JTextField.

Thanks in advance

Sachin Pathak
16 years ago
Hi
I am working on a application which uses log4j for logging. log4j uses a properties file from which it reads file path to which it will create a log file.


If I am running applicaiton on Linux then the path needs to be given as for eg. /export/sites/finselect/webapps/finselect/logs/log and if I am working
on Windows it needs to be specified for eg. C:\\webapps\\finselect\\logs\\log.

Is there any way I can use equivalent of File.separator constant in properties files so that I will be saved to maintain two diffrent versions of file for 2 operating systems.

Sachin
16 years ago
Hi all

How do you get the server IP address from inside the servlet?

Thanks in advance

Sachin
16 years ago
Thanks for the reply. I have thought about doing the same initially, but the problem is since I am using a contextListener, I can throw only exceptions defined in the interface. So defining the instnace like below is not compilable.

Moreover, I dont want to mark a single servlet as unAvailable, I want to marrk all the servlets in the application as unAvaialable, i.e. I don't want the application to be available in any form further.
COnsider a scenario like this, I am initialising a connection pool for use in the web application and the username password used to connect to DB are being read from the web.xml file as context init params. I need to ensure that before the connection pool is created I have a valid username and password combination. If the user name password is not correct then there is no point in going further and deploying the application.
I check the validity in the listener listed above. Now if the username password is incorrect I want to stop the application deployment process itself.
Hope this has clarified the requirements.
Sachin
16 years ago
Hi all
I have written a web application. I have configured a ServletContextListener and I am checking some of the initial context parameters in this for validity. If I found that some of the context parameters have inhvalid values then I want to stop the further deployment of the application and mark the web app as unavailable. How do I do this.
I am using Tomcat 5.0.18, and JVM is Sun Microsystems 1.4.2_01-b06.
TIA
Sachin
16 years ago
Which forum is most suitable to discuss the design issues related to web applications ? Could any of the bar tenders please guide me on this ?
TIA
Sachin
16 years ago
Hi,
I want to implement following functionality. I have an application where there can be number of users logged in at a time. Now we have a special user called as Admin. We need to provide a way for admin to logout the other users. We are storing the user authentication information in the session for every user. So one of the way is to get all the session objects and invalidate the ones which satisfy certain condition. How do I do this ?
In other words I want to get the HTTPSession objects for all the sessions currently maintained by the server.
Thanks in advance
Sachin
16 years ago
How do I get value of a system variable TOMCAT_HOME from inside the servlet. To generalise the question I would say how do you get the value of any environment variable defined by the system
16 years ago
I am removing the object from the session before I am invalidating it.
I am using a value object of type Member stored in the session. Member class has a method called isAdmin which decides whether the user is admin or not ! We are also checking the validity of the user in actual delete action code. But the main problem is in spite of invalidating the session, the admin object can be retrieved from the session. This is a real pain in wrong place.
I searched the web for the problem and it seems that this problem is prevailent all over the world but no body has suggested a solution and also nobody is knowing why this issue occures.
I am pasting some links below to give the gravity of the problem. Javaranch itself has discussed the problem in past quite a few times but no body is sure why this happens. Please visit
Click Here for link 1
If anybody knows the issue please help.
Thanks in advance
Sachin
16 years ago