Re: Error matching patterns problem-solved, maybe [OT] cooperation with struts question
Admin <administration-M2Np1/[email protected]> Thu, 27 Feb 2003 10:51:17 +0200
| Newsgroups | gmane.comp.java.securityfilter.user |
|---|---|
| Message-ID | <[email protected]> |
Max Cooper wrote:
> I don't see any reason why you should need to, but perhaps renaming the
> login and error pages would help us determine what is going wrong. The
> example app that I have done the most testing with uses these names
...
> Does it do this for any request? If not, could you send us a URI that leads
> to the error.
>
> -Max
Thanks for pointing me to login and error pages Max.
After moving and renaming my login and error pages and restarting web-app
several times I finally noticed that I get error message from the
sax parser about my securityfiltef-config.xml file in my connectionURL in
the Tomcat I/O log
Errors:
1. the realm-param was closed with > not with />
2. jdbc:mysql://192.168.0.2/security?user=xxx;password=yyy
doesn't work JDBC Driver uses user with name xxx;password=yyy and
no password
The corrected realm is
<realm className="org.apache.catalina.realm.JDBCRealm">
<realm-param name="driverName" value="com.mysql.jdbc.Driver" />
<realm-param name="debug" value="99" />
<realm-param name="connectionURL" value="jdbc:mysql://192.168.0.2/security?user=xxx&password=yyy" />
<realm-param name="userTable" value="users" />
<realm-param name="userNameCol" value="user_name" />
<realm-param name="userCredCol" value="user_pass" />
<realm-param name="userRoleTable" value="user_roles" />
<realm-param name="roleNameCol" value="role_name" />
</realm>
> > <realm className="org.apache.catalina.realm.JDBCRealm">
> > <realm-param name="driverName" value="com.mysql.jdbc.Driver"/>
> > <realm-param name="debug" value="99"/>
> > <realm-param name="connectionURL"
> value="jdbc:mysql://192.168.0.2/security?user=xxx;password=yyy">
> > <realm-param name="userTable" value="users"/>
> > <realm-param name="userNameCol" value="user_name"/>
> > <realm-param name="userCredCol" value="user_pass"/>
> > <realm-param name="userRoleTable" value="user_roles"/>
> > <realm-param name="roleNameCol" value="role_name"/>
> > </realm>
I have another question:
I user Struts 1.1 and the /admin/* module which is protected from the
securityfilter to be accessible only for users in admin role.
If I'm not logged in I cannot access the /admin/* module,
but I don't get redirected to login or error page.
The browser just waits on empty page
In my struts-config.xml I define global forward that I use to swith to
admin module
<global-forwards>
<forward name="admin" contextRelative="true" path="/admin/index.do" redirect="true" />
</global-forwards>
in struts-admin.xml i define action mapping forwarding to index.jsp
<action-mappings>
<action path="/index" forward="/index.jsp" />
</action-mappings>
so when I use the http://localhost:8081/admin/index.do URL in my browser
it waits on blank page.
How can I define an error or other page so the user receives some info
and doesn't just get a blank browser windows.
I guess maybe this post is more for the struts-user mail list,
but it is secutiryfilter related imho.
Thanks again for the help!
--
Alexander Dimitrov
Forrester: You're the man now, dog!
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com