Varun Narang

Ranch Hand
+ Follow
since Nov 19, 2004
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 Varun Narang

Thanks for writing the book, looking forward to learn much from it.
6 years ago
Hi,

This always kept me wondering as in how do I debug a code written to run parrallely. While normal debugging technique using an attached debugger holds the program in a place, it doesn't really behave 'concurrent'. Are there any rules of thumb, which one need to keep in mind while trying to troubleshoot such a problem.

Best,
Varun
6 years ago
@David, Thanks for the advice, I'll keep that in mind.

@Rob, I was thinking in the similar direction, Thanks for confirming. This is more of a 'obey the contract' problem than a programming puzzle.

Thanks once again.

Regards,
Varun.
7 years ago
Hi all,

I was trying and not able to understand the behaviour of code that'd satisfy the multiple inheritance for following case;



If any once can please explain the behaviour and implementation in respective cases, it'd be a great help.

Thanks & Regards,
+ Varun
7 years ago
Krish,
You might want to read more about Session Objects in Java-Servlet, as they store the information on the session basis and not on the per-page basis.

HttpSession

Regards,
VaruNarang.
[ October 18, 2007: Message edited by: Varun Narang ]
10 years ago
JSP
Hi,
Who says you can't initialize anything in Servlet'Constructor, only thing is that you won't be able to take advantage of some of beautiful features of the Servlet API, such as access to ServletConfig object. In that case you'd want to access the parameters from database/flat-file and not from web.xml initialization parameter.
Another reason for using init() method is the Servlet-Lifecycle, in which, the init method is called just before the first request hits the servlet. So, this method just saves you from doing the things too early in the whole cycle.
You can also define an overloaded constructor for the servlet, only that it'd never be called, as per the servlet specification.

Hope that makes sense to you.

Regards,
VaruNarang.
10 years ago
Hi Kalpana,
You might want to google for SAX and DOM parsers. A simple search will give you far more than you need.
How about writing to a response stream, and it could be, virtually, anything you want.

Regards,
VaruNarang.
10 years ago
Hello there,
Since redirection of the request creates a new request and sends it to the path you specify in the sendRedirect method, you'll not be able to retrieve the request/form-field values in the next servlet. So, before you redirect you need to fetch all the necessary information you want to save and put it in session or application scope (setting session/application attributes may help), based on the requirement.
You can try putting the required values in a Map or something like that and store it in a session/application object by calling setAttribute() methods on them.

Hope this will help.

Regards,
VaruNarang.
10 years ago
Hi all,

I got the reply to my problem,
I used following snippet in my build.xml to load the properties file:



This, by default, loads the build.properties file, but if the propertyfile switch is present, then it overrides the above snippet.

Regards,
Varun Narang.
11 years ago
Hello all,
Actually, I am creating a build for 3 servers, DEV, QA & LIVE, for these three, I've different properties files but same build file (build.xml). Now I want that if there is no parameter supplied for the -propertyfile, then it build.xml should consider the configurations from dev.properties file, else it should configure properties from the supplied property file name.

If someone is able to help me with the same, I'd highly thankful to him/her.

Best Regards,
Varun Narang.
11 years ago
Hello all,

I am in process to create a new application, My requirement here is that I want to create a reusable module that I want to use for authentication & authorization. Further I want that when ever a user logs-in, his/her privileges get stored in the session and based on the data stored in the database s/he should be able to view the page and event the fields/components on it.
Can any one help me with the design of the above requirement or at least point me to some link.
Thanks in advance for the same.
11 years ago
Hello all,
Can someone point me to java middleware which sounds-like 'ICON'.
Thanks in advance.
11 years ago
I have 2 problems, I am seeking your help for...

1)
I am not able to fine the Enum AccessType , neither in the api-doc nor in the lib.
Can anyone help me to find out that which library shall I look for the same.
================================================================

2)
I am facing a problem while extracting data thro' EJBQL,
when ever I try this, I get an exception TABLE NOT MAPPED.
Can anyone tell me what exactly is not mapped. Although I am able to store the data in the database thro' EntityManager.persist(Object) method.
I am using jboss-4.0.5 (Hibernate for persistence) and Oracle 9i.


Thanks a lot for the help.
Hello everyone,
This is a little strange problem.
I've written some source code in Java using Eclipse and I am running it thro' Eclipse. When and if a NullPointerException is thrown, Exception log gives all information about the line which threw the Exception and all.
Now I create a Jar file of my compiled files and put this jar into the classpath, But now if there is NullPointerException, then all it says is
NullPointerException <<CLASS-NAME.METHOD-NAME>> (unknownSource), when run.
Can anyone suggest any idea of how to print the exact line no. which threw the Exception.

Thanks a lot for the great help.
Regards,
Varun Narang.
11 years ago
Certification vs. Experience:
Even though, I completed my SCJP certification when I was fresher, I strongly disbelieves in the idea that certification can ever be an alternative to the hands-on experience. These both are separate things and can't be compared. In case of certifications, this is just another way of saying that you know the things when you are being interviewed. But, doesn't say that you can solve the real word problems instantly and you can design the solutions for production systems. What I have concluded so far from my experience that:
--> Certification makes you familiar with the technology,
--> But, experience tells you BEST PRACTISES, and optimal solutions for real word and production system problems.
So, both are good in their own place.