File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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 Android Security Essentials Live Lessons this week in the Android 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??
 
Similar Threads
a session problem
Not able to set attribute in JSP
how to access a session value on JSF page?
How to pass more than 1 parameters into the sevlet???
JSP request.getParameter