简体   繁体   English

为什么这个Google App Engine应用程序意外地重定向到google登录页面?

[英]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. 我部署了一个使用Java和Facebook Javascript SDK创建的小型应用程序。 The app works fine till it opens my first page idex.jsp. 该应用程序可以正常工作,直到打开我的第一页idex.jsp。 Here, I have a submit button with the name "Enter". 在这里,我有一个名为“ 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. 当我单击此按钮时,它将带我到Google帐户的登录页面,而不是向我显示下一页的内容。 How do I remove this unwanted redirection to Google login? 如何删除这种不必要的重定向到Google登录名? 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!! 另外,当我在某些浏览器(例如IE)中按Enter键时,enter键什么也不做! But when I normally run the app with myapp.appspot.com, it does take me to the second page of my application. 但是,当我通常使用myapp.appspot.com运行该应用程序时,确实会将我带到应用程序的第二页。 Can someone please help? 有人可以帮忙吗?

Here is part of my code in index.jsp that takes me to the next page. 这是我在index.jsp中的代码的一部分,将我带到下一页。

<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. 最后,我的web.xml有一个标记。

<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!! 我完全忘记了!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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