RSS Forums RSS
Please support our JSP advertiser: Lunarpages JSP Web Hosting
Views: 3484 | Replies: 0 | Thread Tools  Display Modes
Reply
Join Date: Aug 2005
Posts: 10
Reputation: tllcll is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
tllcll tllcll is offline Offline
Newbie Poster

how to get value from javabean

  #1  
Oct 17th, 2005
Hi,
I would like to know how to assign and display the value to a column name 'item_name' in first.jsp

I have 2 jsp pages - first.jsp , second.jsp. The first.jsp will call the second.jsp and pass in the value. In the second.jsp, I will call the method in the bean file. how do I assign the value and return to the first.jsp.

In second.jsp, i manage the get the value for itemDesc but not sure how to assign this to the column 'item_name' in first.jsp

TQ

The following codes for yr ref
second.jsp
--------------
<jsp:useBean id = "trx" class=".trx.TransDetails" scope="request" />
<% String in_num = request.getParameter("in_num");
String itemDesc = trx.getItem(in_num); // pass in the code and get from database the desc, and return to itemDesc to be display in first.jsp

%>
<script>
window.history.back();
</script>

first.jsp - part of the html body
------------------------------------
<table border="1" width="100%">
<tr>
<th bgcolor="#99CCFF" width="3%">No.</th>
<th bgcolor="#99CCFF" width="15%">Item Code</th>
<th bgcolor="#99CCFF" width="25%">Item Name</th>
</tr>

<%
int i;
for (i=1;i<=5;i++) {%>

<tr>
<td width="3%"><center><%=i%></center></td>
<td width="15%">
<input type="text" name="item_num<%=i%>"
style="width:100%;text-align:left;" maxlength=15
onChange="location.href='second.jsp?in_num='+this.value,
openRow(<%=i%>);">
</td>

<td width="19%">
<input type="text" name="materialDesc<%=i%>"
style="width:100%" value="" disabled>
</td>
</tr>
</table>
AddThis Social Bookmark Button
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 5:26 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC