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

 
 


akshatha
passing values between jsp file through hyperlink in div tag
0 Answer(s)      2 years and 2 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>
View Answers









Related Pages:
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
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 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 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
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
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 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 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 - 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
use data from database as hyperlink and pass the data in the hyperlink
and display tag property I have displayed a column data as hyperlink. I want to pass... data as hyperlink and all the data links are passing the first parameter only. I...use data from database as hyperlink and pass the data in the hyperlink 
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
hyperlink
hyperlink  I have a .xls file and i want the code to open this .xls file in read only mode when i click on a hyperlink,it should not not be editable,please send me the code
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
Hyperlink
Hyperlink  The excel file is not opening in read only mode ,it is editable,actually i need to open it in read only mode by clicking on link.please help me
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
div to scrollbar - Java Beginners
div to scrollbar  hi, thanks a lot for replying but my question is some what different let me make it more clear i have div which increases in size... that division but now the question is if i resize the window which means when the div
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 Parameters in jsp
file. We are passing the parameters using the tag <jsp:param> which contain... for retrieving parameter values by name. Parameters can be passed by using a tag <jsp... Passing Parameters in jsp     
not able to get values from jsp file - JSP-Servlet
remove encrtype from form tag its work fine please go through the file...not able to get values from jsp file  hi thanks for u feedback, her am sending the file jsp and servlet but in the servlet file am not able to get
Passing Multi select list box values using ajax to get values to dependent list box
Passing Multi select list box values using ajax to get values to dependent list box  Hi, I have a jsp page which has 3 dependent list boxes with multiple selection. How can i pass multiple selected values through ajax to retrieve
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
Declaring Tag Libraries In JSP
;%@taglib %> directive of the JSP. This tag has some own attributes and it's values... Declaring Tag Libraries In JSP   ... the attributes we declare the tag libraries through the <%@taglib %> directive like
how to show hyperlink website on the same page
can do it with div tag but i'm not sure about that. i do not want to click...how to show hyperlink website on the same page  dear sir: i need... www.roseindia.net by clicking on roseindia in hyperlink that will be displayed
Passing Parameter with <jsp: include>
Passing Parameter with <jsp: include>      In this example we are going to use <jsp:include>... a file in a jsp page. While using <jsp:param> we are adding
Passing Parameters using <jsp: param>
file by using a <jsp: param> tag. We can use multiple <jsp: param> tag...; In this example we are passing a parameters to a file by using <jsp...Passing Parameters using <jsp: param>   
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
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 Parameters - JSP-Servlet
Passing Parameters  Hi I have to pass parameter like... First Name /**SECOND PAGER upto this page I passed the parameter through query string **/ Name /** I have to redirect all received params through
Passing values from child window to parent window.
Passing values from child window to parent window.  Hai, I'm having... check boxes those check box values should be shown in the parent window,which will have some more values in it.The values which are selected from child window
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
Insert Image In DB through Servlet - JSP-Servlet
Insert Image In DB through Servlet  Dear Sir, My previous Query..."); System.out.println("Connection created"); File imgfile = new File("C://Core... pre = conn.prepareStatement("insert into MyPictures values
Insert Image In DB through Servlet - JSP-Servlet
("insert into Image(id,imgName,image) values (?,?,?)"); File file= new File...Insert Image In DB through Servlet  Dear Sir, My previous Query..."); System.out.println("Connection created"); File imgfile = new File("C://Core
Insert Image in DB through Servlet - JSP-Servlet
(id,imgName,image) values (?,?,?)"); File file= new File(filename...Insert Image in DB through Servlet  Dear Sir, My previous Query..."); System.out.println("Connection created"); File imgfile = new File("C://Core
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
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
write Div in jsp page - JSP-Servlet
write Div in jsp page  How can i write Div class in jsp page?  Hi Viral Sonawala tag is a html tag, perform the same function in jsp.... The tag is supported in all major browsers. Optional Attributes: align : left
File Tag (Form Tag) Example
File Tag (Form Tag) Example       In this section, we are going to describe the file tag. The file tag is a UI tag that renders an HTML file input element achieved through browsing. Add
JSF commandLink Tag
handling purposes through the backing bean. This tag has text that can... document and the document linked to by the hyperlink. It's values... linked to by the hyperlink to the current document. It's values
class of div tag
class of div tag  How can i recognize the selected DIV class
passing from 1 jsp to another - JSP-Servlet
passing from 1 jsp to another  Hi Sir, What are the ways and means of passing from 1 jsp page to another page.what are the different types of methods?  Hi Friend, You can use tag,sedRedirect() method
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

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.