Forums Register Login

passing parameters to jsp page

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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).]
+Pie Number of slices to send: Send
William:
What JSP and Servlets versions will your book cover?
Opportunity is missed by most people because it is dressed in overalls and looks like work - Edison. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 2022 times.
Similar Threads
passing initial parameters to jsp
accessing .dcr files from jsp pages
how to add a scroll bar on alert box to display extremely long message
call a html/jsp page from an applet and pass parameters in post method
passing parameters from jsp to servlets????
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 19, 2024 05:09:37.