Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > JSP Basics
| Search | Today's Posts | Mark Forums Read
JSP Basics Beginning-level questions on JSP. More advanced coders should post to Pro JSP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the JSP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old August 3rd, 2006, 11:43 PM
Registered User
 
Join Date: Aug 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Form-based Authentication Error

Hi,all

I got the attraction example with SQLServer, and everything is fine except
WARNING: Security role name attraction used in an <auth-constraint> without being defined in a <security-role>

and When I logon

I got this

message /attraction/j_secruity_check
description The requested resource (/attraction/j_secruity_check) is not available.

Before I came here, I had gone around these resources:

http://tomcat.apache.org/tomcat-3.3-...alm-howto.html
http://www.onjava.com/pub/a/onjava/2002/06/12/form.html
http://p2p.wrox.com/topic.asp?TOPIC_...Authentication

and the Context in server.xml lies below:

    <Context path="/attraction" docBase="attraction" debug="0" reloadable="true">
        <Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
            driverName="com.microsoft.jdbc.sqlserver.SQLServer Driver"
            connectionURL="jdbc:microsoft:sqlserver://127.0.0.1:1433;DatabaseName=MK;"
            connectionPassword=""
            connectionName="mk"
            userTable="attraction"
            userNameCol="user_id"
            userCredCol="password"
            userRoleTable="user_role"
            roleNameCol="role_name"
        />
    </Context>

In the Web.xml:
<security-constraint>
    <auth-constraint>
        <role-name>attraction</role-name>
    </auth-constraint>
</security-constraint>

And I am sure about the basic environment is ok, such as struts.jar,connectionPool,struts-config.xml, Tomcat5.5.16,etc.

Please Help me out, or just communicate here.
I saw so much people come around this problem, but none get answered in this forum.
And Actually I surfing around the websites, maybe this is the last one I can do.

Any useful information on above is appreciated
  #2 (permalink)  
Old August 4th, 2006, 01:12 AM
Registered User
 
Join Date: Aug 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default


the current status of the problem
13:24:46 8/4/2006
after modified as below, no warn again, but the link is Wrong
     <security-constraint>
<!--
      <auth-constraint>
          <role-name>attraction</role-name>
      </auth-constraint>
       -->
  </security-constraint>
  <security-role>
      <role-name>attraction</role-name>
  </security-role>

14:04 8/4/2006
Modified the Action and struts-config.xml, we got this:
Now we got the gut:
HTTP Status 404 - /attraction/j_secruity_check
message /attraction/j_secruity_check
description The requested resource (/attraction/j_secruity_check) is not available.



  #3 (permalink)  
Old August 4th, 2006, 09:05 AM
Registered User
 
Join Date: Aug 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

18:08:12 8/4/06
ÐÞ¸ÄÔ´´úÂëΪ
<form action="<%= response.encodeURL("j_security_check") %>" focus="j_username" method="post">


µ«ÊdzöÏÖ²»ÄÜÁ¬½ÓÓÐЧÊý¾Ý¿ âµÄ´íÎó:
Can't start a cloned connection while in manual transaction mode.µÈµÈ
ËùÒÔÔÚÁ¬½Ó×Ö·û´®ÖмÓÈëÏÂà æµÄºì×Ö
connectionURL="jdbc:microsoft:sqlserver://127.0.0.1:1433;DatabaseName=MK;SelectMethod=cursor "
×¢ÒâÖ»ÔÚjdbcRealmÖÐÌí¼Ó¾Í¿ÉÒÔ Ë,²»ÓÃÔÚDBInitServlet³õʼ»¯Ê±Ò² í¼Ó.

³öÏÖµÄÎÊÌâÊǵ±Ñé֤ͨ¹ýºó, á³öÏÖÏÂÃæµÄÎÊÌâ
HTTP Status 400 - Invalid direct reference to form login page
description The request sent by the client was syntactically incorrect (Invalid direct reference to form login page).

²»ÄÜÖ±½ÓÒýÓõǼҳÃæ,ÒòΪ ÒÔÚactionдÁ˸öתÏò´úÂë(×Ô×÷ ´ÏÃ÷)
µ±Óöµ½±£»¤ÄÚÈݺó,»á×Ô¶¯µØ ªµ½µÇ¼ҳÃæµÄ.




Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with Form based Authentication shujamughal ASP.NET 2.0 Professional 3 May 25th, 2007 05:34 AM
Form based authentication.... avanishp General .NET 2 June 17th, 2005 03:11 AM
Form based authentication with WLS7 jcgarciap J2EE 1 March 9th, 2005 01:15 PM
form-based authentication using a database waru BOOK: Beginning ASP.NET 1.0 2 May 28th, 2004 10:37 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.