shah rah

Ranch Hand
+ Follow
since Jan 04, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by shah rah

I have Netbeans 6.8 and I want to learn myfaces. I created web application project and it allowed me to choose JSF framework and I am stuck. I want to know what jars do i need to work to myfaces and where should I save them. Please help me
14 years ago
JSF
Is there a difference between the way EJB handles transaction to the way Hibernate does.
In my project we do not have EJB's and all the DB transactions are done using hibernate. for eg I open transaction after Session is created and close once all the database work is complete.

appreciate your reply.
I read that diamond scenario cannot be handled by "extends " clause but handled by interface. Can somebody explain this to me.


c1 -- super class

c2 and c3 extends from c1

c4 extends from c2 and c3.

14 years ago
What is the purpose of having EJB and hibernate in a project?
I thought hibernate is an alternative to EJB? Please clear me on this.
Can I use POJO classes generated from hibernate instead of creating value objects in my code. Is it a good programming practice?

I had this question in my interview ---> how will I deploy Web services?

and I said it would be part of the WAR.

Am I correct?

I am a newbie to web services and I said I am familiar with it and he went ahead and tested me on how familiar I was!
14 years ago
List list = new ArrayList();
list.add(0, 59);
//int total = ((Integer)(list.get(0))).intValue(); // this works
int total = list.get(0); //compile error
System.out.println(total);

I am using netbeans IDE and java 1.6. I thought it will not give compile error and autoboxing feature will handle it...

Why the error?


14 years ago
I want to redirect the user to login page if his session expires. He could be on any page and if his session expires he has to be redirected to Login screen.

I am doing this... I check for the session if it is new then redirect him to login page. What's happening is I am writing this piece of code on every page and I am checking for expired session and redirecting him to login.

I want to know if there is one place where we can write the code and user will be redirected to login page irrespective of on which page he is in when his session expires .

appreciate your help
15 years ago
I am trying to learn criteria and I want to execute something like

select deptno from dept; //get all deptno

Criteria criteria = session.createCriteria(Dept.class);List objects = criteria.list(); // this is returning all the rows-- deptno and deptname.

Is there a way I can specify in the criteria that its should only fetch all the depno and ignore deptnames?
which folder should have actioname-validation.xml file? I am using TOMCAT and struts.xml is under classes directory.

appreciate your reply.
15 years ago
http://www.struts2.org/form-validation-in-struts2-basic-server-side-validation-example/

I tried validation example as in above link. The only validation that works is if I provide a non-numeric value in "AGE" field. None of the other validation works.

Can some one help me regarding this.

15 years ago
Finally I got it. Looks like there was a problem with names of the field and getter and setter names. I fixed the code on my first message too.
15 years ago
If it is a simple form field like this it is working fine.



but If I have a java bean I am unable to pass value to next page. I want to know how to pass complex objects? Appreciate your reply.


15 years ago
How to pass the firstname entered on the form to my success page.

In struts 2 examples. I haven't seen anyone using request.getParameter("firstname") to get form values or use request.setAttribute("fname",firstname) to pass values to another page.

can some one direct me on how to get form field values from my jsp page in STRUTS2?

15 years ago
I have a register page with 2 fields and submit button. Once submitted I want to show a success page with paramaters entered in the prev page.

Very Simple but I am not clear how to do this with STRUTS2

ACTION CLASS --




JSP


Register.jsp


Sucess.jsp


I am getting message Thanks for registering: but not the value of the firstname. In old versions of struts
it would be setting a Request attribute and getting value from it on the JSP page. I am not sure how it is done in STRUTS2

appreciate reply.
15 years ago