This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Building Blockchain Apps and have Michael Yuan on-line!
See this thread for details.
Win a copy of Building Blockchain Apps this week in the Cloud/Virtualization forum!

reddy kl

Greenhorn
+ Follow
since Apr 04, 2002
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 reddy kl

hi all,i have <html:select> in which am getting collection and in onchange function i want to display the respective(selected one)page in other(different) frame.can any help me out with a piece of code...
------here is my <html:select>-----
<html:select property="selectedClaimType" onchange="toViewClaimType(this.form)">
<html ptions collection="claimValueList" property="value" labelProperty="label"/>
</html:select>
------
and in the function toViewClaimType() ..how to set different actions based on selection???
c'ze the contents in claimValueList got it's own jsp page////
thanks in advance...
reddy kl
17 years ago
hi when am trying to populate with "COLLEC" select box where collec is the vector contains the values returned from db.
<html:select property="empName">
<html ptions collection="COLLEC" property="value" labelProperty="label"/>
</html:select>
form is not displaying and throwing null pointer exception??
any adices?thanks in advance
regds
reddy
17 years ago
hi,the bean should be in package and the corresponding class file should be under web-inf/classes/packagename/Box.class,not ur Box.java as u did earlier
bye
Dev
17 years ago
JSP
hi all..
here i am passing folder name as parameter and taking that path,am listing out all the files in that folder with theire name s in one frame(fileview..name of the frame) and if i click on that name it is dispalying in other frame (reportview..name of the frame).it is working fine in local host but not in lan systems..
what could be the problem?i used file: before path and also tried with http://localhost:8080/ranhill/webreports/rhreports....here is the code i've used...
plz advise me the best way to deal with it
thanks in advance..
..dev

<html>
<body bgcolor="#455667" text ="silver" alink=red vlink=silver >
<%@ page errorPage = "errorpage.jsp" %>
<%@ page language = "java" import ="java.util.*" %>
<%@ page import ="java.io.*" %>
<%@ page import ="java.util.Vector" %>
<%@ page import = "java.util.Iterator" %>
<%
String path="c:\\tomcat\\webapps\\ranhill\\RHReports\\"+request.getParameter("projects");
System.out.println("this is selected project report:"+path);

File dir = new File(path);
String[] files = dir.list();
for(int i =0 ; i<files.length; i++)
{
%>
<table cellpadding="1" cellspacing="1" bordercolor="pink">
<tr><td bgcolor="#455667" width="30"> <h4><b>
<a href=<%= path+"/"+files[i] %> target = "reportview"> <%= files[i] %> </a>
</h4></b></td></tr></table>
<%
}
%>
</body>
</html>
17 years ago
JSP
Hi all
i have two listboxes and when i selected one item in first listbox and submitting the form,am getting the items in next listbox according the item selected in the first listbox from the database.but the item which i selected in first listbox is not appearing but taking the default value...
how to retain that item..plz note that the items in first listbox are also from database...
can any one help me out with code snippet..
thanks in advance..
regd
dev
17 years ago
JSP
hi Sean,
thank u for kind response.i got it.
regds
dev
17 years ago
JSP
hi ..here i am creating a directriry by giving name in the code itself but i want to give it from front end..means i want to pass the direcory name as parameter..
here is my code..
can anyone come with modification to this code..
thanks in advance
<%@ page language="java" import="java.io.*"%>
<%
File f = new File("[drive]:/anypath/newdir");
if(f.exists()) {
out.println(f + " exists");
}
else { // Doesn't exist
f.mkdirs();
//out.println("created " + f);
}
%>
17 years ago
JSP
hi all,
my probelm is, i have two listboxes and some text fields and based on first list box selected item,the items in second list box are displaying .i used javascript function(onChange event) to submit the form.but i am loosing data in text fields as well as item in first list box..so how to retain those values...which is better..javascrpt or jsp sessoin..if anybody has code..plz help me out in this..
17 years ago
JSP
Hi..
i got it ..
thanks
17 years ago
JSP
i have two dropdown menus ..upon selecting item from one listbox,items in second listbox shoud change accordingly..
i tried with javascript function event..onChange...but could not able to pass the parameter to querystring..getting error like..Object does not support this property/method..
here goes my code...
<html>
<head>
<title>User page</title>
<script language="JavaScript">

function Selec()
{

var some = (document.user.company.options[document.user.company.selectedIndex].value);
alert(some)
document.user.action = ("UserProcess.jsp?whatstr="+some+"");

document.user.submit();

}

</script>
</head>
<body bgcolor="#123456" text="silver">
<form name ="user" method="post" action="UserProcess.jsp">
<br><br>
<center><h2>User Details</h2></center>
<center><table border="3" bgcolor="gray" bordercolor="silver">
<tr><td>Userid:</td><td><input type ="text" name ="uid"></td></tr>
<tr><td>Password:</td><td><input type ="password" name ="pwd"></td></tr>
<tr><td>Role</td><td><input type ="text" name ="role"></td></tr>
<tr><td>First Name:</td><td><input type ="text" name ="fname"></td></tr>
<tr><td>Last Name:</td><td><input type ="text" name ="lname"></td></tr>
<tr><td>E-Mail:</td><td><input type ="text" name ="email"></td></tr>
<tr><td> Company</td><td> <select name="company" onChange="Selec()">
<%@ page errorPage = "errorpage.jsp" %>
<%@ page language="java" import="java.sql.*" %>
<%!
Connection con = null;
Statement st = null;
ResultSet rs = null ;
String param = null;
%>
<%
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection("jdbc dbc:rannhill","","");
st = con.createStatement();
// database parameters
// generate query
String Query = "SELECT DISTINCT companygroup FROM projects_table";
// get result
rs = st.executeQuery(Query);
// get and display each record
while(rs.next())
{
String comp = rs.getString("companygroup");
%>
<option value= '<%= comp %>'> <%= comp %>

<%
}
// close connections
rs.close();
st.close();
con.close();
%>
</select>
</td>
</tr>

<tr>
<td><b>  Project  </b></td>
<td>
n <select name="project">
<%
Connection con1 = null;
Statement st1 = null;
ResultSet rs1 = null ;

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con1 = DriverManager.getConnection("jdbc dbc:rannhill","","");
st1 = con1.createStatement();
// database parameters
// generate query
param = request.getParameter("whatstr");
System.out.println("this is parameterfrom js function.."+param);
String Query1 = "SELECT DISTINCT title FROM projects_table where companygroup='"+param+"'";
// get result
rs1 = st1.executeQuery(Query1);
System.out.println("after query of projects");
System.out.println(rs1);
// get and display each record
while(rs1.next())
{
String proj = rs1.getString("title");
out.println("<option>" + proj);
}
// close connections
rs1.close();
st1.close();
con1.close();
%>
</select>
</td></tr>
</table>

<br><br>
<center><table width ="200" border="2"><tr>
<td><input type ="submit" value = "Add" name = "action"></td>
<td><input type ="submit" value = "ShowAll" name="action"></td>
<td><input type ="submit" value = "Edit" name="action"></td>
<td><input type ="submit" value= "Delete" name="action"></td>
<td><input type = "Reset" value="Clear"></td></tr></table></center>
</form>
</body>
</html>
18 years ago
JSP
hi ..
my prblem is like this say i have two frames and while loading the window one jsp in one frame with listbox will appear and after selecting item from list box i will call another jsp whose output should be displayed in other frame...
can any one come up with code snippet...
i gave like this..
<form name ="f1" method="post" action="Second.jsp" target="parent.secondframe">

thank in advance..
18 years ago
JSP