wood burning stoves 2.0*
The moose likes JSP and the fly likes How to open new jsp page in current tab by click on menu? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "How to open new jsp page in current tab by click on menu?" Watch "How to open new jsp page in current tab by click on menu?" New topic
Author

How to open new jsp page in current tab by click on menu?

Sumit Sonone
Greenhorn

Joined: Oct 02, 2013
Posts: 4
<td class="bottomlinks"><a href="home.jsp">Homepage</a></td>

This is my menuitem. When i click on menu then it opens a new jsp page in the new tab and current tab still remains. I want to close current page and open new page in current tab. Please someone help me...
J. Kevin Robbins
Ranch Hand

Joined: Dec 16, 2010
Posts: 632
    
    7

That's controlled two ways. By the "target" attribute of the href element, and by the browser settings. Since you aren't using the target attribute, the link should open in the same window. If it isn't, that means the browser is configured to open links in a new tab and you have no control over that unless you use Javascript in your links instead of standard html. If you want to try that tactic, search on "location.href" for tips.


"There is no reason for any individual to have a computer in his home" ~ Ken Olson, Co-founder of DEC, 1977
Sumit Sonone
Greenhorn

Joined: Oct 02, 2013
Posts: 4
What should i write in the <script> tag and where it should be placed.
Sumit Sonone
Greenhorn

Joined: Oct 02, 2013
Posts: 4
I got the answer. It should be like <td class="toplinks"><a href="home.jsp">Homepage</a></td>
The target attribute should not be included.
Thanks for response...
 
 
subject: How to open new jsp page in current tab by click on menu?
 
Similar Threads
Struts Menu Question
ssl with Tomcat
submitting form on menu click
How to develop horizontal and vertical menus
why google chrome sucks