• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

JSP

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello! sir
I have a basic dought i.e. can we use forward tag to forward control html and Image Files of extension .gif,.mpg etc.
I had been tryied for the bellow code for several days to get it work but i could not.I have 3 files HTML file called Forward.html, JSP file Forward.jsp,and one.gif.If user dosenot enter in the text filed of HTML and submit the same to JSP it should give a HYPERLINK and When some thing filled in the input filed and submit the same to JSP it should froward the control to some other page, here Image1.html.so can u make the correct please.
.................................................................
Forward.html
*************
<FORM name="f" action= "Forward.jsp" >
name:<INPUT TYPE="text" NAME="n1"><br>
<INPUT TYPE="button" name="sub" value="sub" onClick="submit_form()">
<input type='submit' value="submit" >
.................................................................
Forward.jsp
***********
<%! String s=null; %>
<%
s=request.getParameter("n1");
if(s!=null)
{
%>
<jsp:forward page="/Image1.html"/>
<%}
else
{
%>
<a href="http://localhost:8080/Forward.html">back</a>
<%
}
%>
.................................................................
Image1.html
***********
<img src="/one.gif">
.................................................................
 
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I took a pain to test your code.. nothing wrong. everything working fine.
I changes the below line
<a href="http://localhost:8080/Forward.html">back</a>
as <a href="Forward.html">back</a>
Since It is working for me, I could not able to tell you exactly at which phase your getting problem.
try once again with these points in mind.
All HTML files whould have HTML... It means
since JSP file also become a HTML just before displaying
You must add you JSP code under HTML..tags only.
I just this could be the problem
Mohana

 
What I don't understand is how they changed the earth's orbit to fit the metric calendar. Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic