• 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

iframe problem not redirecting to another page

 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I am using iframe (<iframe src="\a2\login.jsp">)in my login.jsp page.
login.jsp is a login page. When I enter username and password and submit the form it doesn't redirect to another page. Instead of this it shows the same page.
But if I use response.sendRedirect in login.jsp instead of iframe it redirect to another page.
The problem is in iframe that restrict to redirect to another page.
action of the form (form action="\LoginServlet") is servlet that redirect to another page.

where I am going wrong.

Anybody please answer.

Thanks
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
harish pathak,

I can't really understand what you're asking.
Could you try to re-word your question again.
If you're having trouble with English, maybe a code example or two would help to make your question clear.
 
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by harish pathak:
Hi All,

I am using iframe (<iframe src="\a2\login.jsp">)in my login.jsp page.
login.jsp is a login page. When I enter username and password and submit the form it doesn't redirect to another page. Instead of this it shows the same page.
But if I use response.sendRedirect in login.jsp instead of iframe it redirect to another page.
The problem is in iframe that restrict to redirect to another page.
action of the form (form action="\LoginServlet") is servlet that redirect to another page.

where I am going wrong.

Anybody please answer.

Thanks


You need to specify a "target" for your iframe.

Try <iframe target="_top" src="/a2/login.jsp">
 
Sheriff
Posts: 67746
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

Originally posted by Lynette Dawson:

You need to specify a "target" for your iframe.



There is no target attribute for the iframe element. And it makes no sense for there to be one. I have no idea what is being suggested here, but it's not valid.
 
Richard Green
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oops. Sorry.

My understanding of the question is that the login page is displayed within an iframe and when the form is submitted, it loads the next page within the same iframe. 'harish pathak' wanted the next page to take over the whole window. (Correct me if I have misunderstood the question)

Links/Forms within the iframe page should be set to target="_top" if you want the link to take over the whole window.

<form action="loggedIn.jsp" method="post" target="_top">
[ August 08, 2006: Message edited by: Lynette Dawson ]
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic