How do you access a form using jsp custom tag

I've made a jsp page that shows a text input field and allows the user to input the name. When the user clicks the 慏one?button on the first page ,it will be posted to the second page jsp. I want to use custom tag to show 慤sername?

Now using custom tag how do you access a form or any site links out there to look at?

code:

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>User form</title>

</head>

<body>

<h1>User Info Entry Form</h1>

<form action="hello.jsp" method="post">

<table>

<tr>

<td>Name:</td>

<td><input type="text" name="userName" >

</td>

</tr>

<tr>

<td colspan=2><input type="submit" name = "done"></td>

</tr>

</table>

</form>

</body>

</html>

Message was edited by:

suse69

[1050 byte] By [suse69a] at [2007-11-27 7:02:59]
# 1

You wouldn't access the form directly.

When the form is submitted it will send request parameters as name/value pairs

ie if you typed in "John" and pressed submit, the url would be to

hello.jsp?userName=John

You then get it in code via request.getParameter("userName");

You can get the request from the pageContext object available to every custom tag.

evnafetsa at 2007-7-12 18:54:06 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...