Plain JSP and java: can any one help .
I explained below the logic
each declaration & loop has comment
if possible please try it
After you run this code it will work fine as many as entris you want
Just make some changes remove comment marked with @ then run again the same program for more than 26 entries it will not work ..
I want this code to work for any no of entries user selected . minimum 30-35
<%@ page contentType="text/html;charset=windows-1252"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<script type="text/Javascript" language="Javascript">
function goto()
document.forms[0].submit();
</script>
</head>
<body>
<%
/* this block declares the array elements for storing the values when page is submitted*/
String len="";
String arr_sr_no[]=null ;
String arr_frmdeler_nm[]=null;
String arr_frm_dest[]=null;
String arr_todeler_nm[]=null;
String arr_to_dest[]=null;
String arr_mode_trans[]=null;
String arr_fare[]=null;
/* When page get submitted values are stored in theese array elements */
arr_sr_no=request.getParameterValues("sr_no");
arr_frmdeler_nm=request.getParameterValues("frm_dlr_name");
arr_frm_dest=request.getParameterValues("frm_dest");
arr_todeler_nm=request.getParameterValues("to_dlr_name");
arr_to_dest=request.getParameterValues("to_dest");
// @ arr_mode_trans=request.getParameterValues("transport_mode");
arr_fare=request.getParameterValues("fare");
/* Array of serial number is null for first time when page gets loaded so i initialized
the len="1";
if(arr_sr_no==null)
len="1";
/* when array of serial is not null when page gets loaded
i initialized len with the length of the array of serial number i.e arr_sr_no[]
if(arr_sr_no!=null)
int i = arr_sr_no.length;
len = Integer.toString(i);
// Converted String len into Integer
int add_cnt = Integer.parseInt(len);
/* this line gets the value from Select combo which select no. of rows to be generated
for table entries */
String str2=request.getParameter("no_statements");
String str3="";
//when str2 is not null initialize the str3 with str2.
// This is for that how many rows we have selected in <select> tag
//else part is for first time when page is loaded
// so that one row will be defaultly created
if(str2!=null)
str3=str2;
else
str3="1";
//converted String to integer..
int entry=Integer.parseInt(str3);
%>
<form name="myform" >
<table width="500" border="1" >
<tr>
<%--This is Select tag which Selects the No of Rows whch onChange calls goto()
and page gets submitted
--%>
<select name="no_statements" onChange="goto()">
<%
int cnt;
for( cnt=1;cnt<=30;cnt++)
%>
<option value="<%=cnt%>" <% if(entry==cnt) out.println("selected");%>> <%=cnt%> </option>
<%
%>
</select>
</td>
<%
/* This for loop gets the iterates for Selected no of Rows in <SELECT> tag
"entry" variable is initialized above for selected rows
for (int i=1;i<=entry;i++)
String strdlr_name="";
String strfrm_dest="";
String strtodeler_nm="";
String strto_dest="";
String trans_mode="0";
String strfare="";
/* This condition checks for any array is not null*/
if(arr_sr_no!=null)
/* this array checks for each time that i is less than add_cnt
where add_cnt is length of arr_sr_no[] (which is in turn length
of each array we have stored above)
This cond'n ensures that no null pointer assignment is done
if(i<=add_cnt)
/* we initializes each element of each array serially to
local String variables */
strdlr_name=arr_frmdeler_nm[i-1];
strfrm_dest= arr_frm_dest[i-1];
strtodeler_nm= arr_todeler_nm[i-1];
strto_dest= arr_to_dest[i-1];
// @ trans_mode=arr_mode_trans[i-1];
strfare =arr_fare[i-1];
}// end of inner if
}// end of outer if
%>
<tr>
<%-- here we assign local string values to <input> box this will
this will ensure that all entris will stay intact when page
gets submitted
--%>
<td><input name="sr_no" type="text" value="<%=i%>" size="2"></td>
<td><input name="frm_dlr_name" type="text" value="<%=strdlr_name%>" size="16"></td>
<td><input name="frm_dest" type="text" value="<%=strfrm_dest%>" size="11"></td>
<td><input name="to_dlr_name" type="text" value="<%=strtodeler_nm%>" size="18"></td>
<td><input name="to_dest" type="text" value="<%=strto_dest%>" size="11"></td>
<%-- @ <td><select name="transport_mode" >
<option value="0" <%if("0".equals(trans_mode)) out.println("selected"); %>>--Select--</option>
<option value="1" <%if("1".equals(trans_mode)) out.println("selected"); %>>Air</option>
<option value="2" <%if("2".equals(trans_mode) )out.println("selected"); %>>Train</option>
<option value="3" <%if("3".equals(trans_mode)) out.println("selected"); %>>Bus</option>
<option value="4" <%if("4".equals(trans_mode)) out.println("selected"); %>>Taxi</option>
<option value="5" <%if("5".equals(trans_mode)) out.println("selected"); %>>Two Wheeler</option>
<option value="6" <%if("6".equals(trans_mode)) out.println("selected"); %>>Auto Rikshaw</option>
</select>
--%>
<td><input name="fare" type="text" value="<%=strfare%>" size="4"></td>
</tr>
<%
}// End of For loop
%>
</table>
</form>
</body>
</html>Hope you will reply
it is very urgent
No need to post it again. Particularly when it is right near the top.
http://forum.java.sun.com/thread.jspa?threadID=765816&tstart=0
Similar Messages
-
When I connect my Macbook Pro to my Dell DLP projector, either via cable or wirelessly, I just see a dark screen with the mouse and mouse trails only, can any one help?
jpmarkques post is a good start point, after folling his directions, you can try detect displays. Also try different rsolution and refresh rates.
Most of the projectors I have used support a 1024X768 res.
Youcan also try a pram reset if it still does not detect.
Leave theproctor connected and powered up, power down the MBP.
Power back up the MBP and hold the following keys before you hear the start up chime:
Option, command, P,R (no commas) continue to hold these keys till you hear the start up chime 2 times. -
Since itunes and apple tvs latest update I have had problem wtching movies on apple tv via my itunes can any one help, movie takes a very long time to load sometimes never, it use to work really well, whats going on please help?
You might find useful information in item D1 of Time Machine Troubleshooting.
-
Hello guys..!! I have got my new iphone 4 2 days ago.The same day it got a problem of auto restart in every 1, to 2 minutes. I updated and restored it many times...but of no use... can any one help me how to solve this problem..!!
Go to Settings/General/Reset - Erase all content and settings. the connecto to iTunes and restore as a New phone. Do not restore any backup. If the problem persists you have a hardware problem. Take it to Apple for exchange.
This assumes that the phone is not hacked or jailbroken. If it is you will have to go elsewhere on the internet for help. -
I am not able to register my Apple ID for iCloud and the error is "the maximum no of free accounts have been activated on this phone" can any one help me why I need to do
Sir, your Apple ID can be used as an iCloud account as well. They are both the same thing.
You can learn more from --> Set up your Apple ID for iCloud and iTunes - Apple Support -
can any one help me to fix my ipod touch it wont recognized by my laptop and itunes its said usb not recognized its freeze iin display usb and itunes logo pls help me pls itried all the uninstall unknown device and reboot the ipod and restore pls help me thanks
Try the suggestions found here: http://www.apple.com/support/ipodtouch/assistant/itunes/
-
I'm not able to copy and paste files from my mac to hard disk and usb. I have tried dragging the items I want to copy to those devices but it won't work. I also have tried copying and pasting those files onto those devices too but that doesn't work too. Can any one help?
Hi BobRz
Thanks for you suggestion but it didn't work - are there other ways for solving this problem? Or is it because my files that I want to copy and paste onto my hard disk etc are too big? (However there is space on my hard disk and it works on a PC) -
I have MAC OSX 10.5.8 and need to install adobe illustrator. I checked the compatibility and found that CS5 will work.Can any one help where i can find it. The trail version is fine with me as i just have to use it for couple of days till i get my mac book back from service. Can any one help me on this.
You are welcome, ameronweb.
To elaborate a bit, you may come across offers of a new/unopened/unregistered version, which is the simplest case (you would need a guarantee). Other cases require much detailed information (and a guarantee).
If upgrading to 10.6.8 or higher is an option, you could use CS6. -
Have just down loaded Yosemite over Mountain Lion, Indesign CS5 does not work ( Am dependant on it) although Bridge , Light Room and Elements operate OK How do I solve this rapidly. Can any one help on this issue. Thanks
Sorry to say it, but I think you can see from Bob's response that there's no way to solve this rapidly.
Did you take an image of your Mountain Lion install before upgrading to Yosemite? Roll back to that. If you're not in the habit of taking a snapshot of your system before performing operating system upgrades - get in that habit. If you are dependent on anything at all on hour computer, having a reliable backup method in place is essential. If you don't have a Time Capsule, or some other way to run Time Machine onto a disk that's not in your computer, go set that up yesterday.
If you can't just remove Yosemite and roll back to Mountain Lion for whatever reason, you can partition your drive so that you can install both Yosemite and Mountain Lion on the same drive, and then boot into Mountain Lion when you need to work in CS5. Or you can take your Mountain Lion disc (I assume you have one, no?) and then use it to create a virtual machine in something like VirtualBox to run Mountain Lion from inside Yosemite. -
I have a early 2008 macbook 13 inch and dont have the pass word can any one help?
I have an early 08 macbook that is locked by password and do not know Itunes account. can any one help thanks.
Upgrading to Yosemite
You can upgrade to Yosemite from Lion or directly from Snow Leopard. Yosemite can be downloaded from the Mac App Store for FREE.
Upgrading to Yosemite
To upgrade to Yosemite you must have Snow Leopard 10.6.8 or Lion installed. Download Yosemite from the App Store. Sign in using your Apple ID. Yosemite is free. The file is quite large, over 5 GBs, so allow some time to download. It would be preferable to use Ethernet because it is nearly four times faster than wireless.
OS X Mavericks/Yosemite - System Requirements
Macs that can be upgraded to OS X Yosemite
1. iMac (Mid 2007 or newer) - Model Identifier 7,1 or later
2. MacBook (Late 2008 Aluminum, or Early 2009 or newer) - Model Identifier 5,1 or later
3. MacBook Pro (Mid/Late 2007 or newer) - Model Identifier 3,1 or later
4. MacBook Air (Late 2008 or newer) - Model Identifier 2,1 or later
5. Mac mini (Early 2009 or newer) - Model Identifier 3,1 or later
6. Mac Pro (Early 2008 or newer) - Model Identifier 3,1 or later
7. Xserve (Early 2009) - Model Identifier 3,1 or later
To find the model identifier open System Profiler in the Utilities folder. It's displayed in the panel on the right.
Are my applications compatible?
See App Compatibility Table - RoaringApps. -
i have my brother i phone 5 but i dont have i cloud id or password i have serial number and all package the iphone can any one help me cuz i want open it please cuz my brother is dead sorry for time
first i thank u
but i just want apple id for his wife can remmber the password for the id he was have much more 5 apple id and i try to put them and i think u and apple can help us for we are older users of apple . them cant help us for just 1 time i have all package of phone the serial number and IMEI all of it . and thx u agine -
my phone suddly switched off and now its not switching on can any one help me when it swithch off my phone battery was full.
Which apps do you open acouse iphone switched off? You can try to reset iPhone.
-
I have new I pad 2 and when I get connected to iMac I can't find it detected in I tunes can any one help me and i am new to I pad
If it's not showing on the left-hand sidebar of your Mac's iTunes (if you are on iTunes 11 then you can enable the sidebar via option-command-S) under Devices then see if this troubleshooting article helps : http://support.apple.com/kb/TS1591
-
Am unable to insert table and graphs into word document in labwindow/CVI? can any one help me ?
Are you using the Word Report Generation instrument? You can find it in toolslib\activex\word\wordreport.fp under the CVI directory.
The instrument comes with a sample project that shows how to include table and graphs in a Word document: see samples\activex\word\wordrpt.cws in the samples foder of your CVI installation.
Proud to use LW/CVI from 3.1 on.
My contributions to the Developer Zone Community
If I have helped you, why not giving me a kudos? -
hi my account was locked for some security reasons and i forget the securicty questions and when i am trying to reset my password through email i am not gettig mail to my id can any one help.
<Edited by Host>Have you checked Spam? I have noticed recently in my Gmail that Google sends some mails from Apple to the Spam folder.
<Edited by Host>
Maybe you are looking for
-
I need help with my setup Please !!! 2800+ athlon xp
hi all .......... great forum here.....!!! I am having probs with my new setup and I am at a wits end of what to do so i'll explain my problem. I have just bought a AMD athlon 2800+ cpu for my mobo (KT3 ultra 6830e v.1.0) and I am unable to run the c
-
Transfer of Itunes Library to Vista
I have a single PC running Media Center Edition with an 80Gb hard drive. I bought a new 750Gb drive and decided to install Vista on it. Both drives are installed and I can boot to Vista by swapping the SATA drive cable. I have installed Itunes under
-
AVCHD (1080i) to DVD
Hi friends! I´ve record with Sony cameras a wedding.The file format was AVCHD 1080i. I need to deliver to the client a Bluray and a DVD with the same content. Using the Premiere and Encore Cs6 the Bluray has a very good quality. I have edit in Premie
-
Customer Statements F.27 by email
Hi all: I want to send custom statements by email using F.27 Do I use BTE 2310? I have already mapped it in FIBF using the sample code in include LXFKOF01 I have put a breakpoint in the BTE however its not stopping. what else am i missing? please hel
-
Hidden/Missing Text - Acrobat Pro
I have Acrobat 9 Pro for my Mac. I created a PDF from a blank page. My document has an opening paragraph, and then a list of 100 + names. While I see my PDF is three pages long, the two and a half pages with the names are blank. Is this part of Metad