• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to pass parameter to java program??

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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...
 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sumana,
thanx alot, my things can work already....
 
And then the flying monkeys attacked. My only defense was this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic