Hi,
Your above code contain multiple errors. I have give sample code below you can try it.
(a)
"FileName.html"
<html>
<head>
<title>File Name</title>
</head>
<body>
<form method="post" action="FileName.jsp">
<br>
<center>
<br>
<b>
Enter File name here:
<input name="fileName" type="text">
<br>
<input type="submit" name="submit" value="ENTER">
</b>
</center>
</form>
</body>
</html>
(b)
FileName.jsp
<%-- Get the filename here--%>
<% String file=request.getParameter("fileName"); %>
%>;
<%-- if there is no entry for filename,prompt user to enter some name ,redirect him to the same page --%>
<%
if(file.equals("")) {%>
<jsp:forward page="FileName.html"/>
<%}
if(file.length()!=0) {%>
<jsp:forward page="Import.jsp">
<jsp
aram name="noFilename" value="<%=file%>"/>
</jsp:forward>
<% } %>
(c)
Import.jsp
<% out.println(request.getParameter("noFilename")); %>
When you execute
"http://localhost:8080/FileName.html"
You can enter some filename or leave blank and press enter
If the file name is entered , it will be echoed back, If nothing is entered then the same page will be displayed.
solaiappan