• Post Reply Bookmark Topic Watch Topic
  • New Topic

iframe problem not redirecting to another page  RSS feed

 
harish pathak
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • 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
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • 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.
 
Richard Green
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
  • 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">
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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
  • 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 ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!