How to use GET and Post methods in the same JSP form? URGENT PLEASE!!!
I have 2 programs,
*dealForm.jsp to accept a currency, convert it a
*dealLoad.jsp to store the details of the dealForm in my database.
In the form, before the dataload part, I convert the entered amount into required currency. The URL to retrieve this information is:
http://finance.yahoo.com/download/javasoft.beans?SYMBOLS=USDDEM=x&format=ab
I can write a program with the following code to get the information from the URL:
String urlString = "http://finance.yahoo.com/download/javasoft.beans?SYMBOLS=" +symbol + "&format=ab";try {URL url = new URL(urlString);URLConnection con = url.openConnection();InputStream is = con.getInputStream();InputStreamReader isr = new InputStreamReader(is);BufferedReader br = new BufferedReader(isr);String line = br.readLine();StringTokenizer tokenizer = new StringTokenizer(line,",");name = tokenizer.nextToken();name = name.substring(1, name.length()-2); // remove quotesprice = tokenizer.nextToken();price = price.substring(1, price.length()-2); // remove quotes } catch (IOException exception) {System.err.println("IOException: " + exception);
The code was fro an example I saw on the net. The following piece of JSP will retrieve the value.
<form action="dealForm.jsp"method="GET"> <p>Enter Symbol: <input size="20" name="symbol"><inputtype="submit" value="Submit"></p></form><%if (request.getParameter("symbol") != null) {%>
The Problem:
My actual form, before using the code to convert, is set up in a way that the dealForm.JSp has a 'POST' and calls another jsp to loaddata intothe database.
However, the above code uses "GET" method so that the dealForm.jsp's action tag calls dealForm.jsp itself.
Is it possible to combine these two? I am nowhere near making my code work, and can someone please help?
Thanks for your time!

