简体   繁体   中英

Why is this Google App Engine application unexpectedly redirecting to google login page?

I deployed a small application that I created using Java and Facebook Javascript SDK. The app works fine till it opens my first page idex.jsp. Here, I have a submit button with the name "Enter". When I click on this, it takes me to Google account's sign in page rather than showing me the contents of the next page. How do I remove this unwanted redirection to Google login? I don't have any code in my application that performs this redirection.
Also, when I press enter in some browsers such as IE, the enter button doesn't do anything!! But when I normally run the app with myapp.appspot.com, it does take me to the second page of my application. Can someone please help?

Here is part of my code in index.jsp that takes me to the next page.

<form action="check_gender" name ="check_gender" method ="post">

<table width="100%" height="30" border="0"> 
  <tr>
      <td bgcolor="#C0C0C0"width="800" height="50" align="center"><img src="xyz.jpg" width="60%" height="302"></td>
  </tr>
</table>  
    <%String name=(String) request.getParameter("my_input_field");%>
    <%String gender=(String) request.getParameter("my_input_field1");
    System.out.println(request.toString());
    request.getSession().setAttribute("name",name);
    request.getSession().setAttribute("gender",gender);
    %>
  <table width="100%" height="30" border="0"> 
  <tr>
    <td><h2>Hello <%=name%>!</h2></td>
  </tr>
  <tr>
    <td align="center">
    <div id="header" style="background-color:#FFD700;">
<h1 style="margin-bottom:0;">some name</h1></div></td>
  </tr>

    <tr><td>&nbsp;</td></tr>
  <tr><td>&nbsp;</td></tr>
  <tr><td>&nbsp;</td></tr>
  <tr><td>&nbsp;</td></tr>
  <tr><td>&nbsp;</td></tr>
  <tr>
    <td height="31" align="center"><em>PLEASE PRESS ENTER TO CONTINUE</em></td>
  </tr>
  <tr>
    <td height="76" align="center"><input type="submit" name="enter" value="ENTER" style="width:140px; height:60px;"></td>
  </tr>
  <tr><td>&nbsp;</td></tr>
  <tr><td>&nbsp;</td></tr>
  <tr><td>&nbsp;</td></tr>
  <tr><td>&nbsp;</td></tr>
  <tr><td>&nbsp;</td></tr>
  <tr>
    <td height="76" align="center">
    <p>
     <div id="footer" style="background-color:#FFD700;clear:both;text-align:center;">    
            <p>Help us share  by liking this app. Click on the like button below.</p>
                    <div class="fb-like" data-href="http://apps.facebook.com/myappname" data-send="true" align="center"></div><br>
                    <div class="fb-facepile" data-href="http://apps.facebook.com/myappname" data-max-rows="1" data-width="450" align="center"></div></div>
            </td>
  </tr>


</table>
 </form>       

Found the problem. Somewhere in the end, my web.xml has a tag.

<security-constraint> <web-resource-collection> <web-resource-name>check_gender</web-resource-name> <url-pattern>/check_gender</url-pattern> </web-resource-collection> <auth-constraint> <role-name>*</role-name> </auth-constraint> </security-constraint> 

I totally forgot about this!!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM