passing values between jsp file through hyperlink in div tag

Ads
 

passing values between jsp file through hyperlink in div tag

<p>hi please help me to solve this. i have searchproj.jsp and updateproj.jsp. In searchproj.jsp values r retrieved from db as follows </p>

<pre class="prettyprint">&lt;%@ page import="vo.SearchProjVO"%&gt;   
&lt;%@ page language="java"%&gt;   
&lt;%@ page import ="java.sql.*"%&gt;   
&lt;HTML&gt;   
&lt;head&gt;   
&lt;meta http-equiv='Content-Type' content='text/html; charset=utf-8' /&gt;     
&lt;link type='text/css' rel='stylesheet' href='/css/crec.css' /&gt;    
&lt;script src="js/AdminHeader.js"&gt;&lt;/script&gt;    
&lt;jsp:include page="/jsp/admin/Adminmenu.jsp" &gt;   
&lt;/jsp:include&gt;   
&lt;%   
String contextPath = request.getContextPath();   
%&gt;   
&lt;script language="javascript"&gt; 
function validate()  
{ 
if(document.frm1.projid.value != "")  
{    
document.frm1.action="&lt;%=contextPath%&gt;/SearchProj";         
document.frm1.submit(); 
} 
if(document.frm1.projname.value != "")  
{    
document.frm1.action="&lt;%=contextPath%&gt;/SearchProj";         
document.frm1.submit(); 
} 
if(document.frm1.cost.value != "")  
{    
document.frm1.action="&lt;%=contextPath%&gt;/SearchProj";         
document.frm1.submit(); 
} 
if(document.frm1.manager.value != "")  
{    
document.frm1.action="&lt;%=contextPath%&gt;/SearchProj";          
document.frm1.submit();  
} 
if(document.frm1.projid.value=="" &amp;&amp; document.frm1.projname.value=="" &amp;&amp; document.frm1.cost.value=="" &amp;&amp; document.frm1.manager.value=="") 
{  
 alert("Please enter any one field."); 
} 
} 
&lt;/script&gt; 
&lt;script language="javascript"&gt; 
function gotoSearchProjAction() 
{  
validate(); 
} 
&lt;/script&gt; 
&lt;/head&gt; 
&lt;body&gt; 
&lt;form name="frm1" method="post"&gt; 
&lt;table width="100%" id='table1'  border="0" cellspacing="0" cellpadding="0"&gt;  
&lt;tr&gt;&lt;td valign="bottom"&gt;
&lt;span class="title"&gt;SEARCH PROJECT&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;  
&lt;tr&gt;&lt;td height="3" bgcolor="#EEEEEE"&gt;&lt;img src="/images/hr-image.gif" width="6" height="4" /&gt;
&lt;/td&gt; &lt;/tr&gt; 
&lt;/table&gt; 
&lt;br&gt; &lt;div align="right"&gt;     
&lt;br&gt; 
&lt;table width="100%" id='table1'  border="0" cellspacing="2" cellpadding="2"&gt;              
&lt;tr&gt;&lt;td width="40%" class="txt-label"&gt;     
&lt;SPAN CLASS="txt-label"&gt;Project ID :
&lt;/SPAN&gt;     &lt;/td&gt;
&lt;td width="60%" class="txt-lable"&gt;     
&lt;input type="text" name="projid"&gt;     
&lt;/td&gt;&lt;/tr&gt;     
&lt;tr&gt;&lt;td width="40%" class="txt-label"&gt;     
&lt;SPAN CLASS="txt-label"&gt;Project Name :&lt;/SPAN&gt;     
&lt;/td&gt;     
&lt;td width="60%" class="txt-lable"&gt;     
&lt;input type="text" name="projname"&gt;     
&lt;/td&gt;   &lt;/tr&gt;     
&lt;tr&gt;&lt;td width="40%" class="txt-label"&gt;     
&lt;SPAN CLASS="txt-label"&gt;Cost Center :
&lt;/SPAN&gt;     
&lt;/td&gt;     
&lt;td width="60%" class="txt-lable"&gt;     
&lt;input type="text" name="cost"&gt;     
&lt;/td&gt;   &lt;/tr&gt;     
&lt;tr&gt;&lt;td width="40" class="txt-label"&gt;     
&lt;SPAN CLASS="txt-label"&gt;Manager :
&lt;/SPAN&gt;     &lt;/td&gt;    
&lt;td width="60%" class="txt-lable"&gt;    
&lt;Select name="manager"&gt;
&lt;option value="" selected&gt;Select&lt;/option&gt;    
&lt;option value="Ashok"&gt;Ashok&lt;/option&gt;&lt;option value="Sathish Kumar" &gt;Sathish  Kumar&lt;/option&gt;&lt;option value="Jaya Kumar"&gt;Jaya Kumar&lt;/option&gt;&lt;option  value="Sean"&gt;Sean&lt;/option&gt;&lt;option value="Somashekar"&gt;Somashekar&lt;/option&gt;
&lt;/select&gt;    &lt;/td&gt;    &lt;/tr&gt; 
&lt;/table&gt; 
&lt;table width="100%" border="0" align="center"&gt;     
&lt;tr&gt;&lt;td&gt;     
&lt;input type="button" name="Search" value=" Search " class="button" onMouseOver=(this.className='buttonover') onMouseOut=(this.className='button') onClick="gotoSearchProjAction()"&gt;     
&lt;/td&gt;&lt;/tr&gt; 
&lt;/table&gt; 
&lt;table width="100%" id='table1'  border="0" cellspacing="2" cellpadding="2"&gt; 
&lt;tr class="tab-highlighted-2"&gt;     
&lt;td class="tab-highlighted-2" width="10%"&gt;       
&lt;div align="left"&gt;Project ID
&lt;/div&gt;     &lt;/td&gt;     
&lt;td class="tab-highlighted-2" width="10%"&gt;         
&lt;div align="left"&gt;Project Name
&lt;/div&gt;     &lt;/td&gt;     
&lt;td class="tab-highlighted-2" width="20%"&gt;       
&lt;div align="left"&gt;Cost Center
&lt;/div&gt;     &lt;/td&gt;     
&lt;td class="tab-highlighted-2" width="20%"&gt;       
&lt;div align="left"&gt;Manager&lt;/div&gt;     
&lt;/td&gt; &lt;/tr&gt; 
&lt;% int count=0; String color = "#F9EBB3"; 
if(request.getAttribute("searchList")!=null) 
{ 
ArrayList al = (ArrayList)request.getAttribute("searchList"); 
Iterator itr = al.iterator(); 
while(itr.hasNext())
{ count++; 
SearchProjVO searchList1 = (SearchProjVO)itr.next(); 
%&gt;     
&lt;tr class="bg-row1"&gt;     
&lt;td class="td-highlighted-2"&gt;     
&lt;div align="left" id="id1"&gt;&lt;a href="&lt;%=contextPath%&gt;/jsp/admin/UpdateProject.jsp?id="+&lt;%=searchList1.getProjid()%&gt;&gt;&lt;%=searchList1.getProjid()%&gt;&lt;/a&gt;&lt;/div&gt;     
&lt;/td&gt;     
&lt;td class="td-highlighted-2"&gt;     
&lt;div align="left"&gt;&lt;%=searchList1.getProjname()%&gt;&lt;/div&gt;     
&lt;/td&gt;     &lt;td class="td-highlighted-2"&gt;     
&lt;div align="left"&gt;&lt;%=searchList1.getManager()%&gt;&lt;/div&gt;     
&lt;/td&gt;     &lt;td class="td-highlighted-2"&gt;     
&lt;div align="left"&gt;&lt;%=searchList1.getCost()%&gt;&lt;/div&gt;     
&lt;/td&gt;     &lt;/tr&gt;    
&lt;% 
} } 
%&gt;  
&lt;% 
if(count==0){ 
%&gt; 
&lt;tr&gt; &lt;td colspan=8 align="center" style="background-color:eeffee"&gt;&lt;b&gt;No Record&lt;/b&gt;
&lt;/td&gt; &lt;/tr&gt; 
&lt;% 
} 
 %&gt;    
&lt;/table&gt; &lt;script src=" /js/SAFooter.js"&gt;&lt;/script&gt; 
&lt;/BODY&gt; 
&lt;/HTML&gt;
</code></pre>

<p>in updateproject.jsp i have to get the values in their corresponding text box from searchproject.jsp </p>

<pre class="prettyprint">&lt;table width="100%" id='table1'  border="0" cellspacing="2" cellpadding="2"&gt; 
&lt;tr&gt;&lt;td width="40%" class="txt-label"&gt; 
&lt;SPAN CLASS="txt-label"&gt;Project ID&lt;/SPAN&gt;
&lt;font color='red'&gt; *&lt;/font&gt;: &lt;/td&gt; 
&lt;td width="60%" class="txt-lable"&gt; 
&lt;input type="text" name="useid" value="&lt;%=request.getParameterValues("id")%&gt;" onchange="if (isNotEmpty(this))" &gt;  
&lt;/td&gt;&lt;/tr&gt;  
&lt;tr&gt;&lt;td width="40%" class="txt-label"&gt;  
&lt;SPAN CLASS="txt-label"&gt;Project Name&lt;/SPAN&gt;
&lt;font color='red'&gt; *&lt;/font&gt;:  &lt;/td&gt;  
&lt;td width="60%" class="txt-lable"&gt;  
&lt;input type="text" name="projname" onchange="if (isNotEmpty(this)) {isStr(this)}"&gt;   &lt;/td&gt;&lt;/tr&gt;  
 &lt;tr&gt;&lt;td width="40%" class="txt-label"&gt;  
 &lt;SPAN CLASS="txt-label"&gt;Cost Centre&lt;/SPAN&gt;&lt;font color='red'&gt; *&lt;/font&gt;:  
 &lt;/td&gt;  &lt;td width="60%" class="txt-lable"&gt;
</code></pre>

<p>   <input type="text" name="cost" onchange="if (isNotEmpty(this)) {isNumber(this)}">         </td></tr> <br />
    <tr><td width="40%" class="txt-label"> <br />
    &lt;SPAN CLASS="txt-label">Manager</SPAN><font color='red'> *</font>:  </td>  <td width="60%" class="txt-lable"> <br />
    &lt;Select name="manager"><option value="" selected>Select</option>  <option value="Ashok">Ashok</option><option value="Sathish Kumar" >Sathish Kumar</option><option value="Jaya Kumar">Jaya Kumar</option><option value="Sean">Sean</option><option value="Somashekar">Somashekar</option></select>  </td></tr> <br />
    </table>   </p>

<p>i am getting [Ljava.lang.String;@e793e4 in the text box. please guide me ......</p>
View Answers

Ads









Related Tutorials/Questions & Answers:
passing values between jsp file through hyperlink in div tag
passing values between jsp file through hyperlink in div tag  <... In searchproj.jsp values r retrieved from db as follows </p> <pre class...;script src="js/AdminHeader.js"&gt;&lt;/script&gt; &lt;jsp
passing values in hyperlink
passing values in hyperlink  Hi. I have given a hyperlink in one jsp page. Can i able to pass that hyperlink label as a value to the next page its navigating when the user clicks it. Plz respond me quickly. Thanks in advance
Advertisements
passing values in hyperlink
passing values in hyperlink  Hi. I have given a hyperlink in one jsp page. Can i able to pass that hyperlink label as a value to the next page its navigating when the user clicks it. Plz respond me quickly. Thanks in advance
passing values in hyperlink
passing values in hyperlink  Hi. I have given a hyperlink in one jsp page. Can i able to pass that hyperlink label as a value to the next page its navigating when the user clicks it. Plz respond me quickly. Thanks in advance
passing values in hyperlink
passing values in hyperlink  Hi. I have given a hyperlink in one jsp page. Can i able to pass that hyperlink label as a value to the next page its navigating when the user clicks it. Plz respond me quickly. Thanks in advance
passing values in hyperlink
passing values in hyperlink  Hi. I have given a hyperlink in one jsp page. Can i able to pass that hyperlink label as a value to the next page its navigating when the user clicks it. Plz respond me quickly. Thanks in advance
passing rs.getString values between the jsp pages using hidden fields
passing rs.getString values between the jsp pages using hidden fields  I want to pass rs.getString values from 1st.jsp to 2nd.jsp using hidden fields like <input type="hidden" value="<%=rs.getString(1
passing data between the jsp pages ?
passing data between the jsp pages ?  i developed a project... the roll number and when we press submit button on that page it moves a jsp page .on that jsp page it retrieve marks regarding the particular roll number
how to get multiple hyperlink values from a table column to another jsp file?
how to get multiple hyperlink values from a table column to another jsp file?  dear sir: this is what i'm trying to do, i have 3 JSP files. first... i copy the hyperlink value to that third jsp file "table2", or if you have
Passing Parameter Values to another jsp in Query Strings
Passing Parameter Values to another jsp in Query Strings  HI ALL, I m trying to pass a variable value to another JSP using query string... even though some values* stored in the variable loginid. Can any one suggest
how to load flash file in any browser through jsp using NetBeans IDE without embed tag
how to load flash file in any browser through jsp using NetBeans IDE without embed tag  I am trying to load a flash file in broser from local disk using jsps.But it's not loading. I used tag like this <object id
Passing values in ComboBox from XML file
Passing values in ComboBox from XML file In this tutorial we are going... tells about the MIME type and character encoding the JSP file uses... are inserting the values in the combobox so we are using the <select> tag
pass a variable(friends name) through a hyperlink in to another jsp.
pass a variable(friends name) through a hyperlink in to another jsp.  hi friends, i am developing a site in jsp. i have some problem,plz tell me the solution. problem: in the welcome page where friends name is show i write
pass a variable(friends name) through a hyperlink in to another jsp.
pass a variable(friends name) through a hyperlink in to another jsp.  hi friends, i am developing a site in jsp. i have some problem,plz tell me the solution. problem: in the welcome page where friends name is show i write
Passing java variables from JSP to Servlet - return null values
Passing java variables from JSP to Servlet - return null values  I want to pass some variables from a JSP page to a servlet. These variables are from... from JSP to servlet gives null values. I got msg=null. Is there another way
reading dropdown values from properties file in jsp
reading dropdown values from properties file in jsp  reading dropdown values from properties file in jsp
Passing a 2 Dimentional Array From one Jsp to Another Jsp file and Retreving it
Passing a 2 Dimentional Array From one Jsp to Another Jsp file and Retreving... are dynamically stored into it in one jsp file .I passed this array into another Jsp... JSP FILE 1 : // declatarion int final
Difference between class,name,id attributes in each JSP tag
Difference between class,name,id attributes in each JSP tag  Can i know the difference between class,name,id attributes in each JSP tags.................. These 3 are only used for reference ..... And what are the differernces
passing values on button click
passing values on button click  Please help me to solve this issue.I want to pass a value assigned to button to another view upon button click in xcode
downloading file through a file's path stored in database in jsp
downloading file through a file's path stored in database in jsp  hi want to download a file from a directory where the file location is stored... table,but i dont know hoe to download the file using its path stored
working of a div tag in html
working of a div tag in html   !DOCTYPE html PUBLIC "-//W3C//DTD...-color:#333399;">mghu</div> <div>Content for New Div Tag Goes... "content for new Div Tag goes here" in red block. why it is happening like
HTML div tag
HTML div tag  I have created a webpage using the div tag. The webpage has the header and the footer. the middle area is divided into left and right parts. The left side has a list of link. The right side part basically shows
HTML div tag
HTML div tag  I have created a webpage using the div tag. The webpage has the header and the footer. the middle area is divided into left and right parts. The left side has a list of link. The right side part basically shows
HTML div tag
HTML div tag  I have created a webpage using the div tag. The webpage has the header and the footer. the middle area is divided into left and right parts. The left side has a list of link. The right side part basically shows
HTML div tag
HTML div tag  I have created a webpage using the div tag. The webpage has the header and the footer. the middle area is divided into left and right parts. The left side has a list of link. The right side part basically shows
passing .properties file as a parameter to another function
passing .properties file as a parameter to another function  passing .properties file as a parameter to another function in an jsp file
passing .properties file as a parameter to another function
passing .properties file as a parameter to another function  passing .properties file as a parameter to another function in an jsp file
passing .properties file as a parameter to another function
passing .properties file as a parameter to another function  passing .properties file as a parameter to another function in an jsp file
passing .properties file as a parameter to another function
passing .properties file as a parameter to another function  passing .properties file as a parameter to another function in an jsp file
class of div tag
class of div tag  How can i recognize the selected DIV class
JSP Tag Libraries
JSP Tag Libraries       JSP Tag Libraries is the collection of standard tags. JSP tags are the Java components that can be used in a JSP file. JSP tag libraries allow us to make Java

Ads