Sreek Gupta

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

Recent posts by Sreek Gupta

Hi,
Thanks for your reply.

Actually i am preparing a white paper to list out what
are the advantages/disadvantages of using EJB3.0 Vs
Hibernate on JBOSS server and I am evaluating technologies for
our next Phase.In first phase we used struts and jdbc on JBOSS server.


For that i need some info on those technologies.
Please suggest me some documents where we can get this
info and which one is better as production,development,maintaince and performance poient of view.
18 years ago
Hi,

i want to use ejb 3.0 or hibernate 3.1 on performance jboss application server.can u pls tell me which one is better amoung these and the reson?

thank you.
18 years ago
Which one is better amoung EJB 3.0 and Hibernet 3.1 as production,development,maintenance and performance etc... poient of view.
18 years ago
Hi,
Is there a way to share a directory on my server machine using java?

Regds,
18 years ago
Hi,

I have a String which consists of tabs and newlines in it.
I want to parse it using java.
Can anyone provide me some piece of code to do the same.

Ex: Suppose i have a string as follows:

Srikanth <enter a tab here> Gupta
<enter a newline here>
From <enter a tab here> India

Output should be
Srikanth
Gupta
From
India

Please help me.

Regds,
Srikanth
18 years ago
Hi , I have following code in JSP to display a table.

<display:table id="cp" class="datatable" name="sessionScope.myList" pagesize="5" cellpadding="0" cellspacing="0" requestURI="/myPayment.do">
<% i = 1;%>
<display:column>
<html:radio property="selectedRow" value="<%=String.valueOf(i)%>" />
</display:column>
<display:column property="empName" title="Employee Name" sortable="true" />
<display:column property="paymentAmount" title="Payment Amount"/>
<% i = i+1;%>
</display:table>

Intension is when i select radio button, depending on the selection i want to read the selected values in my Action.
I have getters and setters in my Form bean. But when i am saying getEmpName() in action it is returning me 'null'.

My question is how to extract the selected row of a table (that is using display tag library) in my action class?

Please help me with sample code if possible.

Regds,
Sreek
18 years ago
Hi,

How to access database on loading a struts based JSP page. Because i need to populate a listbox based on the database values.

Please help me with code sample if possible.

Regds,
Srikanth
18 years ago
Hi,
I have a Collection of value objects(say Employee(Id, name, dateOfBirth,valid etc..). One Action sets the collection in session and forwards to a JSP that displays a list of Employees using <logic:iterate> over this collection.
On each row of Employee information, one checkbox is provided to select whether employee is valid or not. Now if I select multiple checkboxes and submit the form(in JSP), I need the ActionForm to have a Collection that has Employee value objects. For this i declared String[] getters and setters for all the fields. Unfortunately i couldnt get unchecked values in my action form.
How can i get all the entries (whether it is checked or unchecked).
Please help me with code samples if possible.

Regds,
Sreek
18 years ago
Hi ,
I have a jsp as follows:

<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>

<html>
<head><title>Example</title></head>
<body>

<h3>Example Page</h3>

<html:errors/>

<html:form action="dept.do">
Dept No: <html:select property="deptNumber">
<html ption value="100">100</html ption>
<html ption value="200">200</html ption>
</html:select><br>
<html:submit property="whichButton"> <bean:message key="button.fetch"/></html:submit>
</html:form>

<logic resent name="empDetailTable" scope="session">

<% java.util.ArrayList lst = (java.util.ArrayList) session.getAttribute("empDetailTable");
%>

<html:form action="dept.do">
<table border=1>
<tr>
<td class="txtBld headerClr" width="12%" height="26">First Name</td>
<td class="txtBld headerClr" width="12%" height="26">Middle Name</td>
<td class="txtBld headerClr" width="12%" height="26">Last Name</td>
<td class="txtBld headerClr" width="11%" height="26">Induction Id</td>
<td class="txtBld headerClr" width="9%" height="26">Gender</td>
<td class="txtBld headerClr" width="8%" height="26">Attendance</td>
</tr>

<logic:iterate id="emp" name="empDetailTable">
<tr>
<td><html:text property="firstName" value="<%=((employee.DeptFetchBean)emp).getFirstName()%>"/></td>
<td><html:text property="lastName" value="<%=((employee.DeptFetchBean)emp).getLastName()%>"/></td>
</tr>
</logic:iterate>
</table>
<html:submit property="whichButton"> <bean:message key="button.save"/></html:submit>
</html:form>
</logic resent>

</body>
</html>



When i click on Fetch button, I need to get all the employess belonging to a particular department from database, And i have show them up in a table in the same page. This part i have done.
Once i get the employees i should be able to edit any employee details and click on Save button should save these details in the database again.
Since each department will have many employees, when i click on Save button how can i propagate all the updated entries further (to my action servlet)?
It would be helpful if you can provide me some example code for this scenario.

Regards,
Sreek
18 years ago
Hi,

Aggregation can be represented as follows:

public class Car{
private Wheel wheels[];

public Car(Wheel w1,Wheel w2,Wheel w3,Wheel w4){
wheels[0] = w1;
wheels[1] = w2;
wheels[2] = w3;
wheels[3] = w4;
}

}

Composition can be represented as follows:

public class Company{
private Department dept[];

public Company(){
dept[0] = new Department();
dept[1] = new Department();
dept[2] = new Department();
dept[3] = new Department();
}

}


Regards,
Srikanth
Hi,

Since you are using static variable for your singleton instance means there will be only one copy to that variable even though you create multiple objects of your singleton class.
A static variable is for Class NOT for each instance. So even though you create 10 objects of your singleton class , there will be only one copy for a static variable.

Regds,
Sreek
Hi,
As you said getInstance() will be called 10 times. But if you see the code it is as follows:

if (instance == null){
instance = new Singleton();
}

Which means you are checking instace == null or not.If it is null then only you are using new operator to instantiate Singleton class otherwise you are returning 'instance' private variable. So you are not creating Singleton class 10 times. You are creating only once (first time) and returning the same reference to other 9 calls to the getInstance() method.



Regards,
Sreek
Hi,
Is there any good document that tells how to implement UML conecpts like aggregation, composition, association, dependency, stereotypes in java?

I mean the aggregation can be shown as follows in java:

public class Car{
private Wheel wheels[];
public Car(Wheel w1, Wheel w2, Wheel w3, Wheel w4){
wheels[0] = w1;
wheels[0] = w2;
wheels[0] = w3;
wheels[0] = w4;
}
}

Like wise how can i implement other features of UML in java?


Regards,
Sreek
Hi,

I am new to Web Services.
Is there any link for step by step development and deployment of simple J2EE web service on weblogic server?


Regds,
Sreek
18 years ago
Hi All,

I am new to Web Services. I want to learn how to develop web services using java,wsdl,uddi and soap.
Can any one suggest me some link where i can learn how to develop a simple web services ?
Also where i can get some good material to understand the concepts of web service ?

Regds,
Sreek
18 years ago