sharath kumar reddy karnati

Greenhorn
+ Follow
since Jul 23, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by sharath kumar reddy karnati

load: will throw error in case id is not found.
get: will return 'null' when id is not found.

Mostly 'get' will be helpful, if we are not sure whether id is present or not.

Ex. Cat cat = session.get(Cat.class,CatId);
if (cat==null)
session.save(cat);

Bye,
Sharath.
Hi All,

I didn't understand how optimistic concurrency will work in hibernate?

As per my knowledge, we need to have either VERSION or TIMESTAMP column in persistence table which is mappend to hibernate.

Say we are having TIMESTAMP column then whenever we execute INSERT,UPDATE statement hibernate will modify TIMESTAMP column with system timestamp. When we try to update a row and that row timestamp is differenent from the existing row timestamp then it determines as stale data and it will through the error message.

Please correct me if I'm wrong and also provide some example too.

Thanks in advance.

Sharath.
Dear All,

I have following code in <h:dataTable> one of the columns

/********************************************************/

<h:column>

<f:facet name="header">
<h:outputText value="User Id" />
</f:facet>

<h:commandLink value="#{rs.user_id}" action="#{PersonalDetails.ShowPersonalDetails}" onmousedown="popupPage()" >
<f:param value="#{rs.user_id}" name="UserID" />
</h:commandLink>


</h:column>

/*********************************************************************/

When user selects link on 'User Id' column it is displaying a popup window but it is not invoking bean method(ShowPersonalDetails), when I remove 'onmousedown' event then it is calling action method correctly.

Please help.

Thanks,
Sharath.
17 years ago
JSF
Hi All,

Please find below script in written in HTML

<html>
<form>
<body height="500px;" style="background-color: yellow;" >
<table width="100%" border="1" cellpadding="0" cellspacing="0" style="background-color: #FFFFFF; border: 2 solid #0000C0">
<tr>
<td> first </td>
<td> second </td>
</tr>
<tr>
<td> three </td>
<td> four </td>
</tr>
</table>
</body>
</form>
</html>

When I run this HTML code it is dislaying yellow background in form and table is showing on top. When I do same thing in JSF with following code

<f:view>
<h:form>

<body style="height:500px" leftmargin="0" rightmargin="0" topmargin="0" bottommargin="0">

<center>
<h:panelGrid width="100%" columns="2" border="0" columnClasses ="column1,column2" >
<center>

<h:outputText value="User Id:" />
<h:inputText id="userId" value="#{LoginValidation.loginname}" />


<h:outputText value=" " />
<h:commandButton value="Login" action="#{LoginValidation.CheckValidUser}" />

<h:outputText value="New User?" />
<h:commandLink value="Register Here" action="newuser" />

</center>
</h:panelGrid>
</center>
</body>
</h:form>
</f:view>

When I'm executing this script, it is not showing the hight which I mentioned in <body> tag, it is taking default height depending upon the values mentioned in <h:panelGrid>.

In case, if I give height in <h:panelGrid> then it is working fine.

Please help.

Thanks in advance.

Regards,
Sharath.
17 years ago
JSF
Hi All,

Say I have 2 java beans.

EmployeeBean.java( 3 properties with getters and setters)
-------------------
empId
empLoginName
empPassword

EmployeeDetailBean.java ( 3 properties with getters and setters)
-------------------------
empId
empFirstName
empSecondName

And I have 2 jsp pages(empLogin.jsp,empDetail.jsp)

User will enter Login & password in empLogin.jsp page and it will have a method will check user credentials and it will return empId in case of success.

When user login & password is correct I'd like to send this empId to empDetail.jsp page and I'd like to query employeedetail table based on empId and show employee details on empDetail.jsp page.

Please let me know how to do these tasks for above situation:

1. How to pass empId between the pages. ( EmployeeBean.java bean is in session scope).

2. In empLogin.jsp, I have submit button where I'm calling checkUser() method for validating empLoginName and password, in this method I'm calling antother method selectEmployeeDetail(which will retrive data for given empId) in EmployeeDetailBean.java, this method is invoking fine but the data is not showing up in empDetail.jsp page.

3. In dataTable tag, we can invoke a method from java bean to populate data but how to do similar in <h:form> tag.

Thanks in advance.

Regards,
Sharath.
17 years ago
JSF