Aditya Vasudeva

Ranch Hand
+ Follow
since May 27, 2008
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
(keep public parts private until JForum day)
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt
Moderation Tools

Recent posts by Aditya Vasudeva

Is there any way of controlling the back button in any browser using javascript?

What I mean is, can I make the browser automatically redirect to another page if I click the back button instead of going to the previous page I visited?
I have a login page which takes in a username and password and forwards to a welcome.jsp if login is successful.

Once I logout, I invalidate my session. Unfortunately, if i click the back button, the welcome.jsp page comes back again. This is incorrect.

How do i stop the welcome.jsp from coming back. Instead, another page should load saying that the session has expired.

I went through a few forums in which i learnt that the browser cannot be controlled and that meta-tags have to be used to prevent the browser to cache data. I tried using the following tag to disable caching but it did not work:


Please help. This is very frustrating.
Thank You.
9 years ago
This is the form I am using to submit the request to the database.




Here is my servlet. It takes in the url of the image on my hard disk in the File fBlob. Is this code correct? It doesnt work when I click the submit button. It throws an SQLException giving the column name in which I am trying to insert the BLOB i.e. PHOTOGRAPH.



Please help me now...
Thank You
I have a web page in which i have a browse button which selects an image on my local hard disk. I have a submit button which submits the file to the server.

How do I insert this image into a BLOB attribute in a table of my database.
The data type of the image specified in the database is type BLOB.

Please specify the code if possible.

Please help.
Thank You.
[ October 26, 2008: Message edited by: Bear Bibeault ]
I have a web page in which i have a browse button which selects an image on my local hard disk. I have a submit button which submits the file to the server.

How do I insert this image into a BLOB attribute in a table of my database.
The data type of the image specified in the database is type BLOB.

Please specify the code if possible.

Please help.
Thank You.
the problem is that i have tried inserting data into both the tables seperately. The insertion works fine when inserting into each table seperately!!

It doesnt work when inserting into both tables one after the other.

What do i do now???

Please help !!
I am using DB2 as my database manager.

The problem I am facing is that I cannot insert data into multiple tables at the same time. The code is given below:



The data gets inserted into the first table but doesnt get inserted into the 2nd one. It throws an SQLException saying that there is NULL value.

Please help...!!
Waiting for a reply......
if either a or b is null, then how does the else condition work fine???

is'nt request.getParameter() returning a string which is not matching "aditya" and hence error.jsp is called. How then can null be returned??

please help...
9 years ago
yes...line 20 is the if statement.

the variable a contains username and b contains password.

If they are null, then how is the else condition working fine....???


please help...
9 years ago
I've even tried the equals() function of java.lang.String. It does'nt work even then ...

please help...
9 years ago
I have a servlet as follows:




The problem I face is that when the 2 parameters in the if statement do not match, error.jsp is called and works fine but, when the parameters match "aditya", a NullPointerException is thrown. The error reflected by the server says that the error is on the if statement(Line 20). The if statement returns Null instead of dispatching to welcome.jsp.

Waiting for a reply,
please help me as its frustrating.

Thank You.
9 years ago
Hi,
I am working on a project and am very new to the security API. I dont have any idea about security in JAVA. My project contains servlets, jsp's, ejb's and a database managed by IBM DB2. Could you please suggest a good resource, book or online tutorial which could help me to progress. I need to develop authentication using usernames and passwords, authorization for different types of users with different roles and other security related issues I may need to implement.
I would prefer a resource which uses EJB 3.0(if at all it uses it) as I an SCBCD 5 certified.
I tried the doc tutorials and guides available on java.sun.com but I found them really confusing.
Please suggest something easy yet very helpful.

Waiting eagerly for a response...
9 years ago
Hi guys,

Ive finally got through with the exam and got a 82%. It pinches not to reach the realm of the 90's but I was short of time anyway.

It took me 1 and a half months to prepare. I used the following material:
1. EJB3 In Action - An amazing guide for rookies.
2. Pro EJB3 Persistence API - A must for understanding persistence.
(Chapters 3 to 7 mostly)
3. THE SPECIFICATION - If you dont study this, you wont get through the
exam. Its crucial.
4. MZ's notes - Wonderful and very helpful for quick reference. Thank You
personally for this excellent compilation.
5. Enthuware EJB5+ Questions - Even after reading the specs, your concept
will not be clear unless you do these
questions.

I found Enthuware to be much more difficult then the real exam. If you can do these mock tests easily, you can ace the real exam.
Thank You all ranchers for helping me. Without this forum, I seriously would'nt have passed.
Thats my mistake...the 2nd class is Presentation


please help...
there are 2 entities:

Entity 1:


Entity 2:


Question: out of the following 2 queries, which one will return students who have given only one Presentation?
1. select s from Student s where size(s.presentations)=1
2. select s from Student s where (select count(p) from s.presentations p)=1

According to enthuware the 2nd one is correct.

Should'nt the first option be correct as size(s.presentations) would return the size of the collection as an integer and presentations is a Collection type...???

please help...