Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JSP-Servlet passing values between jsp file through hyperlink in div tag
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


akshatha
passing values between jsp file through hyperlink in div tag
0 Answer(s)      3 years and 6 months ago
Posted in : JSP-Servlet


<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>

Advertisement
View Answers

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 value in hyperlink - JSP-Servlet
Passing value in hyperlink  How to pass value in anchor tag or HTML link from one JSP page to another JSP page ?and how to retrieve values in another...;------------------------------------read for more information.http://www.roseindia.net/jsp
passing values - JSP-Servlet
passing values  hi this is my jsp page Reserved By: Conference Hall..._DataInsertion(Name,Hallno,Time,Date,Mobileno,Status) values('"+name+"','"+hallno+"','"+time
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 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
passing file parameter through ajax - Ajax
passing file parameter through ajax  I have file parameter in jsp file, i need to pass it to server side through ajax. how i can i do that.   Hi friend, file1.jsp passing file using jsp
how to pass the mutiple values from <Ui:datagrid hyperlink - JSP-Servlet
how to pass the mutiple values from    I am getting the error when passing the values from this way emp2=${employee.lastName1} & name=${employee.firstName.How to pass the values from hyperlink in column
passing values form javascript - JSP-Interview Questions
passing values form javascript  please i want to pass values from javascript function to jsp code how can i do
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
passing the form values with image upload - JSP-Servlet
passing the form values with image upload  Hii . I want to get the solution for passing values with an image uploading form. I cant access... the values of other filds from the actual file that uploaded.Please give me
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
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
how to pass the mutiple values from <Ui:datagrid hyperlink - JSP-Servlet
how to pass the mutiple values from      Hi Friend, Please post your full code. Thanks
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
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 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
class of div tag
class of div tag  How can i recognize the selected DIV class
Transferring values between javascript and java code in jsp - JSP-Servlet
Transferring values between javascript and java code in jsp  Is there a way to transfer values between the javascripts and the java code(scriptlet, expressions etc) in a jsp page?   Hi Friend, 1)Pass value from jsp
Div (Ajax Tag) tag Example
Div (Ajax Tag) tag Example       In this section, you will learn about the div tag. The div tag is an Ajax... without refreshing the entire page. The div tag when used with Ajax refreshes
Advertisements
 

 

 

DMCA.com