• 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

passing parameters to jsp page

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
if i want to pass parameters to .jsp file form an html file,
what i should mention In the ACTION of html page
prasad
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is an example from my forthcoming book on servlets and JSP
<form action="TableDemoC.jsp" method="GET">
Enter Number to be shifted: <input name="numb" type="text" size="10">
<input type="hidden" name="studentid" value="thx1138" >
<input type="submit" value="Show" name="go" ><br>
</form>
As you see, the action just points to the JSP page which lives in a directory with HTML pages, etc. - as opposed to sending to a servlet where you have to use the servlet alias.
Bill
 
prasad Chandrasekaran Iyer
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi and thanks for ur reply.
I tried to do the way that u mentioned but still i am getting error.
this is my HTML page and i am giving my name here
<html>
<head>
<title>Jsp page</title>
<body>
hello how r u
<form ACTION="abc1.jsp" METHOD="GET" >
if you don't mind me asking what is ur name
<input type=text name="name"><p>
<input type=submit>
</form>
</body>
</head>
</html>
This is my JSP page, and i am passing parameters to this page.
And i mentioned HTML and JSP pages in PUBLIC_HTML directory in weblogic server.
and i started the weblogic server, and i given url like this
http://localhost:7001/abc.html
and i am getting the second page like this with an error page.
http://localhost:7001/abc1.jsp?name=prasad

<html>
<head>
<title> first jsp page</title>
<body>
<h1>
<% if(request.getParameter("name")==null){
out.println("hello world");
}
else{
out.println("hello, "+ request.getParmater("name"));
}
%>
</h1>
</body>
</html>

can anybody help me out with this problem
prasad
 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It works fine, you just need to fix your typing error:
change "getParmater" to "getParameter"
[This message has been edited by Joe Paolangeli (edited August 31, 2000).]
 
Desperado
Posts: 3226
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
William:
What JSP and Servlets versions will your book cover?
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic