• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JSP forward doubt

 
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
author & internet detective
Posts: 41878
909
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving to our JSP forum.
 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Bartender
Posts: 1845
10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<jsp:forward page="<%= tmp.toString() %>" />
 
reply
    Bookmark Topic Watch Topic
  • New Topic