How to pass and receive an array from a form.
For example, now i want to input my students achievement of an exam.
I should input tow fields of data of every student: studentID,achievement.
And i want to post a few of records each time (eg 10 records).
So i should use an array data[10][2] to store 10 records each.
But i don't know how to write it in HTML form. should i use the same name in all the ten <input> fields? or should i do as below:
<form method = "post" ....>
<input type = "text" name = "studentID[0][0]"></input>
<input type = "text" name = "achievement[0][1]"></input>
<input type = "text" name = "studentID[9][0]"></input>
<input type = "text" name = "achievement[9][1]"></input>
</form>
And how can i receive this array using JSP or JSTL or Servlet?
Can u give me an simple example?
I think this will be usefull to you. If ok convert it for 2 dimensional array in the loop
<form>
<%
for(int i=1;i<=10;i++)
%>
<input type="text" name="student[<%=i%>]"/>
<%
%>
</form>
Similar Messages
-
How to pass and receive byte[] via socket
Hi All,
How can I pass a byte[] from client socket to the server socket.
Also how to receive that bye[] at the server socket.
Thanks and best Regards,
- Lasith.Hi All,
Thanks for replying my topic, but still I need some help regarding this.
My requirement is to have client and server socket programs with following functions (this is bit related to cryptography as well :)).
First I generate public and private keys for server and in the client side generating a random number and encrypt it with servers public key and sends to server.
Please refer following code segment.
SecureRandom random = new SecureRandom();
long challange = random.nextLong();
Cipher cipher = Cipher.getInstance("RSA");
cipher.init(Cipher.ENCRYPT_MODE, key, new SecureRandom());
byte[] cipherText = cipher.doFinal(new Long(challange).toString().getBytes());
String cipherTextToServer = cipherText.toString();Then I am passing this string to server socket as follows,
if(cipherTextToServer !=null)
out.println(cipherTextToServer );The server should take this text and decrypt it as follows.
PrintWriter out = new PrintWriter(client.getOutputStream(),true);
BufferedReader in = new BufferedReader(new InputStreamReader(client.getInputStream()));
while((fromClinet = in.readLine()) != null){
System.out.println("Server -> "+fromClinet);
System.out.println("Server -> "+*getDecriptedMassage*(fromClinet,prvKey));
out.println(Utility.getDecriptedMassage(massage,prvKey));
public String getDecriptedMassage(String massage,Key key) throws Exception{
Cipher cipher = Cipher.getInstance("RSA");
cipher.init(Cipher.DECRYPT_MODE, key);
byte[] plainText = cipher.doFinal(massage.getBytes());
System.out.println("plain : " +new String(plainText));
return plainText.toString();
}When running the program I am getting following error.
Exception in thread "main" java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(Unknown Source)
at sun.nio.cs.StreamDecoder.readBytes(Unknown Source)
at sun.nio.cs.StreamDecoder.implRead(Unknown Source)
at sun.nio.cs.StreamDecoder.read(Unknown Source)
at java.io.InputStreamReader.read(Unknown Source)
at java.io.BufferedReader.fill(Unknown Source)
at java.io.BufferedReader.readLine(Unknown Source)
at java.io.BufferedReader.readLine(Unknown Source)
at Client.main(Client.java:46)
As my investigation if I can remove following code segments then program is working fine.
System.out.println("Server -> "+*getDecriptedMassage*(fromClinet,prvKey));
out.println(Utility.getDecriptedMassage(massage,prvKey));So this should be a error when decrypting message. If I am further explaining this the sending encrypted message with client is not same as getting decrypted message on server. Because of this program is giving the error. -
How send and receive XML file from PI 7.0 via SSL
Hello experts,
Can you point to some documentation , examples , links where I can get some information on how to send and receive XML files using PI 7.0 via SSL ?
Thanks in advance.Hi,
refer to the following links.
Enabling SSL
http://help.sap.com/saphelp_nwpi71/helpdata/en/14/ef2940cbf2195de10000000a1550b0/content.htm
Adapter specific security
http://help.sap.com/saphelp_nwpi71/helpdata/en/f5/799add57aeee4f889265094a04695c/frameset.htm
regards,
MIlan Thaker. -
How can I send and receive a message from a queue using standalone program
Hi,
I want to write a standalone Java program which has to post a message to a queue and receive a message from a queue thats specified as a replyto queue.I want to have my application to be completely standalone without the need of a Application server.What all the Jars do I need to include in the application.My aim is to have the application standalone and portable so that the application runs on any machine that has a JRE.
Thanks in advance,
PrathimaHi,
You can get quite simple standalone MQ Java programs from this site http://www.capitalware.biz/mq_code_java.html.
Also regarding the jars required for your application depends on the API being used. If you use MQI API few jars are required and if you decide to use JMS API you'll require few other jars. But you got to either install Websphere MQ Java Client, which will copy the jars to the respective location, or you can choose to copy the jars from some other machine manually.
Eventually, all the jars related to MQI and JMS API will reside under /usr/mqm/java/lib/ or /var/mqm/java/lib/ UNIX Environment. And in case of WINTEL, you should find the jars under C:\Program Files\IBM\WebSphere MQ\Java\lib.
Trust it clarifies...
Naren -
How to create and use mutable array of UInt8
Hello!
If I get it right, UInt8 *buffer, buffer - is a pointer to a start of array?
Then how to create and use mutable array of UInt8 pointers?
The main target is a creation of the module that will store some byte array requests and will send all of them at the propriate moment.I try
- (void) scheduleRequest:(UInt8 *)request {
if (!scheduledRequests) scheduledRequests = [[NSMutableArray array] retain];
[scheduledRequests addObject:request];
But get warning:"passing argument 1 of 'addObject:' from incompatible pointer type" -
hi, i am facing problem as to how to pass arguments received by my swf file to an .exe that i have created from a C++ project...do i need to tweak the code in the C++ project in some way that it accepts the input from the .swf file?
Hi there and welcome to our community
What you need to do is click the link below, then choose the forum most appropriate to the product you are using. In this forum we discuss the operation of the forums themselves.
http://forums.adobe.com/index.jspa
Best of luck to you in solving your issue! Rick -
HT201342 Contacts loss from iCloud and receive unknown contacts from another account
Contacts loss from iCloud and receive unknown contacts from another account. How to retrieve contacts
I automatically backup by syncing
Syncing is not a backup. You are supposed to maintain your own backups that you can restore from in the event of a problem.
See: http://support.apple.com/kb/HT4910
There are no server issues reported at:
http://www.apple.com/support/systemstatus/ -
How to copy and paste the graphics from illustrator to MS word. What I tried is exporting in png with highest resolution and then inserting in to word. This loses a bit of resolution in comparison to direct copy and paste as EMF. But if I do a copy and paste, and then take a print of the document, all the graphs and text is printed upside down, flipped back.
Use the Pencil Tool
alex
adrian stock wrote:
> How to copy and paste a single pixel
>
> I want to copy a single pixel and then paste it in the
position of
> another pixel in the same image.
>
> (This is in effect changing the colour of the target
pixel, isn't it.
> But in my case copying an existing pixel seems simpler
than selecting a
> colour from the swatch or using the colour picker.)
>
> What is the most efficient way of doing this?
>
> I tried to select one pixel with the marquee tool. Then
copied it with
> control-C, but then how do I select the target pixel and
paste with
> control-V?
>
> Thanks for your help.
>
> Adrian
> -
How to embed and launch ipa file from another ipa package created using Air for iOS
Hi Guys,
Anybody out there knowing how to embed and launch ipa file from another ipa package created using Air for iOS ?
I am having 1 ipa file created using Xcode, Now i need to include that file in my ipa Package which is created using Flash CS 5.5 and Air for iOS. Also i need to know how to open my 1st ipa file from AS3 ?
Thanks,Hi Sir,
Thanks for your reply.
But in that case user need to download 2 applications right. I need user to download my parent application created using Flash and that package contain one more ipa created using Xcode, so from my parent app only user should able to open my 2nd app. Is there any way to do that?
Ps: I am not talking about in-app but 2 individual apps inside one package. -
How to read and write a data from extrenal file
Hi..
How to read and write a data from extrenal file using Pl/sql?
Is it possible from Dyanamic Sql or any other way?
Reagards
Rajuutl_file
Re: How to Create text(dat) file.
Message was edited by:
jeneesh -
How can I stop receiving email automatically from the community when they have issues with there problems regarding the apple products.
Click here for the instructions on stopping the emails.
(85713) -
Folks,
How to Disable the Process Header, collapsible Area, and Process Warning Bar from Contacts Form of CRM 2013
Thank you.Hi,
You can deactivate the business process itself if you do not want at all. So that the header will not available for the entity.
Regards,
Priya -
How to develop and Run .jsp page from Jdeveloper 10g
Dear All,
I need to develop one small JSP page using Jdeveloper10g. pls share information How to develop and Run .jsp page from Jdeveloper 10g.
Thanks in Advance,
Hanimi.Hi Gyan,
Any Idea how to get DB connection for JSP Pages.
Our Java guys developed one JSP page for Login page.
After Log in instead of standard responsibilites page we calling custom jsp page, For getting DB connection they defined one properties file and hard coded DB details on that file and calling, but client is not accepting hard coding.
Pls give any idea for getting DB connection directly in JSP pages.
Hanimi. -
How to upload and download any file from plsql through weblogic server
hi all,
how to upload and download any file from plsql through weblogic server? i am using oracle 10g express edition and jboss.
Thanks and Regards,
MSORAhi bala ,
for a windown server u can use VNC (virtual network connection) which opens a session on u r desktop later u can drag and drop form there vice versa and for a linux box you can use Win SCP which helps to open a session with interface to u r desktop in both cases you can upload and down load files very easiy just as we drag and drop items in a simple pc .. we use the same technique...
bye
vamshi -
How to get and read a file from META-INF directory
how to get and read a file from META-INF directory in a EJB project
Use this.getClass().getResourceAsStream("/META-INF/filename");This should work. Probably, you would need to set the Manifest Class-Path attribute.
Maybe you are looking for
-
SSL VPN and Dynamic DNS - ddns on IOS
Hello, I'm trying to configure a SSL VPN tunnel via SDM on a 877 Router. The router gets the public IP address dynamically from the ISP, so I have configured the DDNS to access remotely to the router. I would like to know if it's possible to configur
-
after i have downloaded an album from iCloud to my new macbook pro. Itunes will only play one song at a time. If i hit the fast forward or back button will not do anything. I have to use the mouse to hit the next tidal in the album then hit play for
-
Shift key somehow stuck on my 2-week old MBP
Did anyone have this problem before? I turned on my 2-week old uMBP 13" and it wouldn't accept my password! After minutes of frustration, I booted into Single user mode and that was when I realized the Shift key is somehow stuck! Typing will show eve
-
Hi everyone.. Please help me to solve this issue.Sorry for asking this dumb question. I was trying to find where the "CGI environment variables" are set in the middle tier. select owa_util.get_cgi_env('SERVER_NAME') from dual --> apex1.company.com Fr
-
Business Explorer Roles and Authorizations
Hi, I am using Business Explorer Query Designer and Analyzer ( Excel Work book add on) with BI 7.0. I need to create roles and authorizations for the end users to create queries and view queries in excel by using Business Explorer Query Analyzer. Kin