khizar dheen

Greenhorn
+ Follow
since May 30, 2007
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 khizar dheen

IFrame scrolling (Horzinotal & Vertical)is not supporting in IPAD Apps..any one have real timecode for check...
7 years ago
iOS
Hi Fred,
This is my scenerio
I am a reading a file and separated as tokens,and then i added that tokens into list,now i need separated tokens in my list on iterate..

Here i am attaching my code..


[ UD: In the future, please UseCodeTags when posting code of an length. It's unnecessarily hard to read the code as it is, making it less likely that people will bother to do so. ]
10 years ago
I added list of tokens in my list,after that i want to iterate the list,then i need to get that string tokens in my iterate.....any suggestion welcome...

I need to take that string token again..any suggestion
10 years ago
Hi

This is Khizar,

I have a 5+ exp in Java/J2ee in BFSI Domain with designation of SSE,
Got an offer from Company X ,Company Y and Company Z with same designation,
Little bit confused where to join,need suggestion guys,which will be a better company for my careers and next level position,

Reply ASAP

Regards
Khizar
10 years ago
I have a page of user registration,when the user register and submit the form it will store values in the database and same time data are also display in next page

single save button is used for both storing the values in database and display in another page its possible
12 years ago
This is error i am facing for 2 days
Kindly suggest me wat to do

javax.servlet.ServletException: No getter method available for property table for bean under name TableBean
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
org.apache.jsp.jsp.table_jsp._jspService(table_jsp.java:81)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)

Action Class:
package com.yourcompany.struts.Action;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;


public class tableDisplayAction extends Action{
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) throws SQLException {

javax.sql.DataSource ds=getDataSource(request);
Connection con=ds.getConnection();
Statement stmt=null;
ResultSet rs=null;
ArrayList list=new ArrayList();
try {

stmt=con.createStatement();

String Query="select * from tab";

rs = stmt.executeQuery(Query);
if (rs!= null)
{
while(rs.next())
{
list.add(rs.getString("TNAME"));

}
request.setAttribute("TableBean",list);
System.out.println("TableDisplayValue----"+list);

}
}
catch(SQLException e)
{

e.printStackTrace();
}

con.close();

return mapping.findForward("Table");
}
}

Form Bean:
package com.yourcompany.struts.ActionForm;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

public class TableForm extends ActionForm {

private String table;

public String getTable() {
return table;
}

public void setTable(String table) {
this.table = table;
}
public void reset(ActionMapping mapping,HttpServletRequest request,HttpServlet response){
table="";
}

}

Jsp Page:<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean"
prefix="bean"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html"
prefix="html"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<html:html>
<html:form action="table" method="post">
<html:select property="table">
<html ptions collection="TableBean"
property="table" labelProperty="table"/>
</html:select>
</html:form>
</html:html>

Advance Thanks
13 years ago
I am new to javamail and struts,i have registration page in which the user enter the all the details,after clicking submit button, user name and password is automatically mailed to person email id which the person entered in registration page ,any sample code is available for this....

Any suggestion.............

Advance thanks
13 years ago
I am new to javamail and struts,i have registration page in which the user enter the all the details,after clicking submit button, user name and password is automatically mailed to person email id which the person entered in registration page ,any sample code is available for this....

Any suggestion.............

Advance thanks

any one have a solution for this in struts
help will be appreciated
13 years ago
I am new to javamail and struts,i have registration page in which the user enter the all the details,after clicking submit button, user name and password is automatically mailed to person email id which the person entered in registration page ,any sample code is available for this....

Any suggestion.............

Advance thanks
13 years ago
No one know ahax with struts help me

Advance Thanks
Kizar
13 years ago
I am new to struts and ajax
i want to know how the select options is working in ajax and retrieve values from database.suppose i am selecting country (usa) under that what are the states in usa is displayed in another select box

anybody having sample code for that application

Kindly suggest me how to do it
i have done but it is wrong,i do no this is correct or not

myform bean class:
package jobportal.struts.actionform;

import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

public class StateForm extends ActionForm{

private String state;
private String city;
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}

public void reset(ActionMapping mapping,HttpServletRequest request){
state="";
city="";
}

}
My action class:
package jobportal.struts.action;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import jobportal.actions.AjaxActions;

import jobportal.beans.*;
import jobportal.constants.JobPortalConstants;

import jobportal.struts.actionform.StateForm;

import org.apache.log4j.Logger;
import org.apache.struts.Globals;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionErrors;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;
import org.apache.struts.action.ActionMessages;

public class AjaxAction extends Action{

public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {

/* Declaring Action Messages class and object */

ActionMessages message = new ActionMessages();
String optionSelected = request.getParameter("optionSelected");

try {
StateForm stateForm=(StateForm)form;
String path = this.getServlet().getServletContext()
.getRealPath("/");


ArrayList state=new ArrayList();
ArrayList ajax1=new ArrayList();
ArrayList ajax2=new ArrayList();
AjaxActions ajaxactions=new AjaxActions(stateForm);
ajax1=ajaxactions.ShowStateDetails(request, path);
ajax2=ajaxactions.ShowCityDetails(request, path);
if (ajax1 != null) {
request.setAttribute("Ajax1", ajax1);
}

if (ajax2 != null) {
request.setAttribute("Ajax2", ajax2);
}


} catch (Exception e) {
System.out.println("AjaxActionPage" + e);
java.io.StringWriter sw = new java.io.StringWriter();
java.io.PrintWriter pw = new java.io.PrintWriter(sw);
e.printStackTrace(pw);

} finally {
}
return mapping.findForward("Ajax");
}

}

my Dao class:
package jobportal.actions;

import java.sql.ResultSet;
import java.util.ArrayList;
import javax.servlet.http.HttpServletRequest;
import com.pgcinfotech.db.SQLExecuter;
import jobportal.beans.State;
import jobportal.constants.JobPortalConstants;
import jobportal.struts.actionform.StateForm;

public class AjaxActions {

private String path;

private StateForm stateForm;

public AjaxActions() {
}

public AjaxActions(StateForm stateForm) throws Exception {

}
public ArrayList ShowStateDetails(HttpServletRequest request,String path)throws Exception
{

SQLExecuter sqlExe = new SQLExecuter(path,
JobPortalConstants.DATA_SOURCE_KEY);

ArrayList arraylist = null;
try{

ResultSet rs = sqlExe.executeSql2("ShowState", new String[0]);

arraylist = new ArrayList();
while (rs.next()) {

String State=rs.getString(1);
State state=new State();
state.setState(State);
arraylist.add(state);

}
sqlExe.closeConnection();
} catch (Exception e) {
System.out.println("AjaxStateActionsexception" + e);
sqlExe.closeConnection();
throw e;
}
return arraylist;

}
public ArrayList ShowCityDetails(HttpServletRequest request,String path)throws Exception
{

SQLExecuter sqlExe = new SQLExecuter(path,
JobPortalConstants.DATA_SOURCE_KEY);

ArrayList arraylist = null;
try{

ResultSet rs = sqlExe.executeSql2("ShowCity", new String[0]);
arraylist = new ArrayList();
while (rs.next()) {
State state=new State();
String City=rs.getString(1);
state.setCity(City);
arraylist.add(state);

}
sqlExe.closeConnection();
} catch (Exception e) {
System.out.println("AjaxCityActionsexception" + e);
sqlExe.closeConnection();
throw e;
}
return arraylist;

}
}

ajax.jsp:::::::


<script lang="javascript">
var req;
/*
* Get the second options by calling a Struts action
*/
function retrieveSecondOptions(){

firstBox = document.getElementById('firstBox');

//Nothing selected
if(firstBox.selectedIndex==0){
return;
}
selectedOption = firstBox.options[firstBox.selectedIndex].value;
//get the (form based) params to push up as part of the get request
url="AjaxAction.do";

//Do the Ajax call
if (window.XMLHttpRequest){ // Non-IE browsers
req = new XMLHttpRequest();
//A call-back function is define so the browser knows which function to call after the server gives a reponse back
req.onreadystatechange = populateSecondBox;
try {
req.open("GET", url, true); //was get
} catch (e) {
alert("Cannot connect to server);
}
req.send(null);
} else if (window.ActiveXObject) { // IE
req = new ActiveXObject("Microsoft.XMLHTTP");
if (req) {
req.onreadystatechange = populateSecondBox;
req.open("GET", url, true);
req.send();
}
}
}

//Callback function
function populateSecondBox(){
document.getElementById('secondBox').options.length = 0;

if (req.readyState == 4) { // Complete
if (req.status == 200) { // OK response
textToSplit = req.responseText
if(textToSplit == '803'){
alert("No select option available on the server")
}
//Split the document
returnElements=textToSplit.split("||")

//Process each of the elements
for ( var i=0; i<returnelements .length; i++ ){
valueLabelPair = returnElements[i].split("|")
document.getElementById('secondBox').options[i] = new Option(valueLabelPair[0], valueLabelPair[1]);
}
}
} else {
alert("Bad response by the server");
}
}
}
</script>

my jsp page::::

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>

<%@ taglib uri="/tags/struts-html" prefix="html"%>
<%@ taglib uri="/tags/struts-bean" prefix="bean"%>
<%@ taglib uri="/tags/struts-logic" prefix="logic"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Check</title>
</head>
<body>
<%@include file="/jsp/Ajax.jsp" %>
<html:form action="State" method="post">
<tr>
<td><label for="first"><bean:message key="ajax.state"/></label></td>
<td>
<!--On change the function retrieveSecondOptions() is called to populate the second box -->
<html:select property="state" onchange="retrieveSecondOptions()" styleId="firstBox" styleClass="mandatory">
<html ptions collection="Ajax1" property="state" labelProperty="state"/>
</html:select>
</td>
</tr>
<tr>
<td><label for="second"><bean:message key="ajax.city"/></label></td>
<td>
<html:select property="city" styleId="secondBox" styleClass="mandatory">
<html ption value="nothing">-First choose above-</html ption>
</html:select>
</td>
</tr>
</html:form>
</body>
</html>

kindly suggest me how to do further
any help advance thanks
13 years ago
iam new to struts

i cant retrieve values from database using html:multibox

error is :

org.apache.jasper.JasperException: Exception in JSP: /jsp/Check.jsp:19

16: </head>
17: <body>
18: <html:form action="Check" method="post">
19: <logic:iterate id="item" property="check" name="checkForm">
20: <html:multibox property="check" name="checkForm">
21: <bean:write name="item"/>
22: </html:multibox>

javax.servlet.ServletException: No getter method for property: "check" of bean: "checkForm"

this is my jsp page:

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>

<%@ taglib uri="/tags/struts-html" prefix="html"%>
<%@ taglib uri="/tags/struts-bean" prefix="bean"%>
<%@ taglib uri="/tags/struts-logic" prefix="logic"%>

<%@ page import="jobportal.beans.Check"%>
<%@ page import="jobportal.struts.actionform.CheckForm"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Check</title>
</head>
<body>
<html:form action="Check" method="post">
<logic:iterate id="item" property="check" name="checkForm">
<html:multibox property="check" name="checkForm">
<bean:write name="item"/>
</html:multibox>
<bean:write name="item"/>
</logic:iterate>

<
</html:form>

my form bean:

package jobportal.struts.actionform;
import jobportal.beans.*;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

public class CheckForm extends ActionForm {
private String employeeStatus;

public String getEmployeeStatus() {
return employeeStatus;
}

public void setEmployeeStatus(String employeeStatus) {
this.employeeStatus = employeeStatus;
}

}
my dao is :
public ArrayList getCheck(HttpServletRequest request,String path,String uName) throws Exception
{
SQLExecuter sqlExe = new SQLExecuter(this.path,JobPortalConstants.DATA_SOURCE_KEY);
ArrayList arraylist=null;
try
{

java.sql.ResultSet rs = sqlExe.executeSql2("GetCheck", new String[0]);
arraylist=new ArrayList();
while(rs.next())
{
System.out.println("gdsd");
String employeeStatus=rs.getString(1);
Check check =new Check();
check.setEmployeeStatus(employeeStatus);
arraylist.add(check);


}
sqlExe.closeConnection();
} catch (Exception e) {
System.out.println("CheckActionsexception"+e);
sqlExe.closeConnection();
throw e;
}

return arraylist ;
}
}

my action class is:
public ActionForward execute(ActionMapping mapping, ActionForm form,HttpServletRequest request, HttpServletResponse response)throws IOException, ServletException {
ActionMessages msgs = new ActionMessages();
//String target = "failure2";
ActionErrors errors = new ActionErrors();
try{

String path = this.getServlet().getServletContext()
.getRealPath("/");

String uName="kizar";
System.out.println("name"+uName);
CheckForm checkForm=(CheckForm)form;
CheckActions checkactions=new CheckActions(checkForm,uName);
ArrayList list=checkactions.getCheck(request, path, uName);
request.setAttribute("check", list);


} catch (Exception e) {
System.out.println("actionPage"+e);
java.io.StringWriter sw = new java.io.StringWriter();
java.io.PrintWriter pw = new java.io.PrintWriter(sw);
e.printStackTrace(pw);
logger.fatal(sw.toString());
} finally {
}
return mapping.findForward("check");
}

can any one solve my problem
13 years ago
iam new to struts

i cant retrieve values from database using html:multibox

error is :

org.apache.jasper.JasperException: Exception in JSP: /jsp/Check.jsp:19

16: </head>
17: <body>
18: <html:form action="Check" method="post">
19: <logic:iterate id="item" property="check" name="checkForm">
20: <html:multibox property="check" name="checkForm">
21: <bean:write name="item"/>
22: </html:multibox>

javax.servlet.ServletException: No getter method for property: "check" of bean: "checkForm"

this is my jsp page:

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>

<%@ taglib uri="/tags/struts-html" prefix="html"%>
<%@ taglib uri="/tags/struts-bean" prefix="bean"%>
<%@ taglib uri="/tags/struts-logic" prefix="logic"%>

<%@ page import="jobportal.beans.Check"%>
<%@ page import="jobportal.struts.actionform.CheckForm"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Check</title>
</head>
<body>
<html:form action="Check" method="post">
<logic:iterate id="item" property="check" name="checkForm">
<html:multibox property="check" name="checkForm">
<bean:write name="item"/>
</html:multibox>
<bean:write name="item"/>
</logic:iterate>

<
</html:form>

my form bean:

package jobportal.struts.actionform;
import jobportal.beans.*;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

public class CheckForm extends ActionForm {
private String employeeStatus;

public String getEmployeeStatus() {
return employeeStatus;
}

public void setEmployeeStatus(String employeeStatus) {
this.employeeStatus = employeeStatus;
}

}
my dao is :
public ArrayList getCheck(HttpServletRequest request,String path,String uName) throws Exception
{
SQLExecuter sqlExe = new SQLExecuter(this.path,JobPortalConstants.DATA_SOURCE_KEY);
ArrayList arraylist=null;
try
{

java.sql.ResultSet rs = sqlExe.executeSql2("GetCheck", new String[0]);
arraylist=new ArrayList();
while(rs.next())
{
System.out.println("gdsd");
String employeeStatus=rs.getString(1);
Check check =new Check();
check.setEmployeeStatus(employeeStatus);
arraylist.add(check);


}
sqlExe.closeConnection();
} catch (Exception e) {
System.out.println("CheckActionsexception"+e);
sqlExe.closeConnection();
throw e;
}

return arraylist ;
}
}

my action class is:
public ActionForward execute(ActionMapping mapping, ActionForm form,HttpServletRequest request, HttpServletResponse response)throws IOException, ServletException {
ActionMessages msgs = new ActionMessages();
//String target = "failure2";
ActionErrors errors = new ActionErrors();
try{

String path = this.getServlet().getServletContext()
.getRealPath("/");

String uName="kizar";
System.out.println("name"+uName);
CheckForm checkForm=(CheckForm)form;
CheckActions checkactions=new CheckActions(checkForm,uName);
ArrayList list=checkactions.getCheck(request, path, uName);
request.setAttribute("check", list);


} catch (Exception e) {
System.out.println("actionPage"+e);
java.io.StringWriter sw = new java.io.StringWriter();
java.io.PrintWriter pw = new java.io.PrintWriter(sw);
e.printStackTrace(pw);
logger.fatal(sw.toString());
} finally {
}
return mapping.findForward("check");
}

can any one solve my problem
13 years ago