File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes passing parameters to jsp page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "passing parameters to jsp page" Watch "passing parameters to jsp page" New topic

passing parameters to jsp page

prasad Chandrasekaran Iyer

Joined: Jan 14, 2004
Posts: 18
if i want to pass parameters to .jsp file form an html file,
what i should mention In the ACTION of html page
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13036
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>
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.
prasad Chandrasekaran Iyer

Joined: Jan 14, 2004
Posts: 18
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
<title>Jsp page</title>
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>
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
and i am getting the second page like this with an error page.

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

can anybody help me out with this problem
Joe Paolangeli
Ranch Hand

Joined: Apr 05, 2000
Posts: 73
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).]
Tony Alicea

Joined: Jan 30, 2000
Posts: 3226
What JSP and Servlets versions will your book cover?

Tony Alicea
Senior Java Web Application Developer, SCPJ2, SCWCD
I agree. Here's the link:
subject: passing parameters to jsp page
It's not a secret anymore!