kumar shiva

Greenhorn
+ Follow
since Jul 04, 2012
Merit badge: grant badges
For More
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
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by kumar shiva

am new to Hibernate Criteria, please help me

am creating a Member pojo class, in this class this Member class is having two foreign ke ys businessunitid(Many to one relation), role_id(one to one relation) of classes BusinessUnit, Role respectively.(role,businessunit are references of Role,BusinessUnit respectively)



crit = hibsession.createCriteria(Member.class)
.createCriteria("role")
.add(Restrictions.eq("role_id",role_id));
this statement working fine but

Below statement giving Hibernate Exception:
crit = hibsession.createCriteria(Member.class)
.createCriteria("businessunit ")
.add(Restrictions.eq("businessunitid",businessunitid));

Prasad Krishnegowda wrote:where is this attribute set?

It might be the case that, on login failure userToken is set in session, since its not null, authorized becomes true, now, since authorized its true, path variable is not set properly..




Thanks Prasad.
It's working fine when i set the
session.setAttribute("path",null);
in login.java after line number 75

Thanks Javaranch
11 years ago

Prasad Krishnegowda wrote:Your code needs lot of refactoring, first accessing database from Servlets, a strict no no..
It would help if you learn Spring Security, take a look at it once..

However, is the session attribute path set properly? Did you try printing it, what's the result you got.?




Thanks for the advice,
But i'm new to Servlets.

Session attribute path is fine
11 years ago

Prasad Krishnegowda wrote:When login is successful, you create a new session or get an existing session? If you get an existing session, on login failure what are you setting in session, is this variable cleared on successful login?

Hi Prasad,


this is my code.
AuthenticationFilter.java



and Login.java






please help me.

Thanks.

11 years ago
Hi,
can any one could help me!!!

I am developing a login web project using servlets, filters and am using sesseions for login and logout.
my problem is when enter correct username and poss word works fine, but when user enters wrong credentials giving login failed , next if he enters correct credentials also giving Login failed.
if clears the Browser history again login with correct credentilas worksfine.

Thanks
11 years ago

nitss bhavsar wrote:hello Jeanne,
First of all thanks for your immediate reply..
1.what i want it to do-
a.first student should enter his/her details(like name,age,address,city,state..etc)
b.scores of previous years(like 10th,12th,CET,diploma(second year direct admission)).
c.should have three branches(engineering IT,Comps,Electronics)
d.cut off for each branch.
e.should have all the required documents for admission.
f.it should be offline.
g.if student satisfy all the criteria then he is valid candidate for admit.

2.what i want to have in database
a.i need to use jdbc (Oracle db)
b.database should have details of the valid candidate who is eligible to admit.
c.his/her name,branch selected,scores,all documents are there.etc

3.Screens should be like (not exactly like this but somewhat..but it should be offline and need to use swing for UI)

https://www.elbowspace.com/FRHformexample18.htm


thanks,





Hello Bhavsar,

I think you better to use Swing concept JFrame for frame,for text field(name,age,address,city,state,scores of previous years) JTextfields, JTextarea
after all this in a frame create a Submit button to to store the details in DB.
create radio buttons for Branches in another frame.

Create a table, student details in DB, and connect it with JDBC code.


Shiva.



11 years ago
Hi,

In my project i need to add a JScrollPane to the JTable.

1st process:
In this process am adding JTable to the panel and Jpanel to the frame, i am getting the the table as like setting Boumds.
my requirement is when large data displays i need scrollpane.

so i am using 2nd process

2nd process
In this process am using JScrollpane, am adding JTable to the JscrollPane, JscrollPane to thr Jpanel and Jpanel to the frame.
In this one am getting the result but Table is very less compare to the table in 1st process.

3rd process:
In this one am adding table to the panel, panel to the JScrollpane and JScrollpane to the frame.
by using this process am not getting table on frame.

Any one could you help me.

Thanks,
Shiva

11 years ago

Hello,

Could any one please tell me how to set the Size of the JTable.(to increase the size of the Table).

Thanks,
Shiva
11 years ago

Thank you very much Mr.Jain
11 years ago

Why compile error occurs at a1 object creation(2nd line)

public class Example {
Example a1= new Example();
public static void main(String args[]){
Example a2 =new Example();
}
}
11 years ago
Thank you very much Mr.Bear Bibeault.
11 years ago
Please can anyone help me?

I created application folder app1 inthat WEB-INF -->Classes and web.xml
In Classes Servlet1.java as below


web.xml script like below


Compiled sucessfully but when i entered address(http://localhost:8081/app1/s1) in address bar it is giving below message


type Exception report

message Error instantiating servlet class pack1.Servlet1

description The server encountered an internal error (Error instantiating servlet class pack1.Servlet1) that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Error instantiating servlet class pack1.Servlet1..
...........................................................................................................
11 years ago