Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JSP forward doubt  RSS feed

 
Aravind Prasad
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is my program..
The thing.. it is doing..
taking the parameter from the html page..
the parameters are country names..
and in the same folder..
the name corresponding to the country are there..
for egs.. kenya.html.. uganda.html..

when one country is selected from the combobox..
it should automatically redirect to the file .. corresponding to that html file..



the program here is wrong..
how can i make it correct

please reply me!!!


<html>
<head>
<title>Checking something
</title>
</head>
<%@ page language="java" session="true" %>
<body>
<%
StringBuffer tmp = new StringBuffer();
tmp.append(request.getParameter("D1"));
tmp.append(".htm");
out.println(tmp.toString());%>
<jsp:forward page=tmp.toString() />
<br>

</body>
</html>
[ December 28, 2005: Message edited by: Bear Bibeault ]
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 36406
454
Eclipse IDE Java VI Editor
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65826
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First: is there a reason that you are doing this in such a convoluted and complicated way? It's a very easy matter to use a small snippet of Javascript on the submitting page without having to write an intermediate JSP page to perform a forward operation.

Secondly: check the syntax of your jsp forward action.
[ December 28, 2005: Message edited by: Bear Bibeault ]
 
Stefan Evans
Bartender
Posts: 1834
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<jsp:forward page="<%= tmp.toString() %>" />
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!