aspose file tools*
The moose likes JSP and the fly likes How to pass parameter to java program?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "How to pass parameter to java program??" Watch "How to pass parameter to java program??" New topic
Author

How to pass parameter to java program??

Ann Toh
Ranch Hand

Joined: Jul 18, 2003
Posts: 45
Hi,
can anybody tell me how to pass parameter from a form in a JSP page to a java program???
<FORM ACTION="http://localhost:8080/SDC1/servlet/parserupload?Name=<%= session.getAttribute("theName")%>" METHOD=POST ENCTYPE="multipart/form-data">
the above codes is the form tag but how to put <%=session.getAttribute("theName")%> into a string so that i can pass the string to my program???


Thanx in advance...
sumana ar
Greenhorn

Joined: Aug 06, 2003
Posts: 28
i usually use a string to store the url and pass that string to the action..this is shown below..
-------------------------
<%
String att = (String) session.getAttribute("theName");
String url = "http://localhost:8080/SDC1/servlet/parserupload?Name="+att;
%>
<FORM ACTION=<%=url%> METHOD=POST ENCTYPE="multipart/form-data">
---------------
hope this helps solve u'r problem

--sumana
Ann Toh
Ranch Hand

Joined: Jul 18, 2003
Posts: 45
Hi Sumana,
thanx alot, my things can work already....
 
Don't get me started about those stupid light bulbs.
 
subject: How to pass parameter to java program??