Sri Ram

Greenhorn
+ Follow
since Feb 13, 2006
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
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Sri Ram

I am initially displaying data from the form which has a list of RoleVO like

package com.web;

import java.util.ArrayList;
import java.util.List;

import org.apache.struts.validator.ValidatorForm;

import com.vo.RoleVO;

public class ManageRoleForm extends ValidatorForm {

//Search Details of the User
private RoleVO searchRoleDetails= new RoleVO();

//ArrayList of the Search Result Roles
private List roleResults=new ArrayList();

public RoleVO getSearchRoleDetails() {
return searchRoleDetails;
}

public void setSearchRoleDetails(RoleVO searchRoleDetails) {
this.searchRoleDetails = searchRoleDetails;
}

public List getRoleResults() {
return roleResults;
}

public void setRoleResults(List roleResults) {
this.roleResults = roleResults;
}

public void reset() {
if (this.roleResults != null) {
RoleVO roleVO = null;
for (int i = 0; i < roleResults.size(); i++) {
roleVO = (RoleVO) roleResults.get(i);
roleVO.setValueSelected("N");
}
}

}

}



I use DispatchAction like

package com.web;

import java.util.List;
import java.util.ListIterator;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.catalina.Session;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.DispatchAction;

import com.bao.AdminBAO;
import com.IAdminBAO;
import com.vo.RoleVO;

public class ManageRoleAction extends DispatchAction {

public ActionForward searchRoles(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
// Getting the Manage User form
ManageRoleForm manageRoleForm = (ManageRoleForm) form;

RoleVO searchRoleVO = manageRoleForm.getSearchRoleDetails();
IAdminBAO adminBAO = new AdminBAO();
manageRoleForm.setRoleResults(adminBAO.searchRole(searchRoleVO));
return mapping.findForward("searchResults");
}

public ActionForward deleteRoles(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
// Getting the Manage User form
HttpSession session = request.getSession();
ManageRoleForm manageRoleForm = (ManageRoleForm)form;

List searchRoleVO = manageRoleForm.getRoleResults();
System.out.println(searchRoleVO.size());
ListIterator iterator = searchRoleVO.listIterator();
RoleVO roleVO = null;
while (iterator.hasNext()) {

roleVO = (RoleVO) iterator.next();
System.out.println(roleVO.getValueSelected());
System.out.println(roleVO.getRoleID());

}

// Call the Service to get the Search Results

// Modify this
return mapping.findForward("searchResults");
}

}


package com.vo;

import java.io.Serializable;
import java.util.Date;

public class RoleVO implements Serializable {

// Role ID of the User
private String roleID;

// Role Name of the User
private String roleName;

// Status of the User
private String status;

// No of Users
private String noOfUsers;

// Updated By
private String updatedBy;

// Updated On
private Date updatedOn;

// isSelected attribute
private String valueSelected="N";

public String getRoleID() {
return roleID;
}

public void setRoleID(String roleID) {
this.roleID = roleID;
}

public String getRoleName() {
return roleName;
}

public void setRoleName(String roleName) {
this.roleName = roleName;
}

public String getStatus() {
return status;
}

public void setStatus(String status) {
this.status = status;
}

public String getNoOfUsers() {
return noOfUsers;
}

public void setNoOfUsers(String noOfUsers) {
this.noOfUsers = noOfUsers;
}

public String getUpdatedBy() {
return updatedBy;
}



public String getValueSelected() {
return valueSelected;
}

public void setValueSelected(String valueSelected) {
this.valueSelected = valueSelected;
}

public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}

public Date getUpdatedOn() {
return updatedOn;
}

public void setUpdatedOn(Date updatedOn) {
this.updatedOn = updatedOn;
}



}


I am unable to edit the value of text box in the jsp

<logic resent name="manageRoleForm" property="roleResults" >


<logic:iterate id="roles" name="manageRoleForm"
property="roleResults" type="com.vo.RoleVO" >

<tr>
<td>
<div align="center"><font color="#008000"><a
class="marln" href="ModifyRole.htm"><bean:write name="roles" property="roleID" /></a> </font></div>
</td>
<td>
<div align="center"><font color="#008000"><bean:write name="roles" property="roleName" /> </font></div>
</td>
<td>
<div align="center"><font color="#008000"><bean:write name="roles" property="status" /> </font></div>
</td>
<td>
<div align="center"><font color="#008000"><bean:write name="roles" property="noOfUsers" /></font></div>
</td>
<td>
<div align="center"><font color="#008000"><bean:write name="roles" property="updatedBy" /></font></div>
</td>
<td>
<div align="center"><font color="#008000">10/02/2008
10:21:12</font></div>
</td>
<td>
<div align="center"><html:text name="roles"
property="valueSelected" indexed="true"> </html:text>
</div>
</td>
</tr>
</logic:iterate>
</logic resent>
15 years ago
Hi,
Im trying to submit a form using a Html Submit button

<code>
private ImageButtonBean saveButton = new ImageButtonBean();

public ImageButtonBean getSaveButton() {
return saveButton;
}



public void setSaveButton(ImageButtonBean saveButton) {
System.out.println("Calling the Set Save Button");
this.saveButton = saveButton;
}</code>

My JSP has the submit button


When I click on the submit button the Setter for Save Button is not called.Can you please let me know the fix for this

Thanks and Regards,
Sriram
16 years ago
I am using Crystal Reports to generate a report that has to be displayed to the user using java/j2ee

When i use

clientDoc.open(reportName,0);



the report gets generated and is displayed when the project is deployed in the windows environment.But when the same project is deployed in AIX environment the code hangs at the line that was mentioned above.All the crystal reports jars have been placed in the WEB-INF/lib path of the project. Can you please help me to resolve the problem.Are there different sets of Crystal reports jar for Windows and AIX that has to be used?
Thanks in Advance

Thanks and Regards,
Sriram
16 years ago
I have a double number d = 15.33 .I want to do the below calculation.(ie) i want to seperate the whole number and the decimal part without using a splitter based on (.) to get the values.How can I do that??

e.g. 15.33 convert to 1520

Take decimal portion * 60 rounded. (0.33*60=20)

is what i want to perform? Please help.
16 years ago
I have a double number d = 15.33 .I want to do the below calculation.(ie) i want to seperate the whole number and the decimal part without using a splitter based on (.) to gets the values.How can I do that??

e.g. 15.33 convert to 1520

Take decimal portion * 60 rounded. (0.33*60=20)

is what i want to perform? Please help.
16 years ago
I have a session time out configured in the web.xml.In my filter I use request.getSession(false).Then I check the value in my session object.But even after the session has expired my session object does not get a null value.



Can you tell me how to check if my session has expired?
16 years ago
Actually,I want to store the XML in a database.I dont want to use TCPMon.Can anyone tell me how to do this using Axis ??

Thanks and Regards,
Sriram
Hi when I try to send a simple java mail using the below code I get the following exception.





I have replaced my actual email address with abc@rediffmail.com .Please help.
16 years ago
Can anyone tell me how to get the raw request and response using axis??? any reference links???


Thanks and Regards,
Sriram
Can you tell me how to store and Retrieve a Java Object using a Oracle ???
Passed SCWCD with 79%..Next is SCBCD!!!
16 years ago
Hi Amir,
Will you be able to send the Mikalai Zaikin notes to my email (venkatesansriram at gmail dot com).

Thanks and Regards,
Sriram
Hello,
I have a form called as UserForm(UserForm.java ) and a UserAction(UserAction.java) configured in the struts config for the dispatch action method named getUserDetails.The UserForm has a property called as userID.

My JSP Code is

<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>

<html:form styleId="userForm"
action="/DisplayUserDetails.do?method=getUserDetails"
method="POST">
<html:text name="userForm" property="userID" styleClass="usertextbox"></html:text>
<html:submit value="GO" styleClass="buttonedit"></html:submit>

</html:form>

This HTML form is a part of a tile layout.When I submit the form ,the userID value in the getUserDetails method of the UserAction Class is found to be null..Is there any reason for the userID to be null ???

I have the correct form bean mapping and action mapping in the struts config and also the getters and setters for the form properties are correct.Can U let me know why the form values are null on submit ??? I also tried submitting the form using Java Script and still the form values are found to be null..My Struts version is 1.3.5

Any Clues???

Thanks in Advance ..
Ram
17 years ago
Thanks Marc
17 years ago