Member Avatar for feoperro

Hi,

I would like to know if it's possible to specify the "target='FrameName'" in response.sendRedirect("Home.jsp") by any chance?

I tried this:

<!-- Security Check -->
        <form action="Login" target="_top">
            <%
        if ((String) request.getSession(false).getAttribute("sessionStatus") == null) {
            response.sendRedirect("Login?pageTimeout=yes");
        }
            %>
        </form>
        <!-- Security Check -->

But it doesn't work... The target remains the same.

Thanks,
-Ashton.

use a servlet to perform your check and then add a target attribute to the request object and forward it to the JSP

Member Avatar for feoperro

Hi,

I found an easy script to do this:

<script type="text/javascript">
            function breakout() {

            <%
            if ((String) request.getSession(false).getAttribute("sessionStatus") == null) {
            %>

                    if (window.top != window.self) {
                        window.top.location="Login"
                    }

            <%
            }
            %>
                    
            }
        </script>

Place that script in your <head></head> tags, then call it like this:

<body onload="javascript:breakout();">

Thanks,
-Ashton.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.