zoheb siddiqui

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

Recent posts by zoheb siddiqui

i am new in struts 1.3 application development , i requirement is that what ever the forms i am developing i have to make 2 forms of same kind one for add purpose and another for edit purpose means i have a web form in that i have two fields one for entering the code and another for entering the name and a save button to save the data into database and when the user is in the add mode i display this from and in edit mode i display the other form which has got a hidden field ,one field for displaying the code and another is for displaying the name and the update button . through this he can update the data now my requirement is that can i use same form for adding and editing the information i have googled i found the that this can be done by using struts layout but not much information is available . if anybody can give me the some hint how to achieve this would be helpful for me
12 years ago
i am new in struts developing a j2ee application in struts 1.3 i have a requirement that i have a form has got button on clicking it child window opens which contains services to be given . user will select services from the java script popup window which will display all the services with every service i have a check box .user will check those check boxes against the services which is to given and will press save button on java script child window and those selected services will display on the parent window in a table format my problem is that how to do this? and more thing that if user has suppose selected 5 services and has saved on javascript child window and has been displayed to parent window but now out of 5 services he selected if user want to remove 1 service out of 5 services and want to save only 4 services how this is to be done .or this can be done without using java script child window. and help would be appricated.
12 years ago
0 down vote favorite
share [fb] share [tw]


i am developing a application in struts 1.3 in struts i have a requirement that when click on the submit button of the form then the button gets disabled so as the user cannot submit the form multiple times for that i am using this code

<input value="Save" class="btnbg" type="submit" name="method"
onclick="this.disabled=true;" />

in this code on click of the button it gets disabled now it is getting disabled but i am facing a peculiar problem that action in the action class is not executing i am using DispatchAction class for execution of my action it code works fine if i remove onclick="this.disabled=true; the action gets executed but i am getting exception

javax.servlet.ServletException: Request[/AddFloor] does not contain handler parameter named 'method'. This may be caused by whitespace in the label text.
org.apache.struts.actions.DispatchAction.unspecified(DispatchAction.java:197)
org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:245)
org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:170)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
com.asset.filter.CheckSession.doFilter(CheckSession.java:72)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
12 years ago
i am developing web application in struts 1.3 i am using display tag to display data i have checkbox in table display.i am new in dispaly tag, pagination all I want to maintain the state of checkboxes across pages. What happens is when i check one checkbox and then go to say 2nd page then check one checkbox there and when i return to previous page the checked box is again unchecked. Means the status of the checkbox is not maintained.If it is maintained then it should show checked. when i goto next or previous page my action class is called everytime

i am not understanding how handle this . Any kind of help would be greatly appreciated.
some sort of code if anybody provide then i would be good
13 years ago
i am working web application on struts 1.3 in netbeans i have two dropdownlist say A and B now i have no probl1em in populating these dropdowns on jsp load ,now user select one value from say dropdown A and value user selected say it is 1 and for another dropdown say B user selected value which is 2 and now user will save these values in database now my requirement is that when we go in edit mode for that when page loads dropdownlist A should have value 1 as preselected and dropdownlist B should have value 2 as preselected. and these values are coming from database my jsp page

1 dropdown

<tr>
<td> <html:select name="RoomForm" property="location"onchange="getFloorDropdown(this.value);" >
<html:option value="0">Select Location</html:option>
<html:optionsCollection name="RoomForm"
property="list" value="id" label="name" />
</html:select>
<td>
</tr>

RoomForm:-name of my form bean in requst scope list:-Arraylist collection
id:-it is property in Arraylist which is list having getter and setter in bean
name:-it is property in Arraylist which is list having getter and setter in bean

2 dropdown

<select name="floor" >
<option value="0">Select Floor</option>
</select>

how should i do how select a preselected values in both downdroplist when this form opens in edit mode
any hint will be a great help for me
13 years ago
i found the solution action config shouldn't have the extension in it and one more thing to be corrected in this post
type="org.apache.struts.actions.ForwardAction"
13 years ago
i am developing an application in struts 1.3 in net beans i have a link on clicking on that link i am forwarding to a login page if the session of the user has expired here i am making use of struts org.apache.struts.action.ActionForward class but when i click on it the it gives me error invalid path requested my JSP page

<tr>
<td class="text">
<html:link page="/gotoLogin.do">Click here to login again</html:link>
</td>

</tr>
my mapping

<action
path="/gotoLogin.do"
type="org.apache.struts.action.ActionForward"
parameter="Login.jsp"
input="/welcomStruts.jsp"
scope="request"
validate="false">
</action>
i am not understanding why this happening
13 years ago
i am developing a struts application in struts 1.3 i am using display tag in displaying data i am displaying checkbox in every row now i have a requirement that i select checkboxes and selected checkboxes values are saved into database but i when i move to next page to select an item and after selecting the items when move to previous page the selected checkbox get unchecked . iam not understanding how to do this
13 years ago
hi i am developing a web application in struts 1.3 using netbeans . i have a jsp page in which i have 2 dropdowns one is for populating location and other is for floors on selection of location .respective floors are displayed . now i am facing a peculiar problem have made use of ajax and servlet to achieve this but when a request is send to the servlet its create a dropdown in html and write it in PrintWriter stream by using its object but when i check the response on the javascript function using alert it becomes blank and therefore second dropdown not populating with data i have been struggling with this problem since past few days but if i write the same code of servlet for populating the second drop down in a jsp and calling jsp file rather than calling a servlet it is showing data ,its working . my

My jsp


my servlet



what actually i am doing wrong i am not understanding
13 years ago
i am new in java struts i am developing web application in struts 1.3 i have two dropdowns one is for location and another is for Floor,i have a requirement that on change on one dropdown values of other dropdown fills from database for i googled a lot and i got code but when i change on my first dropdown second dropdown does not populate though i saw in debugging mode in Netbeans that that values return from database my sample code is this

my JSP page

<script>
function createRequestObject()
{

var req;

if(window.XMLHttpRequest)
{
//For Firefox, Safari, Opera
req = new XMLHttpRequest();
}
else if(window.ActiveXObject)
{
//For IE 5+
req = new ActiveXObject("Microsoft.XMLHTTP");
}
else
{
//Error for an old browser
alert('Your browser is not IE 5 or higher, or Firefox or Safari or Opera');
}

return req;
}

//Make the XMLHttpRequest Object
var http = createRequestObject();

function sendRequest(method, url)
{

if(method == 'get' || method == 'GET')
{

http.open(method,url);
http.onreadystatechange = handleResponse;
http.send(null);
}
}

function handleResponse()
{

if(http.readyState == 4 && http.status == 200)
{

var response = http.responseText;
if(response)
{

document.getElementById("dwnfloor").innerHTML = response;
}
}
}

function getFloorDropdown(SelectedValue)
{
alert(SelectedValue);
sendRequest('GET','http://localhost:8084/AssetManagement/DropDown?locid=' +SelectedValue );
}

</script>

<tr>
<td >
<span style="color:#FF0000">*</span>Location</td>
<td> <html:select name="RoomForm" property="name"
onchange="getFloorDropdown(this.value)">
<html:option value="0">Select Location</html:option>
<html:optionsCollection name="RoomForm"
property="list" value="id" label="name" />
</html:select>
<td>

</tr>
<tr>
<td >
<span style="color:#FF0000">*</span>Floor
</td>
<td id="dwnfloor">

<select name="dwnfloor">
<option value="0">Select Floor</option>
</select>


</td>

</tr>

my Servlet

protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
processRequest(request, response);

String country=request.getParameter("locid");
String buffer="<select name=\"dwnfloor\"><option value=\"0\">Select</option>";

Connection connection = null;
PreparedStatement p_statement = null;
Statement statement = null;
ResultSet result = null;

try{
DAOOperation dao= new DAOOperation();
/* ResultSet rs=dao.PopulateDropDown(country);*/
String sqlst = "select id,name from floor_mst where id=?";


try {
connection = DBConnection.getConnection();
p_statement = connection.prepareStatement(sqlst);
p_statement.setString(1, country);

result = p_statement.executeQuery();
while(result.next())
{
buffer=buffer+"<option value=\""+result.getString("ID")+"\">"+result.getString("name")+"</option>";
}
buffer=buffer+"</select>";
response.getWriter().println(buffer);
System.out.println(buffer);

} catch (Exception e) {
e.printStackTrace();
}// end of catch

finally {
try {
connection.close();
} catch (Exception e) {
}
}// end finally



}
catch(Exception e){
System.out.println(e);
}

}
and servlet mapping in web.xml

web.xml

<servlet-mapping>
<servlet-name>DropDown</servlet-name>
<url-pattern>/DropDown</url-pattern>
</servlet-mapping>

where i am doing wrong i am not understanding please any body help
13 years ago
i am a new bee in java struts i am developing web app in struts 1.3 i have a requirement that i have to display checkbox in display table tag with checked status true in some checkboxes and for other unchecked . depend upon the values come from database and when user is checking checkboxes these values i have to save in database as true how to do
this. this i am not understanding please give me some sample it would be my great help

13 years ago